Admin settings store + Settings panel (#52) #55

Merged
Cordy merged 4 commits from feat/settings-store into main 2026-07-29 04:40:05 +00:00
Owner

First slice of the policy-out-of-config-file settings store (#52).

  • internal/settings — atomic-JSON store (same pattern as shares/app-passwords/license state) holding admin-editable policy: instanceName, shareDefaultExpiry, shareAllowUploadDefault. Validated on write. Config settingsPath (default /data/.cairn/settings.json).
  • GET/PUT /api/v1/settings — GET readable by any authenticated user (the UI needs the instance name); PUT admin-gated (honors auth.admins/adminGroups/User.Admin).
  • Settings panel in the avatar menu, shown to admins (/me.admin). First panel edits the instance name — shown in the header when set. Grows one panel at a time, exactly as the issue prescribes.

Boundary held: the store is for policy, never identity — who-is-admin stays with auth.admins/auth.adminGroups, so it can't fight the directory.

New settings_test.go (roundtrip, validation, persistence). gofmt + vet + build + full test suite + node --check on the UI script all green on the runner before push.

First slice of the policy-out-of-config-file settings store (#52). - **`internal/settings`** — atomic-JSON store (same pattern as shares/app-passwords/license state) holding admin-editable policy: `instanceName`, `shareDefaultExpiry`, `shareAllowUploadDefault`. Validated on write. Config `settingsPath` (default `/data/.cairn/settings.json`). - **`GET/PUT /api/v1/settings`** — GET readable by any authenticated user (the UI needs the instance name); PUT admin-gated (honors `auth.admins`/`adminGroups`/`User.Admin`). - **Settings panel** in the avatar menu, shown to admins (`/me.admin`). First panel edits the **instance name** — shown in the header when set. Grows one panel at a time, exactly as the issue prescribes. Boundary held: the store is for **policy, never identity** — who-is-admin stays with `auth.admins`/`auth.adminGroups`, so it can't fight the directory. New `settings_test.go` (roundtrip, validation, persistence). gofmt + vet + build + full test suite + `node --check` on the UI script all green on the runner before push.
Cordy merged commit 8855b7d28a into main 2026-07-29 04:40:05 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#55
No description provided.