Add PostgreSQL setup, backup automation, and recovery runbook#50
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements ticket H-007 by adding PostgreSQL setup, daily backup automation, and restore runbook for Havenhold on Lightsail.
This PR delivers the D0 infra foundation and documents the required H-010 pre-launch restore test sequencing (schema + seed required before restore validation can pass).
Changes
Infra scripts
infra/postgres-setup.shpg_hba.confentries for both127.0.0.1/32and::1/128(scram-sha-256)/var/backups/havenholdwithpostgres:postgres750127.0.0.1infra/postgres-backup.shpg_dumpwith non-empty file check and retention prune/usr/local/bin/postgres-backup.shand writes/etc/cron.d/havenhold-backupCRON_TZ=UTC, explicitpostgresrun userinfra/postgres-restore.shSKIP_CONFIRM=true)dropdb/createdb, restores withON_ERROR_STOPPatient < 1Runbook
docs/runbook/postgres-backup-and-recovery.mdGate / AC handling
Validation
bash -n infra/postgres-setup.shbash -n infra/postgres-backup.shbash -n infra/postgres-restore.sh