Files
Niklas Ye a023274280 Let team owners create service accounts in the web UI
Making a credential for CI meant signing in with curl, minting a personal
API key, finding a user id and then calling the service-accounts API by
hand. Nobody should need that to let a pipeline record a release event.

Team -> Automation lists the team's accounts and lets an owner create one,
add a key (rotation), revoke a key or delete the account. A new key is shown
once, next to the team id, because the next place it goes is a CI secret.
It sits behind the owner check, as the rest of a team's configuration does.

Two routes back it: GET /api/teams/{id}/service-accounts returns the team's
accounts with each key's name, age and last use and never a key value, and
DELETE /api/teams/{id}/service-accounts/{id} removes one, scoped to the
team so another team's account answers 404. Creating an account and minting
or revoking a key reuse the existing routes. Deleting an account keeps its
history: timelines, events and notes keep their rows, shown without a name.

Instance-scoped accounts are still an administrator's API call and are not
offered in the UI, since they reach every team. Nothing in the TUI or the
operator's client uses these routes, so neither needs a change.
2026-11-04 21:44:31 +01:00

6.4 KiB

The web UI

What the web UI offers, how sign-in and sessions work, and the Team and Admin tabs. Back to the README and the documentation index.

The server serves a web UI at /: the incident queue, each incident's alerts and timeline with every action (acknowledge, assign, snooze, note, resolve, archive), who is on call, the alert feed, and an Account tab for your own password and the notification channels your pages go to. It is built for a phone first. On a phone it navigates through a hamburger menu and has a sticky action bar, it follows the system's dark mode, and it can be added to the home screen. From 900px wide it switches to a sidebar with the queue and the incident side by side. The Stats page shows incident counts, MTTA and MTTR, and alert frequency by name, hour and day over a chosen range.

On the queue, tick the checkbox on an incident to bring up a bar with Acknowledge, Snooze and Assign; its own checkbox selects everything on screen, up to 100 at a time. Incidents that cannot take the action are skipped and counted in the confirmation, which offers an Undo for a few seconds. Undoing a bulk assign restores the previous assignee but cannot unassign an incident that had none. Resolving stays a per-incident action.

The Events page (in the More sheet on a phone) lists releases, changes, maintenance windows and outages as a timeline, newest first, with the incidents attached to each. An event's page holds its summary, the figures derived from its incidents, the incidents themselves (star one as the trigger, the first domino) and one merged timeline with event notes; Attach opens a picker that leads with the incidents around the event's start. On an incident, the Events card shows what it belongs to and suggests nearby events, but nothing attaches until you press Attach. See Events.

A team owner makes credentials for automation under Team → Automation: a service account per tool (CI, a script), with its key shown once when it is created, and add, revoke and delete from the account's sheet. See Service accounts.

You sign in with a username and password. Users have no password until one is set, and a user without one can only use API keys:

# an admin sets someone's first password with their API key
curl -X PUT http://localhost:8080/api/users/2/password \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -d '{"password": "<at least 10 characters>"}'

After that, users change it themselves under Account. Changing your own password requires the current one.

How a browser stays signed in:

  • A successful login sets an HttpOnly, SameSite=Lax session cookie. It lasts 30 days and slides forward while it is used, so an on-call phone stays signed in.
  • The cookie is marked Secure when TERDUT_PUBLIC_URL starts with https://, so set it to the HTTPS address. TLS terminates at the gateway and the server itself only ever sees plain HTTP.
  • Requests authenticated by the cookie are checked for cross-origin use (Go's http.CrossOriginProtection). That is the CSRF guard. Bearer-key clients are not affected.
  • Setting a password signs that user out everywhere else.
  • Ten failed logins for one username within 15 minutes lock that username for the rest of the window.

With TERDUT_PUBLIC_URL set, tapping a push notification opens the incident in the web UI (/incidents/{id}).

A Team tab holds everything a team owns, in five sub-sections with a URL each and a strip across the top to move between them: the on-call rota (/team/rota), the membership (/team/members), the escalation ladder (/team/escalation), the alert sources with their keys (/team/sources) and the dead man's switches (/team/deadman). /team itself is an overview — who is on call today, how many members and owners, how many ladder levels, how many keys and how many switches — so a page fetches only what it shows. An owner edits it; a member sees the same pages read-only, because the server refuses their writes anyway. Somebody in more than one team picks between them above the strip, since the choice changes the subject of all five.

The rota is a month at a time, one coloured initial per day with a legend underneath, and it says how many days are left uncovered — the question a rota is read for is who holds which stretch, and a run of one colour answers it where a list of dates does not. An owner taps a day to hand it to somebody or empty it, and fills a whole shift from the range form folded in below.

The Admin tab appears only for a system administrator, and holds what belongs to the whole server rather than to one team. It has three sub-sections, each with a URL of its own and a strip across the top to move between them: every team (/admin/teams), every user (/admin/users), and the settings that used to be environment variables (/admin/settings). /admin itself is an overview — how many of each, and what each section is for. Adding somebody is minting them an invite link into a team, rather than creating a bare account: the person who accepts it picks their own password, so one never passes through an administrator, and the link carries the team, so they land somewhere with a queue in it. That happens on the team's own page, since an invite is a fact about a team; the user list points there rather than asking which team beside a form.

A name in the team list opens that team's page, at /admin/teams/{id}: when it was created, how many are in it and how much is open, a field to rename it, the members with their roles, the invites into it, and deletion. The member list is the one thing there that needed a new endpoint — GET /api/teams/{id}/members is member-only and answers 404 to an administrator who is not in the team, which is the rule and not an oversight, so the page reads GET /api/admin/teams/{id} instead. An administrator still sees none of that team's incidents, alerts or rota.

A name in the user list opens that person's page, at /admin/users/{id}: their email and when they joined, where their notifications go, whether they are an administrator, whether the account is disabled, the teams they are in with their role in each, a password field for a first or forgotten one, and deletion. It is the one place membership is edited from the person's side — the Team tab answers "who is in this team", and answering "which teams is this person in" there means visiting each team in turn.