Relationships
#4630 serve: a reload that closes admission locks the admins out, and a boot-only continuation sweep reports a changed interval as applied
Opened by stack72 · 11/11/2026· Shipped 11/11/2026
Two defects in swamp serve reload as shipped in swamp PR #3728 (#4602).
1. A reload that closes admission locks the admins out
What happens. In OAuth mode, suppose a reload leaves auth.allowed-users with no resolvable name and no allowed-collectives are set. For example: every listed name is new and serve has no club API key, a swamp-club lookup fails at reload time, or a typo removes the only valid name. Reload then puts in force an entry that matches no one, so admission stays closed rather than opening to everyone. Admission (checkAdmission, src/domain/access/admission.ts) never consults auth.admins, so the admins are refused too:
- health and API requests return 401;
- device login answers "Not admitted";
- the dashboard is refused;
swamp serve reload --serverwith an admin token fails with "Authentication failed".
Only a local swamp serve reload (SIGHUP) on the host recovers. That defeats a serve whose config is applied from git with no shell on the host (#4439).
Reproduced. Live-checked against a stub OAuth provider with auth: {admins: [boss], allowed-users: [ghost]}, where ghost's lookup fails: boss got 401 on health and on /api/v1/serve/config, and a WebSocket reload with boss's token was refused.
Expected. When a reload would close admission, the admins stay admitted. Put the admins' resolved ids in the closed list instead of the entry that matches no one: nobody else gets in, and an admin can fix the file and reload remotely. This changes only the reload's closed state (planAllowedUsersReload, src/serve/serve_access_list_reload.ts). Startup still refuses that file, and admission rules elsewhere are unchanged.
Test.
- The planner: a closed list holds the admin subjects.
- The integration harness (
integration/serve_access_list_reload_test.ts): A to an unresolvable B leaves the admin admitted on every path (server token, delegation refresh, consent) and refuses everyone else.
2. A boot-only continuation sweep reports a changed interval as applied
What happens. On a synced datastore whose run records cannot be compared with the remote, the continuation sweep runs only its boot pass (bootPassOnly, src/cli/commands/serve.ts). The service object exists, so the reload's not-running check treats it as running. A changed continuation-sweep-interval is then reported as applied, and recorded that way in the serve.config.reloaded audit event, though no later pass ever runs.
Expected. Report it under needsRestart with a reason saying the sweep runs only at boot on this datastore.
Test. The not-running reasons see a boot-only sweep. The settings reloader test for not-running reasons covers the report.
Out of scope
Re-arming the reconciliation, continuation sweep, token GC and group refresh timers on reload; today they take a new interval after their next run. That goes with #4604, where the scheduler gets the same start, stop and re-arm work.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.