Snapshots for disaster recovery: apcmd snapshot create|list|restore (D015); 0.9.1-rc.1 #24

Merged
oliver.maklott merged 1 commit from snapshot into main 2026-10-06 15:19:05 +00:00

Snapshots for disaster recovery (D015). Version 0.9.1-rc.1.

  • apcmd snapshot create [--output <dir>]: installation directory (incl. .env), pg_dump of the database, all Docker volumes of the project except pgdata, each part age-encrypted in the backup container; plain snapshot.json with versions, backup image digest, sizes and SHA-256 (no secrets). Instance keeps running.
  • apcmd snapshot list
  • apcmd snapshot restore <file> --identity <key> [--dir] [--replace] [--yes]: checks every checksum and test-decrypts before changing anything; works on a fresh host without an installation; --replace asks for the instance name, moves the old directory aside, deletes the old volumes.

Deviation from the spec (new command, not in SPEC §11): recorded as D015 in docs/decisions.md (pgdata as dump, images not included, no pruning/rsync of snapshots).

Checks:

  • deno task check green (108 tests; new tests/snapshot_test.ts, tests/tar_test.ts)
  • Trial on two fresh VMs with platform 0.9.0: snapshot on A, restore on empty B; row counts, asset checksum, Caddy CA and .env identical; health green
  • --replace, name taken by another instance, wrong key with --replace (running instance untouched)

🤖 Generated with Claude Code

Snapshots for disaster recovery (D015). Version 0.9.1-rc.1. - `apcmd snapshot create [--output <dir>]`: installation directory (incl. `.env`), `pg_dump` of the database, all Docker volumes of the project except `pgdata`, each part age-encrypted in the backup container; plain `snapshot.json` with versions, backup image digest, sizes and SHA-256 (no secrets). Instance keeps running. - `apcmd snapshot list` - `apcmd snapshot restore <file> --identity <key> [--dir] [--replace] [--yes]`: checks every checksum and test-decrypts before changing anything; works on a fresh host without an installation; `--replace` asks for the instance name, moves the old directory aside, deletes the old volumes. Deviation from the spec (new command, not in SPEC §11): recorded as D015 in `docs/decisions.md` (pgdata as dump, images not included, no pruning/rsync of snapshots). Checks: - [x] `deno task check` green (108 tests; new `tests/snapshot_test.ts`, `tests/tar_test.ts`) - [x] Trial on two fresh VMs with platform 0.9.0: snapshot on A, restore on empty B; row counts, asset checksum, Caddy CA and `.env` identical; health green - [x] `--replace`, name taken by another instance, wrong key with `--replace` (running instance untouched) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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
aivopod/apcmd!24
No description provided.