From cf24bab0dac58ea883e29d6d9e275335f83f4fc1 Mon Sep 17 00:00:00 2001 From: Lucas Romero Date: Sat, 4 Jun 2022 12:20:00 +0200 Subject: [PATCH] Fix original client options not being passed through --- image/auth.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/image/auth.sh b/image/auth.sh index 2fd8051..ce030cb 100755 --- a/image/auth.sh +++ b/image/auth.sh @@ -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 @@ -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