diff --git a/bitnami/pgbouncer/1/debian-10/rootfs/opt/bitnami/scripts/libpgbouncer.sh b/bitnami/pgbouncer/1/debian-10/rootfs/opt/bitnami/scripts/libpgbouncer.sh index 3edf3c700c21..b188d0cc3ed1 100644 --- a/bitnami/pgbouncer/1/debian-10/rootfs/opt/bitnami/scripts/libpgbouncer.sh +++ b/bitnami/pgbouncer/1/debian-10/rootfs/opt/bitnami/scripts/libpgbouncer.sh @@ -217,12 +217,16 @@ pgbouncer_initialize() { if [[ "$PGBOUNCER_DATABASE" != "*" ]]; then database_value+=" dbname=$POSTGRESQL_DATABASE" fi + if ! is_empty_value "$PGBOUNCER_AUTH_USER"; then + database_value+=" auth_user=$PGBOUNCER_AUTH_USER" + fi ini-file set --section "databases" --key "$PGBOUNCER_DATABASE" --value "$database_value" "$PGBOUNCER_CONF_FILE" local -r -a key_value_pairs=( "listen_port:${PGBOUNCER_PORT}" "listen_addr:${PGBOUNCER_LISTEN_ADDRESS}" "auth_file:${PGBOUNCER_AUTH_FILE}" "auth_type:${PGBOUNCER_AUTH_TYPE}" + "auth_query:${PGBOUNCER_AUTH_QUERY}" "pidfile:${PGBOUNCER_PID_FILE}" "logfile:${PGBOUNCER_LOG_FILE}" "admin_users:${POSTGRESQL_USERNAME}" diff --git a/bitnami/pgbouncer/1/debian-10/rootfs/opt/bitnami/scripts/pgbouncer-env.sh b/bitnami/pgbouncer/1/debian-10/rootfs/opt/bitnami/scripts/pgbouncer-env.sh index 23fa3b78c479..82be1c298b63 100644 --- a/bitnami/pgbouncer/1/debian-10/rootfs/opt/bitnami/scripts/pgbouncer-env.sh +++ b/bitnami/pgbouncer/1/debian-10/rootfs/opt/bitnami/scripts/pgbouncer-env.sh @@ -25,6 +25,8 @@ pgbouncer_env_vars=( PGBOUNCER_PORT PGBOUNCER_LISTEN_ADDRESS PGBOUNCER_AUTH_TYPE + PGBOUNCER_AUTH_USER + PGBOUNCER_AUTH_QUERY PGBOUNCER_POOL_MODE PGBOUNCER_INIT_SLEEP_TIME PGBOUNCER_INIT_MAX_RETRIES @@ -89,6 +91,8 @@ export PGBOUNCER_DATABASE="${PGBOUNCER_DATABASE:-postgres}" export PGBOUNCER_PORT="${PGBOUNCER_PORT:-6432}" export PGBOUNCER_LISTEN_ADDRESS="${PGBOUNCER_LISTEN_ADDRESS:-0.0.0.0}" export PGBOUNCER_AUTH_TYPE="${PGBOUNCER_AUTH_TYPE:-md5}" +export PGBOUNCER_AUTH_USER="${PGBOUNCER_AUTH_USER:-}" +export PGBOUNCER_AUTH_QUERY="${PGBOUNCER_AUTH_QUERY:-}" export PGBOUNCER_POOL_MODE="${PGBOUNCER_POOL_MODE:-}" export PGBOUNCER_INIT_SLEEP_TIME="${PGBOUNCER_INIT_SLEEP_TIME:-10}" export PGBOUNCER_INIT_MAX_RETRIES="${PGBOUNCER_INIT_MAX_RETRIES:-10}" diff --git a/bitnami/pgbouncer/README.md b/bitnami/pgbouncer/README.md index 5be72c6e5876..391133906dca 100644 --- a/bitnami/pgbouncer/README.md +++ b/bitnami/pgbouncer/README.md @@ -114,6 +114,8 @@ To expose the same database name as the backend, set `PGBOUNCER_DATABASE="$POSTG ### Other options +- `PGBOUNCER_AUTH_USER`: PgBouncer will use this user to connect to the database and query the PostgreSQL backend for a user and password. Default: **disabled**. +- `PGBOUNCER_AUTH_QUERY`: PgBouncer will use this query to connect to the database and query the PostgreSQL backend for a user and password. Default: **disabled**. - `PGBOUNCER_POOL_MODE` : PgBouncer pool mode. Allowed values: session, transaction and statement. Default: **session**. - `PGBOUNCER_INIT_SLEEP_TIME` : PgBouncer initialization sleep time. Default: **10**. - `PGBOUNCER_INIT_MAX_RETRIES` : PgBouncer initialization maximum retries. Default: **10**.