mirror of
https://github.com/wassname/docker-postgresql.git
synced 2026-07-13 02:42:35 +08:00
start: use true/false for PSQL_TRUST_LOCALNET configuration
This commit is contained in:
@@ -6,10 +6,10 @@ PG_CONFDIR="/etc/postgresql/${PG_VERSION}/main"
|
||||
PG_BINDIR="/usr/lib/postgresql/${PG_VERSION}/bin"
|
||||
PG_DATADIR="${PG_HOME}/${PG_VERSION}/main"
|
||||
|
||||
# set this env variable to Y to enable a line in the
|
||||
# set this env variable to true to enable a line in the
|
||||
# pg_hba.conf file to trust samenet. this can be used to connect
|
||||
# from other containers on the same host without authentication
|
||||
PSQL_TRUST_LOCALNET=${PSQL_TRUST_LOCALNET:N}
|
||||
PSQL_TRUST_LOCALNET=${PSQL_TRUST_LOCALNET:false}
|
||||
|
||||
DB_NAME=${DB_NAME:-}
|
||||
DB_USER=${DB_USER:-}
|
||||
@@ -33,7 +33,7 @@ listen_addresses = '*'
|
||||
EOF
|
||||
|
||||
trust_local="host all all samenet trust"
|
||||
if [ ${PSQL_TRUST_LOCALNET} = "Y" ]; then
|
||||
if [ ${PSQL_TRUST_LOCALNET} = "true" ]; then
|
||||
echo "Enabling trust samenet in pg_hba.conf..."
|
||||
echo ${trust_local} >> ${PG_CONFDIR}/pg_hba.conf
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user