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 73ccc14df035..a13552100ee6 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 @@ -64,6 +64,15 @@ pgbouncer_validate() { fi fi + # HBA Checks + if [[ "$PGBOUNCER_AUTH_TYPE" == "hba" ]] ; then + if [[ -z "$PGBOUNCER_AUTH_HBA_FILE" ]]; then + print_validation_error "A hba file was not provided. You need to set this value when specifying auth_type to hba" + elif [[ ! -f "$PGBOUNCER_AUTH_HBA_FILE" ]]; then + print_validation_error "The hba file in the specified path ${PGBOUNCER_AUTH_HBA_FILE} does not exist" + fi + fi + # TLS Checks (client) if [[ "$PGBOUNCER_CLIENT_TLS_SSLMODE" != "disable" ]]; then if [[ -z "$PGBOUNCER_CLIENT_TLS_CERT_FILE" ]]; then @@ -228,6 +237,7 @@ pgbouncer_initialize() { "unix_socket_group:${PGBOUNCER_SOCKET_GROUP}" "auth_file:${PGBOUNCER_AUTH_FILE}" "auth_type:${PGBOUNCER_AUTH_TYPE}" + "auth_hba_file:${PGBOUNCER_AUTH_HBA_FILE}" "auth_query:${PGBOUNCER_AUTH_QUERY}" "pidfile:${PGBOUNCER_PID_FILE}" "logfile:${PGBOUNCER_LOG_FILE}" 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 e26e18dac59f..b6c90f0858a5 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_AUTH_USER PGBOUNCER_AUTH_QUERY PGBOUNCER_AUTH_TYPE + PGBOUNCER_AUTH_HBA_FILE PGBOUNCER_STATS_USERS PGBOUNCER_POOL_MODE PGBOUNCER_INIT_SLEEP_TIME @@ -116,6 +117,7 @@ export PGBOUNCER_LISTEN_ADDRESS="${PGBOUNCER_LISTEN_ADDRESS:-0.0.0.0}" export PGBOUNCER_AUTH_USER="${PGBOUNCER_AUTH_USER:-}" export PGBOUNCER_AUTH_QUERY="${PGBOUNCER_AUTH_QUERY:-}" export PGBOUNCER_AUTH_TYPE="${PGBOUNCER_AUTH_TYPE:-md5}" +export PGBOUNCER_AUTH_HBA_FILE="${PGBOUNCER_AUTH_HBA_FILE:-}" export PGBOUNCER_STATS_USERS="${PGBOUNCER_STATS_USERS:-}" export PGBOUNCER_POOL_MODE="${PGBOUNCER_POOL_MODE:-}" export PGBOUNCER_INIT_SLEEP_TIME="${PGBOUNCER_INIT_SLEEP_TIME:-10}"