From 7e5b373d4c75f8390be9ed135d13adb3257218eb Mon Sep 17 00:00:00 2001 From: Alexander Bayandin Date: Thu, 21 Dec 2023 11:14:46 +0000 Subject: [PATCH] [bitnami/pgbouncer] Add auth_dbname to available environment variables (#52264) Signed-off-by: Alexander Bayandin --- .../1/debian-11/rootfs/opt/bitnami/scripts/libpgbouncer.sh | 3 +++ .../1/debian-11/rootfs/opt/bitnami/scripts/pgbouncer-env.sh | 2 ++ bitnami/pgbouncer/README.md | 1 + 3 files changed, 6 insertions(+) diff --git a/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/libpgbouncer.sh b/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/libpgbouncer.sh index 2f52b7dbfb40..58b361f8a943 100644 --- a/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/libpgbouncer.sh +++ b/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/libpgbouncer.sh @@ -228,6 +228,9 @@ pgbouncer_initialize() { if ! is_empty_value "$PGBOUNCER_AUTH_USER"; then database_value+=" auth_user=$PGBOUNCER_AUTH_USER" fi + if ! is_empty_value "$PGBOUNCER_AUTH_DBNAME"; then + database_value+=" auth_dbname=$PGBOUNCER_AUTH_DBNAME" + fi if ! is_empty_value "$PGBOUNCER_CONNECT_QUERY"; then database_value+=" connect_query='${PGBOUNCER_CONNECT_QUERY}'" fi diff --git a/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/pgbouncer-env.sh b/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/pgbouncer-env.sh index e17b76121fb0..31afc87f8164 100644 --- a/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/pgbouncer-env.sh +++ b/bitnami/pgbouncer/1/debian-11/rootfs/opt/bitnami/scripts/pgbouncer-env.sh @@ -29,6 +29,7 @@ pgbouncer_env_vars=( PGBOUNCER_PORT PGBOUNCER_LISTEN_ADDRESS PGBOUNCER_AUTH_USER + PGBOUNCER_AUTH_DBNAME PGBOUNCER_AUTH_QUERY PGBOUNCER_AUTH_TYPE PGBOUNCER_AUTH_HBA_FILE @@ -120,6 +121,7 @@ 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_USER="${PGBOUNCER_AUTH_USER:-}" +export PGBOUNCER_AUTH_DBNAME="${PGBOUNCER_AUTH_DBNAME:-}" export PGBOUNCER_AUTH_QUERY="${PGBOUNCER_AUTH_QUERY:-}" export PGBOUNCER_AUTH_TYPE="${PGBOUNCER_AUTH_TYPE:-scram-sha-256}" export PGBOUNCER_AUTH_HBA_FILE="${PGBOUNCER_AUTH_HBA_FILE:-}" diff --git a/bitnami/pgbouncer/README.md b/bitnami/pgbouncer/README.md index 2ae36ffb9971..005fae42ce10 100644 --- a/bitnami/pgbouncer/README.md +++ b/bitnami/pgbouncer/README.md @@ -121,6 +121,7 @@ To expose a ["fallback database" (wildcard that matches any)](https://www.pgboun ### 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. No defaults. +* `PGBOUNCER_AUTH_DBNAME`: PgBouncer will use this user database for authentication purposes. No defaults. * `PGBOUNCER_AUTH_QUERY`: PgBouncer will use this query to connect to the database and query the PostgreSQL backend for a user and password. No defaults. * `PGBOUNCER_AUTH_TYPE`: PgBouncer authentication type. Default: **scram-sha-256** * `PGBOUNCER_AUTH_HBA_FILE`: HBA configuration file to use if auth_type is set to hba. No defaults.