Repository navigation
Conversation
The per-database auth_user added in edoburu#56 is always written, so the AUTH_USER variable never reaches a generated entry. Fall back to it before postgres. Assisted-by: Claude:claude-opus-5[1m]
jclaveau
added a commit
to jclaveau/docker-pgbouncer
that referenced
this pull request
Aug 14, 2026
Same fallback as edoburu#135, applied to pool entries too, and inert wherever DB_USER is set. Assisted-by: Claude:claude-opus-5[1m]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #134.
AUTH_USERsetsauth_userin the[pgbouncer]section, pgbouncer's default for databases naming none of their own.generate_config_db_entryalways writes a per-databaseauth_user, and the per-database value wins.AUTH_USERnever reaches a generated entry.Reproducing, before and after
Setup — a lookup role that is not
postgres, its credential in a mounteduserlist.txt, and a client absent from that file:docker network create demo docker run -d --name pg --network demo \ -e POSTGRES_PASSWORD=s3cret -e POSTGRES_DB=appdb \ -e POSTGRES_INITDB_ARGS=--auth-host=md5 \ postgres:17-alpine docker exec pg psql -U postgres -tAX -c "set password_encryption='md5'; create role lookup login superuser password 'lookuppw'; create role other login password 'otherpw'" printf '"lookup" "md5%s"\n' "$(printf 'lookuppwlookup' | md5sum | cut -d' ' -f1)" > userlist.txtBefore —
AUTH_USER=lookupis set, and ignored:After — same everything, image built from this branch:
auth_user=postgresbefore,auth_user=lookupafter.postgres— a role nothing in that configuration mentions — because the entry claimed anauth_userwhose password was never written anywhere.What does not change
DB_USERstill takes precedence, so #56 keeps working and clients keep reaching the server under their own identity.DB_USERAUTH_USERauth_user=postgres(unchanged)lookupuserauth_user=lookupuser(waspostgres)appuserauth_user=appuser(unchanged)appuserlookupuserauth_user=appuser(unchanged)What I left alone
auth_user=postgres.postgrescredential keeps answering unknown users withpassword authentication failed for user "postgres".auth_queryaway from anyone mounting anAUTH_FILEholding apostgrescredential with noDB_*set.:-removed.Tests
I would rather this waited for #133 and merged after it.
printf; what deserves proving is that the other three combinations still render exactly as today.# boot: yescase, since a renderedauth_useris only worth anything if pgbouncer accepts the fileDocumentation
The README paragraph on
AUTH_USERgains a sentence stating the precedence, since it previously described a variable with no effect on generated configs.Assisted-by: Claude:claude-opus-5[1m]