Repository navigation
Conversation
Provision the BACKUPDRILL_* variables the backupdrill CLI reads (source database URL, backup bucket keys and optional Supabase Storage keys) from a single 1Password item. Only the bucket keys are required, since drill, restore and exporter don't need the database URL.
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.
Overview
Adds a shell plugin for
backupdrill, the open-source CLI that backs up a Supabase project (the Postgres database and, optionally, Storage files) to an S3-compatible bucket, and can restore a backup into a throwaway Postgres to check it. Source: https://github.com/backupdrill/cli. I'm one of the BackupDrill maintainers.The CLI has no login step. It reads the source database connection string and the bucket keys from
BACKUPDRILL_*environment variables, so in practice they end up exported in a shell profile or pasted into a config file. This plugin provisions them from one 1Password item instead.BACKUPDRILL_S3_ACCESS_KEY_IDBACKUPDRILL_S3_SECRET_ACCESS_KEYBACKUPDRILL_S3_BUCKETBACKUPDRILL_S3_ENDPOINTBACKUPDRILL_S3_REGIONBACKUPDRILL_DATABASE_URLBACKUPDRILL_SUPABASE_STORAGE_ENDPOINTBACKUPDRILL_SUPABASE_STORAGE_REGIONBACKUPDRILL_SUPABASE_STORAGE_ACCESS_KEY_IDBACKUPDRILL_SUPABASE_STORAGE_SECRET_ACCESS_KEYThe variable names come from
src/config.tsin the CLI and match https://backupdrill.com/docs/cli#configure.Some notes for review:
drill,restoreandexporterwork without the database URL, so a machine that only runs drills can use an item that doesn't hold the database password.backupandestimateexit withMissing required config: databaseUrl (BACKUPDRILL_DATABASE_URL)if it's missing.backupdrill.config.json, so whatever is in the config file still applies.--configpoints), so there's no fixed path to scan. The env var importer covers the documented setup.BACKUPDRILL_TARGET_DATABASE_URLandBACKUPDRILL_TARGET_SERVICE_ROLE_KEYare left out on purpose. They belong to the fresh project you restore into, not the one being backed up, and the CLI already asks for them with a hidden prompt when they aren't set.Type of change
Related Issue(s)
None.
How To Test
Install the CLI with
npm install -g backupdrill(2.6.0), then create an item with at least the bucket keys, the bucket name and the database URL (add Endpoint for R2 or B2):estimateis read-only: it connects to the database and prints its size.backupalso needspg_dumpwith a major version at least as new as the server's.backupdrill --help,backupdrill help drillandbackupdrill -Vrun without asking for authentication.Locally,
make backupdrill/validatepasses every check,make testandmake validatepass, and golangci-lint v2.12.2 reports 0 issues.Changelog
Authenticate the BackupDrill CLI using Touch ID and other unlock options with 1Password Shell Plugins.