Skip to content

feat: admin database page with purge, vacuum, and backup#380

Merged
neoneye merged 1 commit intomainfrom
admin-database-backup
Mar 21, 2026
Merged

feat: admin database page with purge, vacuum, and backup#380
neoneye merged 1 commit intomainfrom
admin-database-backup

Conversation

@neoneye
Copy link
Member

@neoneye neoneye commented Mar 21, 2026

Summary

  • Add /admin/database page with purge, vacuum, and backup actions
  • Add database_worker Docker service that runs pg_dump directly (uses zstd compression when available, falls back to gzip)
  • Frontend proxies backup stream from database_worker, keeping admin auth
  • Purge: NULL out run_track_activity_jsonl for older rows with radio buttons showing MB savings per retention level
  • Vacuum: run VACUUM FULL task_item to reclaim disk space after purging

Test plan

  • Navigate to /admin/database — page loads with size info, purge options, vacuum, and backup button
  • Click "Download Backup" — browser downloads a .sql.zst or .sql.gz file
  • Verify backup can be restored with psql < backup.sql (after decompressing)
  • Purge with a retention level and verify success banner
  • Click Vacuum and verify per-table breakdown reflects reclaimed space
  • Verify non-admin users get 403

🤖 Generated with Claude Code

…_worker

Add /admin/database page with:
- Purge: NULL out run_track_activity_jsonl for older rows with radio
  buttons showing MB savings per retention level (10-500)
- Vacuum: run VACUUM FULL task_item to reclaim disk space
- Backup: download a compressed pg_dump via the new database_worker
  service (uses zstd when available, falls back to gzip)

Add database_worker Docker service with postgresql-client that runs
pg_dump directly, avoiding gunicorn timeout issues. Frontend proxies
the stream with admin auth.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@neoneye neoneye merged commit 73ac30e into main Mar 21, 2026
3 checks passed
@neoneye neoneye deleted the admin-database-backup branch March 21, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant