feat(backup): dump Vaultwarden before each backup #7

Merged
jonnxor merged 1 commit from jonnxor/feat/backup-vaultwarden into main 2026-10-31 17:06:25 +00:00 AGit
Owner

Backs up Vaultwarden, following the Forgejo and Kuma dumps. Must be merged before real passwords go in.

  • dump_vaultwarden uses vaultwarden backup for a consistent database copy and archives it with rsa_key.pem, attachments and sends to ~/Backups/vaultwarden/vaultwarden-dump.tar, owner-readable only. A failed dump keeps the last good one and doesn't stop the backup.
  • include.txt covers the new path, and verify checks the dump is readable and contains db.sqlite3.
  • docs/recovery.md has the restore steps.

A bug the rehearsal caught: busybox tar keeps only the last -C, so the first version archived the live db.sqlite3 and missed everything in its WAL; the restore came back with 0 accounts. Everything is now archived from one directory. Kuma's dump uses GNU tar and isn't affected: its archived database matched the .backup copy.

Tested on hades: the dump against the live container (temp files cleaned up), the failure and not-running cases on the first version, and a restore into a throwaway instance (1 account and 2 devices, same as live; integrity check ok; /alive 200).

Not tested: a full mise run backup or backup:verify through restic. The vault holds no items yet, so attachments and sends weren't exercised.

Timing: the monthly verify runs on 2026-11-01 around 09:46, after the nightly backup around 03:05. Merge and pull before the backup, or after verify; in between, verify raises a false alarm.

🤖 Generated with Claude Code

Backs up Vaultwarden, following the Forgejo and Kuma dumps. Must be merged before real passwords go in. - `dump_vaultwarden` uses `vaultwarden backup` for a consistent database copy and archives it with `rsa_key.pem`, attachments and sends to `~/Backups/vaultwarden/vaultwarden-dump.tar`, owner-readable only. A failed dump keeps the last good one and doesn't stop the backup. - `include.txt` covers the new path, and `verify` checks the dump is readable and contains `db.sqlite3`. - `docs/recovery.md` has the restore steps. **A bug the rehearsal caught:** busybox tar keeps only the last `-C`, so the first version archived the live `db.sqlite3` and missed everything in its WAL; the restore came back with 0 accounts. Everything is now archived from one directory. Kuma's dump uses GNU tar and isn't affected: its archived database matched the `.backup` copy. **Tested on hades:** the dump against the live container (temp files cleaned up), the failure and not-running cases on the first version, and a restore into a throwaway instance (1 account and 2 devices, same as live; integrity check ok; `/alive` 200). **Not tested:** a full `mise run backup` or `backup:verify` through restic. The vault holds no items yet, so attachments and sends weren't exercised. **Timing:** the monthly verify runs on 2026-11-01 around 09:46, after the nightly backup around 03:05. Merge and pull before the backup, or after verify; in between, verify raises a false alarm. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(backup): dump Vaultwarden before each backup
All checks were successful
CI / sanity (pull_request) Successful in 6s
d47751653a
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jonnxor force-pushed jonnxor/feat/backup-vaultwarden from d47751653a
All checks were successful
CI / sanity (pull_request) Successful in 6s
to 3eae91565e
All checks were successful
CI / sanity (pull_request) Successful in 6s
2026-10-31 17:00:51 +00:00
Compare
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
WAAAGH/_workdesk!7
No description provided.