Heimdall Gitea / Detect CI scope (push) Successful in 5s
Heimdall Gitea / Build and tests (push) Successful in 17m6s
Heimdall Gitea / Build and scan server image (push) Skipped
Heimdall Gitea / Build and scan agent image (push) Skipped
Heimdall Gitea / Build and scan NVIDIA Agent image (push) Skipped
Heimdall Gitea / Publish versioned installer release (push) Skipped
Heimdall Gitea / CI policy (push) Successful in 2s
Co-authored-by: Arnaud Dartois <admin@tordais.cc>
5.5 KiB
5.5 KiB
name, description
| name | description |
|---|---|
| backup-restore | Validate Heimdall PostgreSQL and protected-volume backups using isolated Compose projects and the production backup/restore scripts. |
Heimdall backup and restore
For an explicitly authorized real backup/restore operation, follow Infisical secrets and retrieve only the selected environment's required key. Use generated credentials and disposable volumes for acceptance.
Use this workflow when changing docker/scripts/backup*.sh, docker/scripts/restore*.sh, the backup Compose, or the disaster-recovery runbook.
Project-specific behavior
- PostgreSQL backups use
docker/scripts/backup.shand restores userestore.sh. Supply credentials through a generatedPOSTGRES_PASSWORD_FILEor a generated environment file; never reusedocker/.env, production secrets, or live volumes. backup-protected-data.sharchives the Central data volume, including local objects anddp-keys. Restore withrestore-protected-data.shonly while Central is stopped. The script overlays files and deliberately keeps unrelated target files.- Preserve the entire Data Protection ring and
dp-cert.pfxtogether. Expired keys can still be required to unprotect stored payloads; never replace/delete one file as part of a restore. Heimdall has no validated manual rotation process for the certificate that protects the ring at rest; keep certificate rotation separate until tested against existing payloads. Seedocker/backup/README.md. - PostgreSQL and protected-volume archives are separate snapshots. The application does not coordinate them into one atomic point in time.
- The scheduled backup Compose installs Alpine
aws-cli,bash, and GNUcoreutils; it does not install MinIO Client (mc).backup-rustfs.shusesaws s3 syncin this shipped container and only selectsmc mirrorwhenmcis already present in a customized environment. Keepdocker/backup/README.mdaligned with this effective default and never document a retiredmcdownload as an installer step. - The scheduled Compose sets
TZtoEurope/Parisby default. Cron times indocker-compose.backup.ymluse the container timezone, while scripts use UTC for archive timestamps and retention cutoffs. Document both clocks separately and describe any changedTZas an operator configuration, not as UTC scheduling. test-backup-restore.shuses a named isolated network,tmpfsfor its disposable PostgreSQL data directory, and a temporary host directory. Its cleanup must leave no container, network, or anonymous volume.
Acceptance
- Read
docker/backup/README.mdanddocker/scripts/test-backup-restore.shbefore changing the flow. - Run the script and require all assertions to pass, including row/FK integrity, object/key digests, and Data Protection key permissions.
- For changes to volume-level restore or Compose behavior, build a disposable Compose project from the checkout with unique project name, generated credentials, and generated named volumes. Dump from one PostgreSQL volume and restore into a different volume; check a known row. Archive and remove synthetic files from the protected volume, restore them, and compare digests and key permissions.
- Measure only the synthetic restore duration and label it as a local fixture measurement. Do not present it as a production RTO. Derive the configured backup interval separately; do not imply it is a measured production RPO. For actual RPO/RTO drills, use the timestamp, resource, host, and repeated-run procedure in
docker/backup/README.mdand record the operator-approved target separately. - Install an EXIT cleanup trap before build/start. Tear down only the disposable project with
docker compose -p <name> down --volumes --remove-orphans; query its Compose project labels and confirm zero containers, volumes, and networks. Remove generated files even on a failed assertion. These fixtures use upstream PostgreSQL/RustFS images and build no local image unless a recipe change explicitly adds one; retain those upstream images. If adding a local build, record its unique tag and remove/verify that exact tag in the same trap after teardown. Never use--rmi allor broad prune commands. - The scheduled backup image installs Alpine's
aws-cli,bash, and GNUcoreutils(date -dretention cutoffs do not work in BusyBox), not MinIO Client.backup-rustfs.shtherefore usesaws s3 sync; itsmc mirrorbranch is only a fallback when a customized image already providesmc. Do not rely on the retired MinIO client download URL. The AWS CLI path passes configured S3 credentials explicitly for each invocation. - Validate S3 behavior with a disposable RustFS service, unique Compose project/network/volumes and generated keys. Create a synthetic row, run
backup.sh, verify both dated andlatest.sql.gzobjects, mutate the row, then runrestore.sh --latest --yesand verify the prior value. Add ancient synthetic daily and weekly keys and confirm both retention jobs delete them. Also exercisebackup-protected-data.shupload andbackup-rustfs.shmirror/manifest where changed. - Keep real-volume production recovery and production RPO/RTO open until validated on their actual service and data.
These backup recipes use shared upstream PostgreSQL/RustFS images and do not build a Heimdall image by default; retain those base images. Record local image tags: none for such a run. If a changed recipe adds any local build, tag it uniquely for the Compose project and remove/verify that exact tag after teardown in the same EXIT trap, even on failure. Do not use image-prune commands.