mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added support for passing password using Docker Secret to Docker images. Fixes #7332
This commit is contained in:
committed by
Akshay Joshi
parent
48336fd7f4
commit
3297546e0a
@@ -36,8 +36,8 @@ EOF
|
||||
fi
|
||||
|
||||
if [ ! -f /var/lib/pgadmin/pgadmin4.db ]; then
|
||||
if [ -z "${PGADMIN_DEFAULT_EMAIL}" -o -z "${PGADMIN_DEFAULT_PASSWORD}" ]; then
|
||||
echo 'You need to define the PGADMIN_DEFAULT_EMAIL and PGADMIN_DEFAULT_PASSWORD environment variables.'
|
||||
if ([ -z "${PGADMIN_DEFAULT_EMAIL}" ]) || ( [ -z "${PGADMIN_DEFAULT_PASSWORD}" ] && [ ! -n "${PGADMIN_DEFAULT_PASSWORD_FILE}" ] ); then
|
||||
echo 'You need to define the PGADMIN_DEFAULT_EMAIL and PGADMIN_DEFAULT_PASSWORD or PGADMIN_DEFAULT_PASSWORD_FILE environment variables.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -47,6 +47,11 @@ if [ ! -f /var/lib/pgadmin/pgadmin4.db ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Read secret contents
|
||||
if [ -n "${PGADMIN_DEFAULT_PASSWORD_FILE}" ]; then
|
||||
export PGADMIN_DEFAULT_PASSWORD=$(cat ${PGADMIN_DEFAULT_PASSWORD_FILE})
|
||||
fi
|
||||
|
||||
# Set the default username and password in a
|
||||
# backwards compatible way
|
||||
export PGADMIN_SETUP_EMAIL=${PGADMIN_DEFAULT_EMAIL}
|
||||
|
||||
Reference in New Issue
Block a user