feat(backup): add protected database and config download (#154)

This commit is contained in:
n30nex
2026-09-23 20:13:40 -04:00
committed by GitHub
parent 4d2642abec
commit a25e2675c8
21 changed files with 1103 additions and 6 deletions
+11
View File
@@ -47,10 +47,16 @@ jobs:
- name: Test
run: go test ./...
- name: Verify backup startup against PostgreSQL 16
env:
BEACON_TEST_POSTGRES_DSN: postgres://postgres:backup-ci-only@127.0.0.1:5432/postgres?sslmode=disable
run: go test ./cmd/beacon -run '^TestBackupConfigurationPostgres$' -count=1 -v
- name: Verify backup command against PostgreSQL 16
run: |
CGO_ENABLED=0 go build -o "$RUNNER_TEMP/beacon-backup" ./cmd/beacon-backup
CGO_ENABLED=0 go test -c -o "$RUNNER_TEMP/backup.test" ./internal/backup
CGO_ENABLED=0 go test -c -o "$RUNNER_TEMP/backup-http.test" ./internal/api/router
docker run --rm --network host \
-e PGHOST=127.0.0.1 -e PGUSER=postgres -e PGDATABASE=postgres \
-e PGPASSWORD=backup-ci-only -e PGSSLMODE=disable \
@@ -58,6 +64,11 @@ jobs:
-v "$RUNNER_TEMP/beacon-backup:/beacon-backup:ro" \
-v "$RUNNER_TEMP/backup.test:/backup.test:ro" \
postgres:16-alpine /backup.test -test.run '^TestExportPostgres$' -test.v
docker run --rm --network host \
-e PGHOST=127.0.0.1 -e PGUSER=postgres -e PGDATABASE=postgres \
-e PGPASSWORD=backup-ci-only -e PGSSLMODE=disable -e BEACON_BACKUP_TEST_POSTGRES=1 \
-v "$RUNNER_TEMP/backup-http.test:/backup-http.test:ro" \
postgres:16-alpine /backup-http.test -test.run '^TestBackupDownloadPostgres$' -test.v
- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest