From 8e9d36e385478be6c34b8d8cea140c54b045935d Mon Sep 17 00:00:00 2001 From: root Date: Mon, 20 Jul 2026 17:10:04 -0400 Subject: [PATCH] docs: ops portal and backup-restore documentation (2026-07-20) --- docs/backup-restore/CHANGELOG.md | 30 +++++++++++++++++++ docs/backup-restore/README.md | 50 ++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 docs/backup-restore/CHANGELOG.md create mode 100644 docs/backup-restore/README.md diff --git a/docs/backup-restore/CHANGELOG.md b/docs/backup-restore/CHANGELOG.md new file mode 100644 index 0000000..07ba660 --- /dev/null +++ b/docs/backup-restore/CHANGELOG.md @@ -0,0 +1,30 @@ +# Backup-Restore Changelog + +## 2026-07-20 — Restore logging and manual backup + +### Added +- **Backup Now button:** Green "+ Backup Now" button on backup page +- **Domain dropdown:** Select element with all 9 hosted domains +- **Note field:** Optional "why" note saved as note.txt in snapshot +- **Restore History section:** Auto-expanded table at bottom — Domain, Snapshot, Date/Time, Status +- **Restore logging:** Every restore writes to `/opt/backup-restore/logs/restore.log` +- **Status formatting:** Green OK / red FAILED with centered status column + +### Fixed +- **Restore timing out:** Caddy flush_interval added + 300s transport timeouts +- **Route ordering:** `/api/restore` decorator was stacked on backup function → reconnected to restore function +- **API routing:** `/api/restore`, `/api/backup`, `/api/log` not proxied → added to Caddy config +- **Mobile toggle:** Inline `display:none` on site tables removed → CSS class toggle now works +- **Mobile touch:** role="button", tabindex="0", Enter key support added to card headers +- **Auto-expand first domain:** Removed — all domains now start collapsed +- **Restore History auto-expanded:** tbl-log has class="show", arrow is ▼ + +### Changed +- "Backup Log History" → "Restore History" +- Config page scripts directory now shows content when clicked + +## 2026-07-17 — Initial deployment +- Flask app deployed on app3 as systemd service +- Snapshot script scheduled (1 AM, 1 PM) +- 9 WordPress sites configured for backup +- Caddy proxy from Core via my.itpropartner.com diff --git a/docs/backup-restore/README.md b/docs/backup-restore/README.md new file mode 100644 index 0000000..d71d530 --- /dev/null +++ b/docs/backup-restore/README.md @@ -0,0 +1,50 @@ +# Backup-Restore — my.itpropartner.com/backups/ + +## Architecture +- **Server:** app3 (152.53.241.111, netcup RS 4000) +- **Backend:** Flask Python app at `/opt/backup-restore/app/app.py` (port 8090) +- **Proxy:** Caddy on Core → reverse_proxy to 152.53.241.111:8090 with 300s timeouts +- **Snapshots:** `/opt/backup-restore/snapshots///` +- **Scheduled:** `0 1,13 * * * /opt/backup-restore/snapshot.sh` — 1 AM and 1 PM daily +- **Systemd:** `backup-restore.service` +- **Retention:** 30 days (auto-cleanup) + +## Sites Backed Up (9 domains) +apextrackexperience.com, boxpilotlogistics.com, debtrecoveryexperts.com, iamgmb.com, katiewattdesign.com, katiewattsdesign.com, mainwp.itpropartner.com, vigilanttac.com, voipsimplicity.com + +## Snapshot Contents +Each snapshot directory contains: +- `files.tar.gz` — WordPress document root tarball +- `database.sql` — MySQL dump +- `size.txt` — Total backup size in bytes +- `note.txt` — Optional manual backup note + +## API Endpoints +| Method | Path | Auth | Description | +|--------|------|------|-------------| +| GET | /backups/ | No | Backup dashboard page | +| POST | /api/backup | No | Trigger manual backup | +| POST | /api/restore | No | Restore a snapshot | +| POST | /api/delete | No | Delete a snapshot | +| GET | /api/download// | No | Download snapshot archive | +| GET | /api/log | No | Restore history | + +## Caddy Routes (on Core) +``` +handle /api/backup → app3:8090 +handle /api/restore → app3:8090 (flush_interval -1, 300s timeouts) +handle /api/download/* → app3:8090 +handle /api/log → app3:8090 +handle_path /backups/* → app3:8090 (300s timeouts) +``` + +## Recovery +``` +systemctl restart backup-restore +# Manual snapshot: +/opt/backup-restore/snapshot.sh +# Manual restore via curl: +curl -X POST https://my.itpropartner.com/api/restore \ + -H "Content-Type: application/json" \ + -d '{"domain":"katiewattdesign.com","snapshot":"2026-07-20_130001"}' +```