Skip to content

hiteshnarayan/Backup-Control-Panel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backup Control Panel

Flask ops panel for PostgreSQL logical backups: scheduled pg_dump, optional S3 mirror, and weekly restore replay into an isolated container to prove dumps are restorable.

Replaces a manual SSH workflow with cron-driven automation, structured logs, and a browser UI. Built for a production document-collaboration stack (Postgres 15, Docker, Caddy, systemd).

Production (Apr–Jun 2026): 91 successful backups, 0 failures, ~68 days unattended. Restore verification 20/22 pass (both failures were container startup timeouts, not bad dumps).


What you get

  • Daily backups with 7-day retention and per-run metadata (size, duration, disk free)
  • On-demand backup and download from the panel
  • Restore verification: replay latest dump in postgres:15, validate table/row counts
  • S3 upload after local success (best-effort; never blocks the backup)
  • SES alerts on failure (optional, feature-flagged)
  • Session auth for operators; API key for cron and automation

Stack

Python 3.10 · Flask 3 · PostgreSQL 15 · Docker · Caddy · systemd · cron · boto3 (S3/SES) · Ubuntu 22.04

Quick start

git clone https://github.com/hiteshnarayan/Backup-Control-Panel.git
cd Backup-Control-Panel
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
python scripts/set_password.py    # paste output into .env
python main.py

Open http://127.0.0.1:5050/backup. Docker is required only for backup/restore scripts, not for the panel itself.

Documentation

Doc Contents
docs/ARCHITECTURE.md Components, data flow, auth, API, design rationale
docs/DEPLOYMENT.md systemd, Caddy, cron, UFW, S3/SES setup

Layout

app/routes/     auth, backup_api, dashboard
app/utils/      log_parser (pure functions, no Flask)
scripts/        backup, restore_verify, s3_upload, send_alert
docs/           architecture and deployment notes

License

MIT — see LICENSE.

About

Production PostgreSQL backup control panel with restore verification, S3 mirroring, and Flask ops UI

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors