Make the admin a member with a flag, and drop the second listener

The admin was a set of env credentials on its own loopback listener. That
bought network isolation, and charged a second port to tunnel and proxy and
a second credential in the password manager. It also sat outside the
SameSite protection the member cookie already had, and left every ban and
password reset with no actor to log.

is_admin on users reuses what was already there: the session, the login
rate limiter, ban-drops-sessions, CSRF. /admin is now a route on the member
mux. A member without the flag gets 404 rather than 403 — the pages are
none of their business, and "forbidden" confirms there is something to be
forbidden from.

Registration needs an invite and invites come from /admin, so an empty
database cannot grow its first user. seedAdmin breaks that circle exactly
once, from ADMIN_EMAIL and ADMIN_PASSWORD, and does nothing against a
database that already has users.

An admin cannot ban themselves: banning drops the target's sessions, and
nothing would be left that could undo it.

This reverses decision 8, which is rewritten rather than deleted, along
with the admin entry in the CONTEXT.md vocabulary.
This commit is contained in:
Esa Kataja
2026-09-05 13:40:26 +03:00
parent 00ea7624ca
commit 2af29fe999
16 changed files with 321 additions and 186 deletions
+3 -3
View File
@@ -13,9 +13,9 @@ A person with an account. Every account is a member; there is no other kind.
_Avoid_: user, käyttäjä, account
**Admin**_ylläpitäjä_:
The operator of the installation. Not a member and not an account — a set of credentials on a
separate surface. Never submits, reviews, or appears in any list of people.
_Avoid_: admin user, superuser, role
A member who also operates the installation. The same account, the same session, one extra flag —
so an admin submits and reviews like anyone else and does appear in lists of people.
_Avoid_: superuser, role, admin account (there is no separate account)
**Invite**_kutsu_ / **invite code**_kutsukoodi_:
A one-time code that permits one registration. Spent only by a registration that succeeds.