From a7588e1bc8b65e2cabbf5c0f02926ff328f49bdf Mon Sep 17 00:00:00 2001 From: gongzhiyong Date: Sun, 3 May 2026 21:49:55 +0800 Subject: [PATCH] chore: remove plaintext postgres retry credentials --- heicode/.retry_pg.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) mode change 100644 => 100755 heicode/.retry_pg.sh diff --git a/heicode/.retry_pg.sh b/heicode/.retry_pg.sh old mode 100644 new mode 100755 index ec18435..a9da631 --- a/heicode/.retry_pg.sh +++ b/heicode/.retry_pg.sh @@ -1,13 +1,13 @@ #!/usr/bin/env bash -set -e -export PGHOST=heicode.postgres.database.azure.com -export PGPORT=5432 -export PGDATABASE=heicode -export PGPASSWORD="Myadmin@123456." -export PGSSLMODE=require +set -euo pipefail -echo "[try-1] PGUSER=heicode" -PGUSER=heicode psql -c "select current_user, current_database();" || true +# Local PostgreSQL retry helper. +# Do not store real credentials in this file. Supply them through the shell +# environment or a secret manager before running it. +: "${PGHOST:?PGHOST is required}" +: "${PGUSER:?PGUSER is required}" +: "${PGPORT:=5432}" +: "${PGDATABASE:?PGDATABASE is required}" +: "${PGPASSWORD:?PGPASSWORD is required}" -echo "[try-2] PGUSER=heicode@heicode" -PGUSER='heicode@heicode' psql -c "select current_user, current_database();" || true +psql "sslmode=require host=${PGHOST} port=${PGPORT} user=${PGUSER} dbname=${PGDATABASE}"