Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
bd7c7fb
fix: keep pending Auth tokens out of auth.dump (2.11.1)
supertj Nov 21, 2026
e67cfb6
fix: run the drill's test sign-up with the sandbox off the network
supertj Nov 21, 2026
b95926c
chore: release 2.11.1
supertj Nov 21, 2026
a0ac98c
fix: rewrite auth.dump rows field by field, and require every data block
supertj Nov 21, 2026
db4a292
fix: never put the drill sandbox back on the network after the test s…
supertj Nov 21, 2026
013427f
fix: require pg_dump's end marker in the auth.users data
supertj Nov 21, 2026
4cdcb7a
fix: keep --keep sandboxes reachable and stop a timed-out test sign-u…
supertj Nov 21, 2026
d9aa88f
fix: tighter offline sign-up reporting, TCP loopback, race-free stop
supertj Nov 21, 2026
05658e1
docs: clearer wording for the offline Auth sign-up and archive errors
supertj Nov 21, 2026
764340b
test: match the new offline sign-up wording
supertj Nov 21, 2026
33d2115
fix: don't write an auth.dump that the cleared tokens would make unre…
supertj Nov 21, 2026
080594a
fix: decide token-clearing conflicts from catalog text only
supertj Nov 21, 2026
9ca61f5
fix: no cleanup warning when the timed-out sandbox is already being r…
supertj Nov 21, 2026
c322c09
docs: plainer wording for Auth archive conflicts and offline sign-up …
supertj Nov 21, 2026
ff880cf
fix: write auth.dump only when auth.users matches Supabase's own defi…
supertj Nov 21, 2026
9794ea4
fix: no doubled full stop when a full-sentence Auth reason is logged
supertj Nov 21, 2026
b906e61
fix: only hold auth.dump back for objects that can see a cleared column
supertj Nov 21, 2026
e0d03e6
fix: check every index pg_dump restores, and compare definitions reli…
supertj Nov 21, 2026
68b3fea
docs: say when auth.dump is skipped and when the sign-up test runs
supertj Nov 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ backupdrill.config.json
# Supabase CLI 本地状态(含项目 ref):公开仓永不提交。
# 只忽略本地状态目录,不要写成 supabase/ —— 那会连迁移/函数一起吞掉。
/supabase/.temp/

