mirror of
https://github.com/bitnami/containers.git
synced 2026-03-05 07:29:11 +08:00
Merge pull request #22 from pks-t/pks-auth-user-and-query
Support `auth_user` and `auth_query` options
This commit is contained in:
@@ -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}"
|
||||
|
||||
@@ -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}"
|
||||
|
||||
@@ -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**.
|
||||
|
||||
Reference in New Issue
Block a user