Commit Graph
1841 Commits
Author SHA1 Message Date
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 e75834314d fix: show plugin approval requests and decisions to every part of the server at once 2026-11-01 00:13:08 +01:00
Linus Rath 2944d2797f fix: keep every key when several of a plugin's settings are saved at once 2026-11-01 00:12:26 +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 40578f039d test: give each replica in the setup token tests a state dir of its own #1066 2026-11-01 00:09:49 +01:00
Linus Rath b880e453a5 fix: import the audit log in batches and finish an import that stopped halfway #1066 2026-11-01 00:08:39 +01:00
Linus Rath 5e73fcbcc1 feat: append lines in batches to the shared log and clear it #1066 2026-11-01 00:08:39 +01:00
Linus Rath 8b40cfca90 fix: update the plugin frame origins in the CSP right after an install, also on other instances #1066 2026-11-01 00:06:52 +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 80bcfde5f3 Merge branch 'feat/multi-instance-data' into feat/multi-instance 2026-11-01 00:05:03 +01:00
Linus Rath bcb333d40c feat: share installed plugins and themes between instances #1066 2026-11-01 00:04:15 +01:00
Linus Rath 0ed5fb148c fix: never write telemetry defaults over a state file that can't be read #1066 2026-11-01 00:03:34 +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 79e678716e fix: stop running the background jobs while the shared store has lost its data #1066 2026-11-01 00:02:35 +01:00
Linus Rath a87a9a5f6a fix: flush account archives to disk before they replace the old file again #1066 2026-10-31 23:59:43 +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 6d22814e5f fix: move settings and plugin credentials that no longer decrypt aside instead of refusing every save #1066
The earlier fix answered 503 to every read and write of a settings file
or plugin vault that doesn't decrypt, so a rotated SESSION_SECRET left
the user with no way out: even disconnecting a plugin failed. Now such a
document reads as nothing stored, and the next write first moves it
aside, then saves as usual. The bytes are kept unchanged, so the data can
be restored with the old secret:

- local mode renames the file to `<file>.unreadable-<time>` next to it
- shared mode copies the document to `<id>.unreadable-<time>`, then
  deletes the original only if it is still the same document

A settings file too short to hold anything reads as nothing stored and
is written over, as before 585e10041. The 503 is now only for a shared
store that can't be reached or a file that can't be read at all.

Credentials the admin set up for a plugin no longer read the user's
vault, so they keep working when it can't be read, and the credential
list still reports their status.
2026-10-31 23:57:08 +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 2130716d83 fix: keep the day's heartbeat when its payload can't be built and never report zero accounts while the store is down #1066 2026-10-31 23:51:19 +01:00
Linus Rath 63f4af27f5 fix: send one heartbeat when the scheduler lead moves after a stall or a crash #1066 2026-10-31 23:50:07 +01:00
Linus Rath 01acacc27b fix: answer 503 instead of 500 when the shared store is full or too busy to take a write #1066 2026-10-31 23:48:40 +01:00
Linus Rath 3f9970e877 fix: refuse a marketplace install when the recorded directory keyring dates can't be read 2026-10-31 23:48:22 +01:00
Linus Rath d425a873e2 fix: keep a replica that lost the scheduler lead from rearming the heartbeat or update check #1066 2026-10-31 23:47:31 +01:00
Linus Rath c0c972a57f feat: refuse a replayed extension directory keyring on every instance #1066 2026-10-31 23:46:56 +01:00
Linus Rath 7faed7e5f4 fix: send a change notice again when the shared store dropped right after an admin save #1066 2026-10-31 23:46:01 +01:00
Linus Rath 698b881f1f refactor: use the shared store's own outage check in the admin code #1066 2026-10-31 23:45:53 +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 e63ae40c61 fix: keep one plugin signing key when several parts of the server create it at once
The registry signature test now drops the cached key before each test: the key is cached once per process on globalThis, so resetting the modules no longer clears it.
2026-10-31 23:44:43 +01:00
Linus Rath ff6116e991 refactor: recognise a store outage with the shared-store helper in user data routes 2026-10-31 23:44:26 +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 9e2b59847f refactor: recognise a shared-store outage by name, so every bundle's module copy sees it 2026-10-31 23:31:02 +01:00
Linus Rath e8be930984 feat: import settings, plugin credentials, archives and telemetry state into the shared store #1066 2026-10-31 23:26:53 +01:00
Linus Rath 4983325f32 feat: bring the admin config, password, state and audit log along when moving to a shared store #1066 2026-10-31 23:26:52 +01:00
Linus Rath a0af628a6a feat: run the telemetry heartbeat and update check on one instance of the deployment #1066 2026-10-31 23:25:12 +01:00
Linus Rath f531ef63b1 feat: print the same setup token on every instance #1066 2026-10-31 23:25:10 +01:00
Linus Rath ade95013f8 feat: keep one admin audit log for every instance #1066 2026-10-31 23:23:00 +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 a048689179 feat: check admin sign-outs and password changes against the shared store on every instance #1066 2026-10-31 23:12:23 +01:00
Linus Rath fd1d90dc3a fix: stop the old telemetry timer when an admin changes consent, so one heartbeat runs #1066 2026-10-31 23:11:48 +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 cde02f5a48 fix: refuse the old admin password everywhere right after it was changed 2026-10-31 23:07:11 +01:00
Linus Rath a1ce0d7ec8 fix: keep telemetry consent when its state file can't be read #1066 2026-10-31 23:05:14 +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 741983c53c feat: keep users' plugin credentials in the shared store without losing a concurrent save #1066 2026-10-31 23:00:42 +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