Skip to content

Account admin from the server's terminal: TUI, token, Diataxis docs (#17) - #36

Merged
nicolasdb merged 3 commits into
mainfrom
admin-tui
Nov 3, 2026
Merged

nicolasdb merged 3 commits into
mainfrom
admin-tui

Conversation

@nicolasdb

Copy link
Copy Markdown
Owner

Follows #35, still before any 7.3.0-4 tag. Changes the permission model and adds the TUI you asked for.

Why the change. ADMIN_EMAILS was there to protect a web door. CSS never verifies a login's email, so a listed address nobody had used yet made whoever signed up with it first an admin. On the VPS, ssh + docker already say who runs the server. Amending ADR 012 accordingly, as a proposal (solid-kit PR to follow).

What it adds

  • scripts/admin.sh opens a TUI inside the css container (admin/admin.js, plain Node, nothing to install):
    • list, sort (email / most pods / pod name), filter, select, and delete;
    • deletion is confirmed by typing the number of accounts.
  • scripts/admin.sh list and delete <email|id>... --yes do the same without the TUI.
  • The route POST /.account/admin/accounts/ takes action: list|delete and is opened by a token that start/admins.js renews at every start. The token is mode 600 and lives in the container's own filesystem only. ADMIN_EMAILS is gone.
  • The gateway templates refuse /.account/admin/ from outside.
  • docs/admin/ is new: a tutorial, a how-to, a reference, and an explanation.
  • The smoke run drives the real tool through docker exec on both layouts. It checks the following:
    • the tool lists the account and deletes it;
    • the login is gone afterwards;
    • the pod name can be taken again;
    • a guessed token from outside gets 403.

The TUI itself was driven through a pty against a mock route: filter, select, delete with confirmation, and the deletion log for the connector clean-up.

Next: once this is green and merged, tag v7.3.0-4-rc.1 for the end-to-end test on MoM.

🤖 Generated with Claude Code

Replaces the unreleased ADMIN_EMAILS design. CSS never verifies a login's
email, so a listed address nobody had used made whoever took it first an
admin; and whoever runs the server already proves it with ssh + docker.

- account-admin: AccountAdminHandler, POST /.account/admin/accounts/ with
  action list|delete, opened by a token start/admins.js renews at each
  start (mode 600, container filesystem only).
- admin/admin.js (in the image): TUI to list, sort, filter, select and
  delete; plus list / delete --yes for scripts. Calls CSS on 127.0.0.1
  with X-Forwarded-Host from CSS_BASE_URL.
- scripts/admin.sh runs it via docker compose exec, then removes the
  connector's agents for what was deleted.
- Gateway templates refuse /.account/admin/ from outside.
- Smoke drives the tool inside the container on both layouts.
- docs/admin/: tutorial, how-to, reference, explanation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nicolasdb and others added 2 commits November 3, 2026 14:23
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nicolasdb
nicolasdb merged commit df90174 into main Nov 3, 2026
@nicolasdb
nicolasdb deleted the admin-tui branch November 3, 2026 13:25
nicolasdb added a commit that referenced this pull request Nov 3, 2026
entries('account') walks every document under /.internal/ through the
resource store, lock files included, and stalled until "Lock expired
after 6000ms" took the server down (CI on #36, again on #37's first
attempt). List the names in .internal/accounts/data/ through the data
accessor (directory read, no lock), confirm each with has('account').

docs/admin/explanation.md: "What building it taught us", the findings as
arguments for the feature.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant