Commit Graph

924 Commits

Author SHA1 Message Date
Yumechi
75bc19c111 fix: remove panic() and relay password hashing errors to UI 2026-08-06 12:32:23 +08: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
Yumechi
5e81bed709 fix(security): check app ownership in security endpoint 2026-07-04 14:45:15 +02:00
饺子w (Yumechi)
89e1968374 Merge pull request #933 from gotify/renovate/vitejs-plugin-react-6.x
chore(deps): update dependency @vitejs/plugin-react to v6
2026-07-01 12:45:57 +00:00
renovate[bot]
3fb6708077 chore(deps): update dependency @vitejs/plugin-react to v6 2026-07-01 20:39:05 +08:00
饺子w (Yumechi)
85e6e653c9 Merge pull request #970 from gotify/renovate/npm-vitest-vulnerability
chore(deps): update dependency vitest to v4.1.0 [security]
2026-07-01 11:49:41 +00:00
renovate[bot]
704bd4f60b chore(deps): update dependency vitest to v4.1.0 [security] 2026-07-01 19:41:36 +08:00
饺子w (Yumechi)
d7403d4c0a Merge pull request #915 from gotify/renovate/bump-dependencies-npm
chore(deps): update bump npm dependencies
2026-07-01 11:28:22 +00:00
Yumechi
a053be7b8d chore(ci): exclude node_modules from golangci 2026-07-01 19:19:48 +08:00
renovate[bot]
9c4fc2ca3c chore(deps): update bump npm dependencies 2026-07-01 11:16:19 +00:00
饺子w (Yumechi)
102edbc1f6 Merge pull request #987 from gotify/renovate/major-react-router-monorepo
chore(deps): update dependency react-router to v8
2026-07-01 10:53:59 +00:00
Yumechi
a749402723 manual migration 2026-07-01 18:46:59 +08:00
renovate[bot]
22d5cb80ba chore(deps): update dependency react-router to v8 2026-07-01 10:18:10 +00:00
饺子w (Yumechi)
eb01ceacab Merge pull request #972 from gotify/renovate/npm-react-router-vulnerability
chore(deps): update dependency react-router to v7.15.1 [security]
2026-07-01 10:09:54 +00:00
Yumechi
36e3d15c9d bump package version 2026-07-01 18:03:17 +08:00
renovate[bot]
d35542a868 chore(deps): update dependency react-router to v7.15.1 [security] 2026-07-01 09:47:25 +00:00
饺子w (Yumechi)
0dc6af15ab Merge pull request #932 from gotify/renovate/bump-dependencies-go
chore(deps): update bump go dependencies
2026-07-01 09:31:43 +00:00
renovate[bot]
43f8c04648 chore(deps): update bump go dependencies 2026-07-01 09:03:55 +00:00
饺子w (Yumechi)
6fcdf956d9 Merge pull request #986 from gotify/sec-update-rekey
feat(security): application token refresh
2026-07-01 08:37:33 +00:00
Yumechi
2dfdee284a apply suggestions 2026-07-01 16:25:45 +08:00
Yumechi
13ebe86724 fixup: fix elevation test 2026-06-30 20:12:35 +08:00
Yumechi
52e2b6d764 fixup: go testify style 2026-06-30 19:52:27 +08:00
Yumechi
e7c55fdd92 fixup: lift token dialog 2026-06-30 19:49:24 +08:00
Yumechi
41cde67072 feat(security): application token refresh 2026-06-30 18:57:12 +08:00
饺子w (Yumechi)
e33d576ce9 Merge pull request #978 from gotify/renovate/npm-vite-vulnerability
chore(deps): update dependency vite to v8.0.16 [security]
2026-06-30 09:39:53 +00:00
renovate[bot]
57005f5d3c chore(deps): update dependency vite to v8.0.16 [security] 2026-06-30 09:04:13 +00:00
饺子w (Yumechi)
06b749894c Merge pull request #948 from gotify/renovate/npm-axios-vulnerability
chore(deps): update dependency axios to v1.16.0 [security]
2026-06-30 07:34:54 +00:00