Rewrite as an online restic backup #2

Merged
trex Bot merged 1 commits from rewrite/online-restic into main 2026-11-24 14:39:18 -06:00

Replaces the 2023 prototype. See the commit message for the full list of defects fixed.

Verified live on cygnus: DB dump 77.4 MB, restic snapshot of 337 GiB / 940,972 files.

Replaces the 2023 prototype. See the commit message for the full list of defects fixed. Verified live on cygnus: DB dump 77.4 MB, restic snapshot of 337 GiB / 940,972 files.
trex Bot added 1 commit 2026-11-24 14:39:14 -06:00
The 2023 prototype could not work against the current stack and, where it
did run, reported success while doing nothing: it dumped from a stale IP
(192.168.4.11) that is not even the Seafile database, joined a network the
DB is not on, used a mistyped seahub.sh path, and discarded every exit code.

Replace it with a single orchestrator that:

* never stops Seafile - the DB dump uses --single-transaction and the block
  store is content-addressed and immutable, so restic can read it live;
* reads the DB credentials from the Seafile conf/.env instead of duplicating
  them in the stack .env;
* dumps with --quick --routines --events --triggers --add-drop-table (the old
  --skip-opt produced a dump with no DROP TABLE, i.e. unrestorable over an
  existing database) and passes the password via MYSQL_PWD;
* puts the dump inside the restic snapshot, so a restore needs one source;
* drops rclone entirely - it cannot write to the RustFS buckets (403 on every
  bucket) and `sync` is the wrong semantics for a backup;
* checks every step, exits non-zero on failure, pings the Kuma push monitor
  with /start, /fail or the result, and sends a failure notification;
* takes an exclusive lock, verifies the dump trailer and the snapshot, and
  only then prunes old dump directories;
* keeps a second restic repository on a different physical disk;
* runs as a non-root image with a read-only rootfs and no capabilities.

Also: replace the dead Drone pipeline with a Gitea Actions build, drop the
unused python-dotenv/requests dependencies, and fix the README.
trex Bot merged commit 40d950be30 into main 2026-11-24 14:39:18 -06:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jblu/seafile-backup#2