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

+1 -3
View File
@@ -37,7 +37,7 @@ async def register(request: Request, body: UserCreate, db: AsyncSession = Depend
await db.refresh(user)
logger.info("New user registered: %s", body.email)
await notify("New Registration", f"User registered: {body.email}", priority="default")
await notify("New registration", f"User registered: {body.email}", tags=["bust_in_silhouette"])
return Token(access_token=create_token(user.id))
@@ -56,6 +56,4 @@ async def login(request: Request, body: LoginRequest, db: AsyncSession = Depends
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail="Account disabled")
logger.info("Login: %s (id=%s)", body.email, user.id)
if user.is_admin:
await notify("Admin Login", f"Admin login: {body.email}", priority="high")
return Token(access_token=create_token(user.id))