backupdrill 2.4.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +113 -2
- package/dist/config.d.ts +10 -0
- package/dist/config.js +22 -1
- package/dist/deadline.d.ts +9 -0
- package/dist/deadline.js +29 -0
- package/dist/drill-record.d.ts +53 -0
- package/dist/drill-record.js +126 -0
- package/dist/exporter.d.ts +57 -0
- package/dist/exporter.js +305 -0
- package/dist/index.js +78 -6
- package/dist/ping.d.ts +31 -0
- package/dist/ping.js +217 -0
- package/dist/snapshots.d.ts +5 -0
- package/dist/snapshots.js +16 -8
- package/package.json +10 -2
- package/plugin/LICENSE +21 -0
- package/plugin/README.md +79 -0
- package/plugin/skills/supabase-backup/SKILL.md +137 -0
- package/plugin/skills/supabase-backup/assets/scheduled-backup.yml +119 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Example: scheduled Supabase backup with backupdrill.
|
|
2
|
+
#
|
|
3
|
+
# HOW TO USE
|
|
4
|
+
# 1. Copy this file into your OWN repo at .github/workflows/scheduled-backup.yml
|
|
5
|
+
# 2. Add the repo secrets listed below (Settings → Secrets and variables → Actions).
|
|
6
|
+
# 3. That's it — it runs daily, and you can also trigger it by hand from the
|
|
7
|
+
# Actions tab ("Run workflow").
|
|
8
|
+
#
|
|
9
|
+
# REQUIRED SECRETS (database backup)
|
|
10
|
+
# BACKUPDRILL_DATABASE_URL Supabase Session Pooler connection string
|
|
11
|
+
# (Project Settings → Database → Session pooler).
|
|
12
|
+
# The default postgres user works as-is; a
|
|
13
|
+
# read-only role usually fails under RLS —
|
|
14
|
+
# see the README's connection-string section.
|
|
15
|
+
# BACKUPDRILL_S3_BUCKET Destination bucket you own (S3 / R2 / B2).
|
|
16
|
+
# BACKUPDRILL_S3_ACCESS_KEY_ID Credentials for that destination bucket.
|
|
17
|
+
# BACKUPDRILL_S3_SECRET_ACCESS_KEY
|
|
18
|
+
#
|
|
19
|
+
# OPTIONAL SECRETS
|
|
20
|
+
# BACKUPDRILL_S3_ENDPOINT Set for R2/B2/self-hosted; omit for AWS S3.
|
|
21
|
+
# BACKUPDRILL_S3_REGION Bucket region ("auto" works for R2).
|
|
22
|
+
# BACKUPDRILL_PROJECT_NAME Readable name used in object keys/manifest.
|
|
23
|
+
# BACKUPDRILL_PING_URL A Healthchecks.io check's ping URL. The backup
|
|
24
|
+
# pings it when it starts, finishes or fails, so
|
|
25
|
+
# you hear about a failed or skipped run.
|
|
26
|
+
# BACKUPDRILL_SCHEMAS Comma-separated schemas to dump, e.g. public,audit
|
|
27
|
+
# (default: public). Use the same value as your
|
|
28
|
+
# local runs, or scheduled backups miss schemas.
|
|
29
|
+
# BACKUPDRILL_S3_PREFIX Key prefix in the bucket (default: backupdrill).
|
|
30
|
+
# Keep it the same as local runs so drills and
|
|
31
|
+
# restores find these snapshots.
|
|
32
|
+
# BACKUPDRILL_S3_FORCE_PATH_STYLE "true" for S3-compatible stores that need
|
|
33
|
+
# path-style URLs (e.g. MinIO).
|
|
34
|
+
#
|
|
35
|
+
# To also back up Supabase Storage FILES (not just the DB), set all four:
|
|
36
|
+
# BACKUPDRILL_SUPABASE_STORAGE_ENDPOINT
|
|
37
|
+
# BACKUPDRILL_SUPABASE_STORAGE_REGION
|
|
38
|
+
# BACKUPDRILL_SUPABASE_STORAGE_ACCESS_KEY_ID
|
|
39
|
+
# BACKUPDRILL_SUPABASE_STORAGE_SECRET_ACCESS_KEY
|
|
40
|
+
# (generate the keys in Dashboard → Storage → Settings → S3 Access Keys)
|
|
41
|
+
# BACKUPDRILL_SUPABASE_STORAGE_BUCKETS Optional comma-separated list of Storage
|
|
42
|
+
# buckets to copy (default: all of them).
|
|
43
|
+
#
|
|
44
|
+
# Unset optional secrets resolve to an empty string, which backupdrill treats
|
|
45
|
+
# as "not provided" — so leaving them out simply backs up the database only.
|
|
46
|
+
#
|
|
47
|
+
# COST NOTE: a backup is egress on YOUR Supabase bill. Read the README's
|
|
48
|
+
# "Egress & cost" section before switching this to a daily schedule on a large DB.
|
|
49
|
+
|
|
50
|
+
name: scheduled-backup
|
|
51
|
+
|
|
52
|
+
on:
|
|
53
|
+
schedule:
|
|
54
|
+
# Daily at 03:00 UTC. Adjust or switch to weekly (e.g. '0 3 * * 0') as your
|
|
55
|
+
# data grows — see the README on egress cost.
|
|
56
|
+
- cron: "0 3 * * *"
|
|
57
|
+
workflow_dispatch: {} # allow manual runs from the Actions tab
|
|
58
|
+
|
|
59
|
+
# Read-only checkout is all this job needs.
|
|
60
|
+
permissions:
|
|
61
|
+
contents: read
|
|
62
|
+
|
|
63
|
+
# Never let two backups overlap (avoids double egress if one run is slow).
|
|
64
|
+
concurrency:
|
|
65
|
+
group: backupdrill-scheduled
|
|
66
|
+
cancel-in-progress: false
|
|
67
|
+
|
|
68
|
+
jobs:
|
|
69
|
+
backup:
|
|
70
|
+
runs-on: ubuntu-latest
|
|
71
|
+
steps:
|
|
72
|
+
# pg_dump's major version must be >= your Supabase Postgres version.
|
|
73
|
+
# Supabase runs PG 17, so install postgresql-client-17 from the official
|
|
74
|
+
# PostgreSQL apt repo (PGDG); Ubuntu's default repo lags behind.
|
|
75
|
+
- name: Install postgresql-client-17 (PGDG)
|
|
76
|
+
run: |
|
|
77
|
+
sudo install -d /usr/share/postgresql-common/pgdg
|
|
78
|
+
curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc \
|
|
79
|
+
| sudo gpg --dearmor -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.gpg
|
|
80
|
+
echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.gpg] \
|
|
81
|
+
https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" \
|
|
82
|
+
| sudo tee /etc/apt/sources.list.d/pgdg.list
|
|
83
|
+
sudo apt-get update
|
|
84
|
+
sudo apt-get install -y postgresql-client-17
|
|
85
|
+
|
|
86
|
+
# Point the CLI straight at the v17 binary so it can't pick up an older
|
|
87
|
+
# pg_dump that may already be on the runner's PATH.
|
|
88
|
+
- name: Tell backupdrill where pg_dump 17 lives
|
|
89
|
+
run: echo "BACKUPDRILL_PG_DUMP=/usr/lib/postgresql/17/bin/pg_dump" >> "$GITHUB_ENV"
|
|
90
|
+
|
|
91
|
+
- name: Set up Node 20
|
|
92
|
+
uses: actions/setup-node@v4
|
|
93
|
+
with:
|
|
94
|
+
node-version: "20"
|
|
95
|
+
|
|
96
|
+
- name: Run backupdrill
|
|
97
|
+
# Pinned so every run uses the same CLI. Raise it on purpose when you upgrade.
|
|
98
|
+
run: npx -y backupdrill@2.5.0 backup
|
|
99
|
+
env:
|
|
100
|
+
# --- required ---
|
|
101
|
+
BACKUPDRILL_DATABASE_URL: ${{ secrets.BACKUPDRILL_DATABASE_URL }}
|
|
102
|
+
BACKUPDRILL_S3_BUCKET: ${{ secrets.BACKUPDRILL_S3_BUCKET }}
|
|
103
|
+
BACKUPDRILL_S3_ACCESS_KEY_ID: ${{ secrets.BACKUPDRILL_S3_ACCESS_KEY_ID }}
|
|
104
|
+
BACKUPDRILL_S3_SECRET_ACCESS_KEY: ${{ secrets.BACKUPDRILL_S3_SECRET_ACCESS_KEY }}
|
|
105
|
+
# --- optional: destination bucket ---
|
|
106
|
+
BACKUPDRILL_S3_ENDPOINT: ${{ secrets.BACKUPDRILL_S3_ENDPOINT }}
|
|
107
|
+
BACKUPDRILL_S3_REGION: ${{ secrets.BACKUPDRILL_S3_REGION }}
|
|
108
|
+
BACKUPDRILL_PROJECT_NAME: ${{ secrets.BACKUPDRILL_PROJECT_NAME }}
|
|
109
|
+
BACKUPDRILL_SCHEMAS: ${{ secrets.BACKUPDRILL_SCHEMAS }}
|
|
110
|
+
BACKUPDRILL_S3_PREFIX: ${{ secrets.BACKUPDRILL_S3_PREFIX }}
|
|
111
|
+
BACKUPDRILL_S3_FORCE_PATH_STYLE: ${{ secrets.BACKUPDRILL_S3_FORCE_PATH_STYLE }}
|
|
112
|
+
# --- optional: also back up Supabase Storage files (set all four) ---
|
|
113
|
+
BACKUPDRILL_SUPABASE_STORAGE_ENDPOINT: ${{ secrets.BACKUPDRILL_SUPABASE_STORAGE_ENDPOINT }}
|
|
114
|
+
BACKUPDRILL_SUPABASE_STORAGE_REGION: ${{ secrets.BACKUPDRILL_SUPABASE_STORAGE_REGION }}
|
|
115
|
+
BACKUPDRILL_SUPABASE_STORAGE_ACCESS_KEY_ID: ${{ secrets.BACKUPDRILL_SUPABASE_STORAGE_ACCESS_KEY_ID }}
|
|
116
|
+
BACKUPDRILL_SUPABASE_STORAGE_SECRET_ACCESS_KEY: ${{ secrets.BACKUPDRILL_SUPABASE_STORAGE_SECRET_ACCESS_KEY }}
|
|
117
|
+
BACKUPDRILL_SUPABASE_STORAGE_BUCKETS: ${{ secrets.BACKUPDRILL_SUPABASE_STORAGE_BUCKETS }}
|
|
118
|
+
# --- optional: Healthchecks.io monitoring ---
|
|
119
|
+
BACKUPDRILL_PING_URL: ${{ secrets.BACKUPDRILL_PING_URL }}
|