Skip to content

Commit

Permalink
Fix original client options not being passed through
Browse files Browse the repository at this point in the history
  • Loading branch information
luqasn committed Jun 4, 2022
1 parent 19aeff0 commit cf24bab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion image/auth.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/sh

# read "input" (we only use target database)
. /dev/stdin
cp /dev/stdin input.vars
. ./input.vars

set -eo nounset
# generate hashed pw to return
Expand All @@ -10,6 +11,8 @@ md5=$(printf '%s' "$TARGET_PASSWORD$TARGET_USER" | md5sum | cut -d ' ' -f 1)
echo "SELECT 'CREATE DATABASE $database' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = '$database')\gexec" | psql "postgresql://$TARGET_USER:$TARGET_PASSWORD@$TARGET_HOST/$TARGET_DUMMY_DB"

# return connection info to proxy
# keep original options intact
cat input.vars
cat << END
database=$database
user=$TARGET_USER
Expand Down

0 comments on commit cf24bab

Please sign in to comment.