admin: internal-only superadmin console (users, payments, DB stats)
New independent `admin` service (admin.main:app) on the same image, reusing app.db/app.models read-only. Never runs migrations or the scheduler; issues SELECTs only. - Password-gated (ADMIN_CONSOLE_PASSWORD) with a 12h signed cookie; closed by default when the password is empty. - Bound to 127.0.0.1:8091 (SSH-tunnel access); off the intranet/NPM network. - Pages: overview stats, user list + search, per-user history/payment detail, DB usage (information_schema size + row estimates). - Compose: base `admin` service (+prod DB-host override, test mount); Dockerfile bakes admin/ into runtime + test stages. - Tests: tests/test_admin_console.py (auth, queries, page wiring) — 12 passing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
8946dee2e0
commit
411094d7b8
20 changed files with 1143 additions and 1 deletions
9
admin/__init__.py
Normal file
9
admin/__init__.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
"""Superadmin console — an independent, internal-only web service.
|
||||
|
||||
Runs in its own container (see the `admin` service in docker-compose.yml),
|
||||
bound to 127.0.0.1 on the VPS and reached over an SSH tunnel. It reuses the
|
||||
main app's ORM models and DB engine (`app.db`, `app.models`) but is a wholly
|
||||
separate FastAPI app: it never imports `app.main`, so it does NOT run Alembic
|
||||
migrations or the app's lifespan. Every DB access is a plain SELECT — the
|
||||
console never writes.
|
||||
"""
|
||||
Loading…
Add table
Add a link
Reference in a new issue