feat(admin): rebuild admin panel as out-of-band login with backups

- Separate admin login (ADMIN_USERNAME/ADMIN_PASSWORD) with its own JWT,
  no longer a seeded user account; lockout after 5 failed attempts
- Admin panel tabs: Users, Notifications, Backups, Reset
- Ntfy settings moved from .env/compose into admin_settings (token encrypted)
- Scheduled and on-demand mariadb-dump backups to NFS volume, with
  restore (entries only or all) and retention pruning
- Reset all entries, guarded by an automatic safety backup
- Remove user impersonation and the admin link in the user nav
- Login page falls back to admin login; nginx sends Cache-Control: no-cache

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
derekcandClaude Opus 5.5 committed 2026-11-23 00:24:19 -08:00
1 parent c54d2b251f
commit 6272322f31
28 files changed
+1523 -461

No files matched your search

+9 -1
View File
@@ -2,12 +2,20 @@ FROM python:3.12-slim
WORKDIR /app
# mariadb-client provides mariadb-dump / mariadb, used by app/services/backup.py
# for the admin panel's backups and restores (works against the MySQL 8 server).
RUN apt-get update && apt-get install -y --no-install-recommends mariadb-client \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app/ ./app/
RUN useradd -r -s /bin/false appuser
# uid 1000 so the NFS backup share (writable by uid 1000) mounted at /backups works.
RUN useradd -r -u 1000 -s /bin/false appuser \
&& mkdir -p /backups \
&& chown appuser:appuser /backups
USER appuser
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]