[bitnami/pgbouncer] Specify userlist.txt file content by env var (#30336)

Signed-off-by: son.dn <son.dn@teko.vn>
Co-authored-by: son.dn <son.dn@teko.vn>
This commit is contained in:
sondn98 2023-04-19 16:36:25 +07:00 committed by GitHub
parent 3234e29768
commit 72e7aaff89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 0 deletions

View File

@ -180,6 +180,7 @@ pgbouncer_initialize() {
# Create credentials file
if ! pgbouncer_is_file_external "userlist.txt"; then
echo "\"$POSTGRESQL_USERNAME\" \"$POSTGRESQL_PASSWORD\"" >"$PGBOUNCER_AUTH_FILE"
echo "$PGBOUNCER_USERLIST" >>"$PGBOUNCER_AUTH_FILE"
else
debug "User list file mounted externally, skipping configuration"
fi

View File

@ -72,6 +72,7 @@ pgbouncer_env_vars=(
POSTGRESQL_DATABASE
POSTGRESQL_HOST
POSTGRESQL_PORT
PGBOUNCER_USERLIST
PGBOUNCER_SET_DATABASE_USER
PGBOUNCER_SET_DATABASE_PASSWORD
PGBOUNCER_CONNECT_QUERY
@ -168,6 +169,7 @@ export POSTGRESQL_PASSWORD="${POSTGRESQL_PASSWORD:-}"
export POSTGRESQL_DATABASE="${POSTGRESQL_DATABASE:-postgres}"
export POSTGRESQL_HOST="${POSTGRESQL_HOST:-postgresql}"
export POSTGRESQL_PORT="${POSTGRESQL_PORT:-5432}"
export PGBOUNCER_USERLIST="${PGBOUNCER_USERLIST:-}"
export PGBOUNCER_SET_DATABASE_USER="${PGBOUNCER_SET_DATABASE_USER:-no}"
export PGBOUNCER_SET_DATABASE_PASSWORD="${PGBOUNCER_SET_DATABASE_PASSWORD:-no}"
export PGBOUNCER_CONNECT_QUERY="${PGBOUNCER_CONNECT_QUERY:-}"

View File

@ -116,6 +116,7 @@ To expose the same database name as the backend, set `PGBOUNCER_DATABASE="$POSTG
* `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_QUERY`: PgBouncer will use this query to connect to the database and query the PostgreSQL backend for a user and password. No defaults.
* `PGBOUNCER_USERLIST`: Specify content of the *userlist.txt* file
* `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**.