Commit Graph
390 Commits
Author SHA1 Message Date
Linus Rath 38bc06f2d3 fix: answer 503 for plugin lists and marketplace installs while the shared store is down #1066
directory-keys-shared.test.ts: the store-down case now expects the store error instead of an 'invalid' signature, since a store outage no longer counts as a bad signature.
2026-11-01 01:03:13 +01:00
Linus Rath d78ce02f78 fix: refuse a plugin install that can't hold the registry lock and a bundle that doesn't match its entry #1066 2026-11-01 01:01:19 +01:00
Linus Rath 256855b294 fix: refuse to sign plugins on an instance whose signing key differs from the others #1066 2026-11-01 00:54:57 +01:00
Linus Rath 355e57ca6c Merge branch 'feat/multi-instance' into feat/multi-instance-ext 2026-11-01 00:28:15 +01:00
Linus Rath 3c34eda260 fix: cap the cache of Stalwart admin checks so it can't grow without bound 2026-11-01 00:25:35 +01:00
Linus Rath 5efccb65e0 fix: show a re-uploaded logo or icon at once instead of after a restart 2026-11-01 00:24:07 +01:00
Linus Rath fc7d5617c2 feat: serve uploaded branding from the shared store on every instance #1066 2026-11-01 00:20:24 +01:00
Linus Rath 51e7999e3c feat: sign plugin bundles with one key on every instance #1066 2026-11-01 00:16:42 +01:00
Linus Rath d73494593a refactor: let the config write error answer the 503 in the plugin and theme routes 2026-11-01 00:15:14 +01:00
Linus Rath 2078b0a13f Merge branch 'feat/multi-instance-auth' into feat/multi-instance 2026-11-01 00:13:17 +01:00
Linus Rath 5e4b6465d1 Merge branch 'feat/multi-instance' into feat/multi-instance-ext 2026-11-01 00:13:14 +01:00
Linus Rath e3936287fd feat: share plugin approvals and plugin settings between instances #1066 2026-11-01 00:13:09 +01:00
Linus Rath 89f337c0ae Merge branch 'feat/multi-instance-admin' into feat/multi-instance 2026-11-01 00:12:24 +01:00
Linus Rath 47281e5156 fix: answer 503 when an impersonation link's use can't be recorded and keep used links as expiring keys #1066
The marker-write test from d28ee361c now expects the 503 path (a rejected promise) instead of false: refusing with "Token already used" sent admins looking for a replay that never happened, and the jti is now remembered in memory only after it was recorded, so a retry works once the store or state dir is back.
2026-11-01 00:07:41 +01:00
Linus Rath ff08fe50fe fix: say when an admin sign-out or password change couldn't be stored instead of answering ok or wrong password #1066 2026-11-01 00:05:15 +01:00
Linus Rath df1f5cd6a4 fix: give a pair step-up attempt back only to the windows it was counted in #1066 2026-11-01 00:05:09 +01:00
Linus Rath bcb333d40c feat: share installed plugins and themes between instances #1066 2026-11-01 00:04:15 +01:00
Linus Rath 10abf7273c test: check that pairing, the policy Bearer check and the SSO hand-off answer 503 while the shared store is down #1066 2026-11-01 00:03:20 +01:00
Linus Rath 47ec029717 fix: give a hand-off redeem back when the store fails, and hand out a sign-in whose tombstone couldn't be written #1066 2026-11-01 00:03:19 +01:00
Linus Rath 740a892590 fix: answer 503 for admin and setup saves while the shared store is down #1066
Config, policy, branding, OAuth setup, password and setup wizard writes
used to answer 500 when the shared store couldn't be reached, and the
wizard's token check failed outside any handler. They answer 503 with
Retry-After now, through the helper that already turned a read-only
refusal into 409. The step-session-secret test's wizard mock gains
wizardSessionRefusal, which the setup routes now call.
2026-11-01 00:02:57 +01:00
Linus Rath 48ac0d9196 fix: keep the stored heartbeat schedule when the setup wizard sets telemetry consent #1066 2026-11-01 00:01:14 +01:00
Linus Rath 46f47b6b8f fix: answer 409 instead of 500 for every admin save a read-only config refuses #1249 2026-10-31 23:59:00 +01:00
Linus Rath 37696f9cf7 fix: answer 503 on the update status routes while the shared store is down #1066 2026-10-31 23:58:21 +01:00
Linus Rath 2acf79db43 fix: keep other instances' domain branding and server secrets when saving one entry #1066 2026-10-31 23:57:28 +01:00
Linus Rath 68d64f5018 fix: pair the policy with its own version and keep config reloads and saves from undoing each other #1066
Fixes from the review of the admin part:
- GET /api/admin/policy reads the policy and its version together; an
  identity check waiting on the store let another replica's change pair
  the old policy with the new ETag, and a save with it then won.
- A policy save answers with the stored policy and its ETag, and the
  policy, organisation, plugins and themes pages continue from that
  instead of reading it back from an instance that may not have it yet.
- A stored policy that doesn't parse keeps its version, so a save can
  replace it instead of answering 409 forever.
- A reload of another replica's change throws when this replica's writes
  kept landing while it read, so the change poller tries again; a write
  whose reload raced it reads the document again instead of applying its
  older result.
