Commit Graph

5 Commits

Author SHA1 Message Date
Davide Scaini 3dafe3840b deploy: add systemd unit + show-secret CLI command
bincio-auth.service: runs at port 4040, reads BINCIO_AUTH_JWT_SECRET
from /etc/bincio/secrets.env (shared with bincio-activity).

show-secret: prints the JWT secret stored by 'bincio-auth init',
so the operator can add it to secrets.env without raw sqlite3.
2026-06-02 15:09:00 +02:00
Davide Scaini ddd15cae0f auth: add FastAPI service — models, deps, server, routers, CLI
Steps 3–7 of the migration plan:
- models.py: Pydantic request/response types
- deps.py: shared state, JWT-based auth helpers, rate limiting
- server.py: FastAPI app with CORS + gzip
- routers/auth.py: login, logout, /api/me, reset-password, register
- routers/invites.py: GET/POST /api/invites
- routers/admin.py: user listing, suspend/unsuspend, delete, access flags, reset-password-code
- cli.py: `bincio-auth init` (creates DB + admin + JWT secret) and `bincio-auth serve`

Cookie carries a signed JWT (HS256); consumers validate locally with shared secret.
2026-06-02 14:38:56 +02:00
Davide Scaini a3a98c033d auth: add tokens.py — HS256 JWT sign/verify helpers 2026-06-02 14:29:20 +02:00
Davide Scaini 9d528043a0 auth: add db.py — SQLite data layer (users, sessions, invites, settings, prefs) 2026-06-02 14:28:59 +02:00
Davide Scaini 499e4f9dc3 init: project scaffold — pyproject.toml, package skeleton, .gitignore 2026-06-02 14:23:52 +02:00