Admin page, and move behaviour settings into the database #5

Closed
opened 2026-09-20 05:59:05 +00:00 by niklas · 0 comments
Owner

Part of #1. Depends on the admin role and teams.

Today

All settings are env vars (internal/config/config.go), so changing one means a redeploy. There is no admin UI; the SPA is queue, incident, on-call, alerts and account (internal/web/static/js/).

Scope

Settings

  • A settings table, key/value, read through a small typed accessor rather than scattered lookups.
  • Moves into the DB, editable by an admin: notify repeat interval, stale-after, archive-after, default escalation timings, sign-up mode.
  • Stays in env: ntfy URL and token, DB DSN, listen address, public URL.
  • On first start each env value seeds its DB row, so existing installs keep their current behaviour. Decide what the env var does afterwards — ignored, or still an override.
  • The background loops (StartNotifier, StartArchiver) read the current value each tick instead of capturing it at startup.

Admin UI (a new section in the SPA, admin-only)

  • Teams: list, create, rename, delete, manage members and their roles.
  • Users: list, disable, reset password, grant or revoke admin, create invite links.
  • Settings: edit the DB-backed values, and show the env-backed ones read-only so it's clear where they come from.
  • Deleting a team asks what happens to its incidents — refuse while it has open ones, or archive them.

Notes

Team-level config (escalation policy, schedules, integrations, fallback topic, dead-man switches) belongs to the team's own settings page, edited by an owner, not to this global admin area.

Done when

An admin can change the repeat interval in the UI and the notifier picks it up without a restart, a non-admin gets no admin section and 403s from its endpoints, and a fresh install's defaults match the current env defaults.

Part of #1. Depends on the admin role and teams. ### Today All settings are env vars (`internal/config/config.go`), so changing one means a redeploy. There is no admin UI; the SPA is queue, incident, on-call, alerts and account (`internal/web/static/js/`). ### Scope **Settings** - [ ] A `settings` table, key/value, read through a small typed accessor rather than scattered lookups. - [ ] Moves into the DB, editable by an admin: notify repeat interval, stale-after, archive-after, default escalation timings, sign-up mode. - [ ] Stays in env: ntfy URL and token, DB DSN, listen address, public URL. - [ ] On first start each env value seeds its DB row, so existing installs keep their current behaviour. Decide what the env var does afterwards — ignored, or still an override. - [ ] The background loops (`StartNotifier`, `StartArchiver`) read the current value each tick instead of capturing it at startup. **Admin UI** (a new section in the SPA, admin-only) - [ ] Teams: list, create, rename, delete, manage members and their roles. - [ ] Users: list, disable, reset password, grant or revoke admin, create invite links. - [ ] Settings: edit the DB-backed values, and show the env-backed ones read-only so it's clear where they come from. - [ ] Deleting a team asks what happens to its incidents — refuse while it has open ones, or archive them. ### Notes Team-level config (escalation policy, schedules, integrations, fallback topic, dead-man switches) belongs to the team's own settings page, edited by an owner, not to this global admin area. ### Done when An admin can change the repeat interval in the UI and the notifier picks it up without a restart, a non-admin gets no admin section and 403s from its endpoints, and a fresh install's defaults match the current env defaults.
niklas added the authui labels 2026-09-20 06:13:06 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: niklas/terdut-server#5