- Dropping a deleted plugin from the policy rereads policy.json first in
  local mode, as every other write does.
- New updateAdminConfig(key, change) builds a value on the stored one.

The policy route's test mocks gain getPolicyWithVersion.
2026-10-31 23:55:17 +01:00
Linus Rath 7748c75a6a Merge branch 'feat/multi-instance' into feat/multi-instance-auth 2026-10-31 23:47:48 +01:00
Linus Rath d6e98e207a Merge branch 'feat/multi-instance' into feat/multi-instance-admin 2026-10-31 23:45:00 +01:00
Linus Rath 8b9df1b633 Merge branch 'feat/multi-instance' into feat/multi-instance-data 2026-10-31 23:43:48 +01:00
Linus Rath 2cdd43d94c Merge branch 'feat/multi-instance' into feat/multi-instance-ext 2026-10-31 23:32:31 +01:00
Linus Rath ca5f2cf09c feat: let the mobile app redeem a sign-in hand-off through any instance #1066 2026-10-31 23:19:36 +01:00
Linus Rath 291b6364c9 feat: count admin login attempts across every instance and refuse sign-in while the shared store is down #1066
The three admin login limiters (5 per address and 50 overall in one
reservation, 5 per known device) keep their numbers and still don't count
refused attempts, but live in the store: memory in this process as before,
or the shared store with several replicas. checkRateLimit and
checkDeviceRateLimit are async now; the login route awaits them and
answers 503 "Sign-in is temporarily unavailable" when the store can't be
reached. The two limiter tests gain await and reset the store's counters,
which vi.resetModules no longer clears.

The admin code tells a store outage by the error's name, since the store
may come from another bundle's copy of the module.
2026-10-31 23:18:40 +01:00
Linus Rath ee5a107649 fix: answer 409 for a stale policy save also when another bundle made the config manager #1066 2026-10-31 23:17:36 +01:00
Linus Rath 26cc7c68c3 feat: let a phone pair through any instance and keep pairing secrets sealed in the shared store #1066 2026-10-31 23:16:11 +01:00
Linus Rath eb0005f3ef feat: share telemetry and update-check state across instances, with one instance id and login count #1066 2026-10-31 23:10:30 +01:00
Linus Rath ff0d2dc6e1 feat: stop sending a refused stored password from any instance once one has seen it refused #1066 2026-10-31 23:07:12 +01:00
Linus Rath 388daf767b feat: count sign-in, pre-check, pair step-up and hand-off limits across every instance #1066 2026-10-31 23:04:05 +01:00
Linus Rath 7148dd2ded feat: keep account archives in the shared store #1066 2026-10-31 23:04:02 +01:00
Linus Rath 7a482a4d0e feat: share admin config and policy between instances and spread changes within seconds #1066 2026-10-31 23:03:57 +01:00
Linus Rath 9651098634 fix: keep both templates when two settings saves arrive at once #1066 2026-10-31 22:58:14 +01:00
Linus Rath 25408b2ac2 fix: refuse a policy save from a page opened before someone else saved #1066
The admin pages save the whole policy from the draft they loaded. A
save from a page opened before another tab's or another admin's save,
or before a deleted plugin was dropped from the policy, used to put the
older policy back. GET /api/admin/policy now sends the policy version as
an ETag; the policy, organisation, plugins and themes pages send it back
as If-Match, and a save based on an older version answers 409 and keeps
the draft on the page. A PUT without If-Match replaces the policy as
before. Deleting a plugin or theme changes only its id in the stored
policy, and a policy import compares against what it replaces.

Test mocks of the config manager gain getPolicyVersion and updatePolicy,
which the route and the extension cleanup now call.
2026-10-31 22:57:57 +01:00
Linus Rath 585e10041e fix: refuse to save over stored settings or plugin credentials that no longer decrypt #1066 2026-10-31 22:54:35 +01:00
Linus Rath fd4a319eae feat: show the storage and how many instances checked in on the admin overview #1066 2026-10-31 22:46:08 +01:00
Linus Rath 1b2d81be27 feat: hold each instance back until it has loaded from the shared store and add a readiness check #1066 2026-10-31 22:40:51 +01:00
Linus Rath d23a2869d1 Merge remote-tracking branch 'origin/main' into fix/found-fix-server
# Conflicts:
#	Dockerfile
#	docker-compose.yml
2026-10-31 18:17:39 +01:00
Linus Rath f884ffe441 Merge branch 'fix/found-fix-ui' into fix/found-fix-server 2026-10-31 18:17:13 +01:00
Linus Rath ddc24e4fc7 fix: let a browser an admin signed in from before past the shared admin login limit 2026-10-31 17:55:29 +01:00
Linus Rath 825d6e76f8 fix: let admins switch off usage stats by clearing the collector address 2026-10-31 17:51:09 +01:00
Linus Rath f11ddf82dd fix: tell banner plugins when an admin opened the mailbox through impersonation 2026-10-31 17:48:29 +01:00
Linus Rath 1e462fc67e Merge pull request #1436 from shukiv/fix/impersonation-expired-app-passwords
fix: let a mailbox be opened through the handoff more than five times
2026-10-31 16:24:52 +01:00
Linus Rath 5931cd1678 feat: send an oauth resource indicator when one is configured #1461 2026-10-31 16:14:35 +01:00