docker-postgresql
docker-postgresql copied to clipboard
disallow POSTGRES user from logging remotely
disallow POSTGRES user from logging remotely. This is a safety measure, I personally always disable it explicitly in pg_hba.conf regardless how is postgres user password set
This can be optional switch
PG_TRUST_REMOTE_POSTGRES=${PG_TRUST_REMOTE_POSTGRES:-false}
with a function
trust_remote_postgres_user() {
if [[ ${PG_TRUST_REMOTE_POSTGRES} == false ]]; then
echo "Removing trust for POSTGRES user connecting from non-local host..."
set_hba_param "host all postgres 0.0.0.0/0 reject"
fi
}
https://github.com/sameersbn/docker-postgresql#command-line-arguments