# git worktree(同一项目的东西只放在项目目录里)
.worktrees/
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ All recognized variables:
|---|---|---|
| `BACKUPDRILL_DATABASE_URL` | Source connection string (falls back to `DATABASE_URL`) | — (required) |
| `BACKUPDRILL_PROJECT_NAME` | Readable name used in object keys and the manifest | `supabase` |
| `BACKUPDRILL_SCHEMAS` | Comma-separated schemas to dump | `public` |
| `BACKUPDRILL_SCHEMAS` | Comma-separated schemas to dump. If the list includes `auth`, `dump.pgcustom` copies the Auth tables as-is, including any pending password-reset and confirmation tokens, and BackupDrill skips the separate `auth.dump`. When BackupDrill writes a separate `auth.dump`, it clears those tokens before upload | `public` |
| `BACKUPDRILL_AUTH` | Supabase Auth users (`auth.users` + `auth.identities`) go into `auth.dump` next to the database dump whenever the role can read them. `off` leaves them out. `on` makes a backup that can't include them exit with code 3; the database backup still completes either way. Also `--auth` / `--no-auth`, or `"auth": true/false` in the config file | on when possible |
| `BACKUPDRILL_S3_ENDPOINT` | S3-compatible endpoint (R2/B2/self-hosted; omit for AWS S3) | — |
| `BACKUPDRILL_S3_REGION` | Destination bucket region | `auto` |
Expand Down Expand Up @@ -199,7 +199,7 @@ The drill's structural checks (tables, rows, checksums) can't know what "working
backupdrill drill --check-cmd "npm run smoke" # BACKUPDRILL_SANDBOX_URL points at the restored copy
```

Your command runs after all structural checks pass, with `BACKUPDRILL_SANDBOX_URL` set to the sandbox's connection string. Exit 0 means pass; the result shows up in the report as an `app checks` line, and a non-zero exit fails the drill (the report keeps structural and app-level failures clearly separate). Entirely optional — without the flag, nothing changes and the report has no `app checks` line. There's a 10-minute timeout (the whole process tree is killed), and `--keep` leaves the sandbox container running when a drill fails so you can inspect it — the report JSON then includes a `keptSandbox` object with the container id and connection string (`docker rm -f <id>` when done).
Your command runs after all structural checks pass, with `BACKUPDRILL_SANDBOX_URL` set to the sandbox's connection string. Exit 0 means pass; the result shows up in the report as an `app checks` line, and a non-zero exit fails the drill (the report keeps structural and app-level failures clearly separate). Entirely optional — without the flag, nothing changes and the report has no `app checks` line. There's a 10-minute timeout (the whole process tree is killed), and `--keep` leaves the sandbox container running when a drill fails so you can inspect it — the report JSON then includes a `keptSandbox` object with the container id and connection string (`docker rm -f <id>` when done). The Auth sign-up test only runs when the backup has at least one custom Auth trigger to recreate. BackupDrill waits for any `--check-cmd` to finish, then disconnects the sandbox from its Docker networks before running the test. If the drill fails with `--keep`, BackupDrill skips the sign-up test so you can still connect.

**What this can and cannot verify, honestly:** `BACKUPDRILL_SANDBOX_URL` connects as the sandbox **superuser**, and superusers bypass row-level security. The sandbox does carry a stub of the Supabase runtime — an `auth` schema whose `uid()`/`jwt()`/`role()`/`email()` return null, and the `anon`/`authenticated`/`service_role` roles — so functions, column defaults and policies that reference them restore instead of being skipped. The sandbox deliberately does not create Supabase-managed *tables* such as `auth.users`: an index, constraint or policy that points at one is reported as a skipped managed object (these are restored in a second, post-data pass where that exemption applies). A skipped foreign key into `auth.users` still matters for a real restore, see [Tables that reference auth.users](#tables-that-reference-authusers). A *view* over one is created in the strict first pass instead, and fails the drill — a real gap in what a public-only backup can rebuild, shown rather than hidden. A function *body* that selects from `auth.users` is different: PostgreSQL does not validate string-literal bodies (`AS $$ … $$`) during a restore (`check_function_bodies` is off in every dump), so such a function is recreated and the drill passes — it would only fail when called. The exception is an SQL-standard `BEGIN ATOMIC … END` body, which is parsed and dependency-checked at creation regardless of that setting, so one of those referencing a managed table fails the drill like a view does. That is exactly what `--check-cmd` is for: if your application depends on such a function, call it there. So use `--check-cmd` for data and business invariants ("orders reference existing users", "the row count I care about is sane"). It is **not** an RLS behavior test — `auth.uid()` is a stub and you are a superuser; verifying RLS takes an authenticated client stack with real JWTs, which no restore sandbox can fake generically.

Expand Down Expand Up @@ -364,7 +364,7 @@ docker run -d --name backupdrill --restart unless-stopped \
- Arguments go straight to the CLI: `docker run --rm -e … ghcr.io/backupdrill/backupdrill estimate` or `… --help`. To start a backup now in a running scheduled container: `docker exec backupdrill backupdrill backup`.
- `BACKUPDRILL_CRON` takes a standard 5-field expression or a shortcut such as `@daily`. Anything else stops the container at start (exit code 64) instead of leaving it idle.
- `drill` needs Docker to start its throwaway Postgres, and the image doesn't get access to your Docker daemon, so run drills where Docker is available (your machine, or the GitHub Action with `drill: "true"`).
- Tags: `latest`, the CLI version (e.g. `2.10.1`), and `sha-<commit>`. Images are built for amd64 and arm64.
- Tags: `latest`, the CLI version (e.g. `2.11.1`), and `sha-<commit>`. Images are built for amd64 and arm64.

## Alerts with Healthchecks.io

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "backupdrill",
"version": "2.11.0",
"version": "2.11.1",
"description": "Open-source CLI to back up a Supabase project to your own S3/R2/B2 bucket (the Postgres database, Auth users when your role can read them, and Storage files once you add the project's Storage S3 keys), then run a restore drill that proves the backup restores.",
"type": "module",
"bin": {
Expand Down
Loading
Loading