From a9336724119772612000a38349d42ea9bc9f49c9 Mon Sep 17 00:00:00 2001 From: Nora Date: Mon, 22 Jun 2026 15:22:07 -0600 Subject: [PATCH] docs: auth section + env vars --- README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/README.md b/README.md index 03f585c..35f6774 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,49 @@ npm run build npm test ``` +## Authentication + +Cyclone ships with username/password authentication and three predefined roles. + +**Roles:** + +| Role | Can read | Can write (upload, parse, reconcile) | Can manage users | +| -------- | -------- | ------------------------------------ | ---------------- | +| `viewer` | ✅ | ❌ | ❌ | +| `user` | ✅ | ✅ | ❌ | +| `admin` | ✅ | ✅ | ✅ | + +**Bootstrap.** On first start, set `CYCLONE_ADMIN_USERNAME` and +`CYCLONE_ADMIN_PASSWORD` (min 12 chars) in your environment. Cyclone creates the +first admin automatically. On subsequent starts these env vars are ignored, so +rotating the bootstrap password doesn't affect an already-seeded admin — use the +CLI below to reset it. When running via `docker compose`, both vars are +required: compose refuses to start with a clear error if either is missing. + +**CLI.** Manage users from the command line: + +``` +python -m cyclone users create alice --role user --password 'hunter2hunter2' +python -m cyclone users list +python -m cyclone users disable alice +python -m cyclone users reset-password alice +python -m cyclone users set-role alice --role admin +``` + +**Login.** Browse to `http://localhost:5173` (dev) or `http://localhost:8081` +(Docker), sign in on the `/login` page, and you'll be redirected to the +dashboard. Sessions are stored server-side in SQLite with a 24-hour sliding +expiry — every authenticated request refreshes the TTL, so an active user +never gets logged out. + +**Dev escape hatch.** Set `CYCLONE_AUTH_DISABLED=1` to bypass auth entirely +(the backend auto-grants admin on every request). **NEVER set this in +production** — it's a single env-var trip from wide-open to the public +internet. The Docker compose file does not honor this flag. + +See `docs/superpowers/specs/2026-06-22-cyclone-auth-design.md` for the full +design. + ## Live updates The Claims, Remittances, and Activity pages stay current without