diff --git a/scripts/setup-database.sh b/scripts/setup-database.sh index dfc9b63..0f2e14f 100644 --- a/scripts/setup-database.sh +++ b/scripts/setup-database.sh @@ -13,9 +13,15 @@ if [ "$EUID" -ne 0 ]; then exit 1 fi -DB_USER="explorer" -DB_PASSWORD="***REDACTED-LEGACY-PW***" -DB_NAME="explorer" +DB_USER="${DB_USER:-explorer}" +DB_NAME="${DB_NAME:-explorer}" +if [ -z "${DB_PASSWORD:-}" ]; then + echo "ERROR: DB_PASSWORD environment variable must be set before running this script." >&2 + echo "Generate a strong value (e.g. openssl rand -base64 32) and export it:" >&2 + echo " export DB_PASSWORD=''" >&2 + echo " sudo -E bash scripts/setup-database.sh" >&2 + exit 1 +fi echo "Creating database user: $DB_USER" echo "Creating database: $DB_NAME"