949 Commits

Author SHA1 Message Date
Jannis Mattheis
14bfc25627 Merge pull request #1033 from UiP9AV6Y/feature/oidc-claim-mapping
feat: add support for mapping user admin status from OIDC claims
v3.1.0
2026-08-26 16:17:42 +00:00
Jannis Mattheis
585b9e366a chore: update oidc readme 2026-08-26 16:54:30 +02:00
Gordon Bleux
3b473fd4ac feat: map user admin status from OIDC group claims
Co-Authored-By: Jannis Mattheis <contact@jmattheis.de>
2026-08-26 16:54:30 +02:00
Jannis Mattheis
14f703797e fix: read username claim from ID token with userinfo fallback
Some IdPs don't provide or only provide the claims in the ID token /
userinfo. Most clients will check both claims.
2026-08-23 11:36:11 +02:00
Jannis Mattheis
54deea62a5 Merge pull request #1035 from gotify/panic
fix: panic when write on closed channel
2026-08-23 07:51:15 +00:00
Jannis Mattheis
eec23c7d67 fix: panic when write on closed channel 2026-08-21 13:56:28 +02:00
Jannis Mattheis
693303453c Merge pull request #1029 from DerDummePunkt/github_1007_option_to_redirect_to_idp_when_logged_out
feat: auto-redirect to OIDC IdP (#991)
2026-08-20 20:55:04 +00:00
Jannis Mattheis
82856b6ae1 fix: reorder local auth 2026-08-19 21:04:21 +02:00
Bernd Konrad
32d240b394 feat: add GOTIFY_OIDC_PROMPT config 2026-08-19 21:04:19 +02:00
Bernd Konrad
d8b34c068f feat: auto-redirect to OIDC IdP (#991) 2026-08-19 21:04:14 +02:00
饺子w (Yumechi)
8af44e0957 Merge pull request #1030 from gotify/go-imports
chore: update go module path to github.com/gotify/server/v3
2026-08-16 09:12:59 +00:00
Yumechi
5a36c8c42b chore: update go module path to github.com/gotify/server/v3 2026-08-16 17:01:00 +08:00
Jannis Mattheis
ef41eba797 Merge pull request #1022 from DerDummePunkt/github_991_ux_improvments_configurable_oidc_login_button_text
#991 ux improvements: OIDC Login Label
2026-08-15 11:10:08 +00:00
Jannis Mattheis
7723d137d8 fix: use idp name everywhere 2026-08-15 13:00:48 +02:00
Bernd Konrad
2636b09532 seems like the formatting rules that caused the length function
defintiion to have line breaks is what causes the line by line coverage
rate to drop below the threshold.

added new router test for /gotifyinfo to rectify that.
2026-08-14 10:58:50 +02:00
Bernd Konrad
24070e0af4 removed newline at the end of swagger doc.
i dont know which tool added that, but now the CI seems to fail becuase
of it.
seems a bit odd that i have to commit stuff before the CI spits out
reproduceable results.
2026-08-14 10:25:27 +02:00
Bernd Konrad
bebd948075 restored original parameter ordering.
used project formatting tools to (hopefully) resolve automated checks
2026-08-14 10:06:23 +02:00
Bernd Konrad
4b2fa6ace4 fixed bug: wrong order of arguments in ui.Register 2026-08-14 09:44:31 +02:00
Bernd Konrad
8649d61e3a merged origin master 2026-08-14 09:44:12 +02:00
Jannis Mattheis
aceb5ff519 Merge pull request #1020 from DerDummePunkt/github_1007_option_to_disable_local_login_when_oidc_enabled
feat: #1007 - Option to disable local login when OIDC is enabled
2026-08-13 19:05:03 +00:00
Bernd Konrad
795d9d1210 feat: disable local auth 2026-08-13 20:47:59 +02:00
Jannis Mattheis
491a17a530 Merge pull request #1025 from SulimanAbdulrazzaq/feat/highlight-current-session
feat(ui): highlight current client session
2026-08-12 09:51:59 +00:00
Suliman Abdulrazzaq
d0af308e71 feat(ui): highlight current client session 2026-08-12 11:43:01 +02:00
饺子w (Yumechi)
f99673f031 Merge pull request #1014 from gotify/bcrypt-errors
fix: remove panic() and relay password hashing errors to UI
2026-08-10 09:28:58 +00:00
Yumechi
75bc19c111 fix: remove panic() and relay password hashing errors to UI 2026-08-06 12:32:23 +08:00
Jannis Mattheis
c27a381a67 fix: remove goreportcard 2026-07-31 16:58:23 +02:00
饺子w (Yumechi)
d543a8aad2 Merge pull request #1010 from gotify/keep-oidc-id
fix: don't drop oidc_id when updating users
2026-07-24 14:33:31 +00:00
Jannis Mattheis
d09ea4e169 fix: don't drop oidc_id when updating users 2026-07-24 11:01:31 +02:00
饺子w (Yumechi)
ad137d69ad Merge pull request #1005 from Osamaali313/fix/plugin-instances-map-race
Fix unsynchronized map write in plugin Manager.RemoveUser
2026-07-22 01:13:13 +00:00
Osamaali313
883ca85a68 Fix unsynchronized map write in plugin Manager.RemoveUser
`Manager.RemoveUser` deletes from `m.instances` without holding `m.mutex`:

    delete(m.instances, pluginConf.ID)

Every other access to `m.instances` is synchronized — `Instance` reads it
under `m.mutex.RLock()`, and the writes in `InitializeForUserID` /
`initializeSingleUserPlugin` happen under `m.mutex.Lock()`. The adjacent
`inst.Disable()` call in this same loop is even wrapped in Lock/Unlock, so
only the map delete is left unguarded.

`RemoveUser` is registered as the `OnUserDeleted` callback (router.go), fired
when an admin deletes a user, while any authenticated request to the plugin
API (`GET /plugin`, `/plugin/:id/*`) concurrently reads `m.instances` via
`Instance`. A `RLock` reader is not protected against a writer that never
takes the mutex, so this races and triggers Go's runtime-fatal
"concurrent map read and map write", crashing the whole server (a fatal that
gin.Recovery cannot recover). Take the write lock around the delete, matching
every other access.
2026-07-18 23:34:59 +03:00
Jannis Mattheis
497f9459d2 Merge pull request #1003 from gotify/csrf
Csrf
v3.0.0
2026-07-18 12:08:41 +00:00
Jannis Mattheis
97c425c0ab fix: appid mapping for sending messages 2026-07-17 14:32:08 +02:00
Jannis Mattheis
d832b1a41d fix: prevent csrf for cookie requests
Prevously, the token was passed as X-Gotify-Key by the UI, so there was
no csrf because no cookie was added by the browser to the request.

The cookie is saved by SameSite=strict, this provides some protection
against csrf. But an subdomain takeover could still allow for csrf. E.g.
evil.gotify.net could send authenticated requests to gotify.net.

This uses the go builtin cross origin protection, listed on the owasp
page: https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#built-in-or-existing-csrf-implementations
2026-07-17 14:09:48 +02:00
Jannis Mattheis
50b917af4d Merge pull request #1000 from gotify/next
fix: don't include scheme://host inside next
2026-07-17 10:10:24 +00:00
Jannis Mattheis
fdf6ce86ea fix: don't include scheme://host inside next 2026-07-16 21:00:37 +02:00
饺子w (Yumechi)
bd6dd763c6 Merge pull request #1002 from gotify/renovate/actions-setup-go-7.x
chore(deps): update actions/setup-go action to v7
2026-07-16 09:10:02 +00:00
renovate[bot]
bd63a04c2f chore(deps): update actions/setup-go action to v7 2026-07-16 09:03:18 +00:00
饺子w (Yumechi)
ec4e2d50a1 Merge pull request #998 from TowyTowy/fix/plugin-messenger-application-id
fix: create internal application when plugin adds Messenger after init
2026-07-16 05:25:15 +00:00
饺子w (Yumechi)
a9cec79072 Merge branch 'master' into fix/plugin-messenger-application-id 2026-07-16 04:20:59 +00:00
TowyTowy
074b822b4a fix(plugin): reject messenger messages without an internal application
Add a final safety net in redirectToChannel.SendMessage that refuses a
message when ApplicationID == 0, so it can never be stored as an orphaned
message (application_id = 0, not shown, not deletable). Requested in review.

Cover the previously untested error branches around internal-application
back-fill (create/update failures) so patch coverage no longer regresses.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-15 22:02:09 +02:00
Jannis Mattheis
e2b6a2e828 Merge pull request #992 from gotify/oidc-log
fix: more oidc logging
2026-07-15 17:35:37 +00:00
饺子w (Yumechi)
9f7dc63def Merge pull request #999 from gotify/renovate/actions-setup-node-7.x
chore(deps): update actions/setup-node action to v7
2026-07-14 12:49:29 +00:00
renovate[bot]
69f2ef4b63 chore(deps): update actions/setup-node action to v7 2026-07-14 05:13:46 +00:00
TowyTowy
8c03d2692c fix: create internal application when plugin adds Messenger after init
When a plugin gains the Messenger capability after it was first
initialized for a user, its plugin conf already exists without an
associated internal application (ApplicationID == 0). Messages sent by
the plugin were then stored with application_id = 0, orphaning them:
they disappeared on reload and could not be deleted (#653).

Back-fill the internal application during initialization when a
Messenger plugin has none yet, mirroring the creation already done for
plugins that support Messenger from the start.

Fixes #653

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-12 22:36:16 +02:00
饺子w (Yumechi)
e54c8ac750 Merge pull request #993 from gotify/security-md-patch
doc(security): amend outdated security policy info
2026-07-10 01:17:24 +00:00
饺子w (Yumechi)
2a485c9c9f doc(security): amend outdated security policy info 2026-07-09 17:42:35 +08:00
Jannis Mattheis
bb62086fda fix: more oidc logging
In debug mode this outputs the oidc discovery

    2026-07-07T20:51:14+02:00 DBG discover config={"authorization_endpoint":"http://192.168.178.2:5556/dex/auth","claims_supported":["iss","sub","aud","iat","exp","email","email_verified","locale","name","preferred_username","at_hash"],"code_challenge_methods_supported":["S256","plain"],"device_authorization_endpoint":"http://192.168.178.2:5556/dex/device/code","grant_types_supported":["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:device_code","urn:ietf:params:oauth:grant-type:token-exchange"],"id_token_signing_alg_values_supported":["RS256"],"introspection_endpoint":"http://192.168.178.2:5556/dex/token/introspect","issuer":"http://192.168.178.2:5556/dex","jwks_uri":"http://192.168.178.2:5556/dex/keys","request_uri_parameter_supported":false,"response_types_supported":["code"],"scopes_supported":["openid","email","groups","profile","offline_access"],"subject_types_supported":["public"],"token_endpoint":"http://192.168.178.2:5556/dex/token","token_endpoint_auth_methods_supported":["client_secret_basic","client_secret_post"],"userinfo_endpoint":"http://192.168.178.2:5556/dex/userinfo"} rp.function=NewRelyingPartyOIDC
2026-07-07 20:52:49 +02:00
Jannis Mattheis
ed8af76a09 Merge pull request #990 from gotify/appid-spec
fix: appid spec
2026-07-06 10:15:57 +00:00
Jannis Mattheis
509707737a fix: appid spec
It's optional on POST, so not readonly and not required.
2026-07-05 20:36:18 +02:00
饺子w (Yumechi)
0fd65a075f Merge pull request #988 from gotify/sec-update-rekey
fixup! feat(security): application token refresh
2026-07-04 12:53:41 +00:00