From 3549752bcf1162e20d35527a6eb704de1a9bc415 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 23 Mar 2026 19:02:00 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=92=20Remove=20hardcoded=20database=20?= =?UTF-8?q?credentials=20in=20setup=5Fdb.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace hardcoded `DB_USER` and `DB_PASS` with environment variable lookups. - Add a mandatory check for the `DB_PASS` environment variable. - Update `DB_HOST` and `DB_PORT` to be configurable via environment variables or positional arguments. - Maintain original defaults for `DB_USER` and `DB_PORT` to ensure backward compatibility. Co-authored-by: LeandroPG19 <151863062+LeandroPG19@users.noreply.github.com> --- setup_db.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/setup_db.sh b/setup_db.sh index 3889e88..b0ba216 100755 --- a/setup_db.sh +++ b/setup_db.sh @@ -4,10 +4,16 @@ # Uses the same credentials as postgres_mcp_launcher.sh set -euo pipefail -DB_USER="usuario" -DB_PASS="contraseña" -DB_HOST="${1:-localhost}" -DB_PORT="${2:-6433}" +DB_USER="${DB_USER:-usuario}" +DB_PASS="${DB_PASS:-}" +DB_HOST="${1:-${DB_HOST:-localhost}}" +DB_PORT="${2:-${DB_PORT:-6433}}" + +if [[ -z "$DB_PASS" ]]; then + echo "❌ Error: DB_PASS environment variable is not set." + echo "Usage: DB_PASS=yourpassword $0 [host] [port]" + exit 1 +fi echo "🧠 Creating 'brain' database on ${DB_HOST}:${DB_PORT}..."