restoreproof.yml
The runner reads one file, restoreproof.yml, which lists the drills to run. Each drill restores one backup source into a throwaway database and applies its checks.
Full example
version: 1
drills:
- name: prod-postgres # unique per org, [a-z0-9-]{1,64}
engine: postgres # postgres | mysql
engine_version: "16" # docker image tag for the throwaway DB
source: # exactly one of:
s3: # S3-compatible; picks the newest object under prefix
bucket: my-backups
prefix: pg/prod/
region: eu-central-1
endpoint: "" # optional (R2, B2, MinIO)
# credentials from standard AWS env vars
file: ./backup.dump # local path
command: "pg_dump ..." # shell command writing dump to stdout
format: custom # postgres: custom | plain ; mysql: plain (gzip auto-detected by .gz)
checks:
min_tables: 10
tables: # per-table assertions
- name: public.users
min_rows: 1000
- name: public.orders
min_rows: 1
queries: # SQL that must return a single truthy value
- name: recent orders exist
sql: "select count(*) > 0 from orders where created_at > now() - interval '2 days'"
max_restore_seconds: 900 # RTO target; exceeded => check fails
max_backup_age_hours: 26 # RPO target; based on object LastModified / file mtime
Top-level keys
| Key | Required | Description |
|---|---|---|
version | Yes | Config format version. Must be 1. |
drills | Yes | List of drills. restoreproof drill runs all of them, or only the one named with --drill. |
Drill keys
| Key | Required | Description |
|---|---|---|
name | Yes | Unique per organization. Lowercase letters, digits and hyphens, 1 to 64 characters. |
engine | Yes | postgres or mysql. |
engine_version | Yes | Version tag for the throwaway database image, for example "16". Quote it in YAML. |
source | Yes | Exactly one of s3, file or command. See below. |
format | Yes | Postgres: custom or plain. MySQL: plain. Gzip is detected from a .gz extension. |
checks | Yes | Checks to run after the restore. See below. |
Backup sources
Set exactly one. A source that sets more than one, or none, fails validation with exit code 2.
s3
Reads from an S3-compatible bucket. The runner selects the newest object under prefix.
| Key | Required | Description |
|---|---|---|
bucket | Yes | Bucket name. |
prefix | Yes | Key prefix. The newest object under it is restored. |
region | Yes | Region, for example eu-central-1. |
endpoint | No | Custom endpoint for R2, B2, MinIO and other S3-compatible services. Empty for AWS. |
Credentials come from the standard AWS environment variables, such as AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, or from an OIDC role assumed earlier in the job. The GitHub Actions guide shows the OIDC setup.
file
A local path to a dump file, relative to the working directory. Useful when an earlier step in your job has already downloaded the backup.
source:
file: ./backup.dump
command
A shell command that writes the dump to stdout. Use this when the dump is produced on demand, for example from a live replica. The command runs in your job, so its credentials and network access are yours to manage.
source:
command: "pg_dump --format=custom --dbname=$REPLICA_URL"
Formats
- Postgres:
customforpg_dump --format=customoutput, restored withpg_restore;plainfor SQL text. - MySQL:
plainfor SQL dump output. - Compression: a file ending in
.gzis decompressed automatically.
Checks
| Key | Description |
|---|---|
min_tables | Minimum number of user tables in the restored database. |
tables[].name | Table to check, schema-qualified, for example public.users. |
tables[].min_rows | Minimum row count for that table. |
queries[].name | Label shown in the report. |
queries[].sql | SQL that must return a single truthy value, for example true or a non-zero count. |
max_restore_seconds | RTO target. The check fails if the restore takes longer. |
max_backup_age_hours | RPO target. Age is taken from the object’s last-modified time, or the file’s modification time. The check fails if the backup is older. |
The restore itself is always a check. A drill that fails to restore fails regardless of the other checks.
Environment variables
| Variable | Description |
|---|---|
RESTOREPROOF_API_KEY | Your API key. Needed to report results. Without it, the CLI runs locally and prints the report only. |
RESTOREPROOF_API_URL | Service URL. Defaults to https://restoreproof.org. Override it to point at a different deployment. |
RESTOREPROOF_TARGET_DSN | Connection string for an existing database to restore into, used by the Kubernetes sidecar mode. When it is set, the runner does not start Docker. |
CLI commands
restoreproof drill [--config restoreproof.yml] [--drill NAME] [--no-report] [--output report.json]
restoreproof validate [--config ...]
restoreproof version
drillruns all drills, or the one named with--drill.--no-reportskips sending results.--outputwrites the JSON report to a file.validatechecks the config file without running anything.versionprints the CLI version.
Exit codes
| Code | Meaning |
|---|---|
0 | All drills passed. |
1 | At least one drill failed. |
2 | Configuration or usage error. |
Throwaway database
By default the runner starts a database container with docker run --rm -d, using postgres:<version> or mysql:<version>. It binds a random localhost port and uses a random password. The container is removed after the drill, including when the drill fails. In Kubernetes, set RESTOREPROOF_TARGET_DSN to use a database sidecar instead.