feat: back up libraries to a folder on the server or an S3 bucket, as deduplicated snapshots #29
Loading…
Reference in a new issue
No description provided.
Delete branch "library-backups"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #26 (first version; restore is #28). Design notes in
docs/backups.md.What it does
BACKUP_DIR, only offered when it's set;priv/backupsin dev) or an S3 bucket (AWS or any S3-compatible service: endpoint, region, bucket, optional folder, keys; the secret is stored encrypted and a blank one keeps it). Snapshots to keep: 3/7/14/30/90. Daily on/off. Test connection and Back up now.blobs/<ab>/<sha256>once; each snapshot is a manifest atsnapshots/<name>.jsonlisting every item (synced and imported) and its files. Only new files are uploaded; the manifest is written last.keepare deleted, then every blob none of the rest use. If a remaining manifest can't be read, no blobs are deleted.BackupWorker(queuebackups: 1, unique per user). Daily runs after a sync when the last run was a day ago (like the tag scan), and are skipped when the library's fingerprint matches the last snapshot. Back up now always makes one..rmdocbuilt from the backup's own files.Rmdoc.zip/2was split out ofRmdoc.write/1for this.Testing
Req.Test) that pages listings 2 keys at a time. Full suite 673 passed;--warnings-as-errors(test and prod) andformat --check-formattedare clean..rmdocs built from the backup were identical to the library's. Wrong S3 keys give a clear signature error.Deploying: set
BACKUP_DIRto offer local backups (ideally another disk than/data); a migration addsbackup_settingsandbackup_snapshots.