fix(backup): read Docker secret for manual backups
Heimdall Gitea / Detect CI scope (pull_request) Successful in 5s
Heimdall Gitea / Build and tests (pull_request) Successful in 20m8s
Heimdall Gitea / Publish versioned release (pull_request) Skipped
Heimdall Gitea / Build and scan agent image (pull_request) Successful in 5m18s
Heimdall Gitea / Build and scan server image (pull_request) Successful in 8m2s
Heimdall Gitea / Publish Docker Hub latest tags (pull_request) Skipped
Heimdall Gitea / CI policy (pull_request) Successful in 2s

This commit is contained in:
Arnaud Dartois committed 2026-10-26 13:30:23 +01:00
1 parent 9d01ca33c0
commit 5a7b7c1931
2 files changed
+10 -2

No files matched your search

+9 -1
View File
@@ -11,6 +11,7 @@
#
# Required env vars (set in .env or export):
# POSTGRES_HOST, POSTGRES_PORT, POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD
# or POSTGRES_PASSWORD_FILE (for Docker secrets)
# RUSTFS_ENDPOINT, RUSTFS_ACCESS_KEY, RUSTFS_SECRET_KEY,
# RUSTFS_BUCKET (default: heimdall; S3_* and legacy ALARIK_* aliases accepted)
#
@@ -38,7 +39,14 @@ PG_HOST="${POSTGRES_HOST:-localhost}"
PG_PORT="${POSTGRES_PORT:-5432}"
PG_DB="${POSTGRES_DB:-heimdall}"
PG_USER="${POSTGRES_USER:-heimdall}"
PG_PASSWORD="${POSTGRES_PASSWORD:-heimdall}"
if [[ -n "${POSTGRES_PASSWORD:-}" ]]; then
PG_PASSWORD="$POSTGRES_PASSWORD"
elif [[ -n "${POSTGRES_PASSWORD_FILE:-}" ]]; then
[[ -r "$POSTGRES_PASSWORD_FILE" ]] || { echo "[backup] FATAL: POSTGRES_PASSWORD_FILE is not readable" >&2; exit 1; }
PG_PASSWORD="$(<"$POSTGRES_PASSWORD_FILE")"
else
PG_PASSWORD="heimdall"
fi
S3_ENDPOINT="${RUSTFS_ENDPOINT:-${ALARIK_ENDPOINT:-${S3_ENDPOINT:-}}}"
S3_ACCESS_KEY="${RUSTFS_ACCESS_KEY:-${ALARIK_ACCESS_KEY:-${S3_ACCESS_KEY:-}}}"