Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support auth_dbname through env variable #94

Closed
darunrs opened this issue Mar 21, 2024 · 1 comment
Closed

Support auth_dbname through env variable #94

darunrs opened this issue Mar 21, 2024 · 1 comment
Assignees

Comments

@darunrs
Copy link

darunrs commented Mar 21, 2024

PgBouncer has a nifty feature called auth_dbname which allows you to specify the database which it will use for calling auth_query rather than default to trying to call the function on the DB to be connected to. This requires specifying the auth_dbname value for each database under [databases]. I cannot currently do so through the image as the env variable isn't utilized.

Here's an example of auth_dbname in use below:
* = host=postgres port=5432 auth_user=pgbouncer auth_dbname=postgres

It's described on the config page at the bottom of the auth section. It was introduced in this release.

I'd love if the feature could be supported through this image!

I believe implementation would be something like adding ${AUTH_DBNAME:+auth_dbname=${AUTH_DBNAME}} to this line.

@jflambert jflambert self-assigned this Aug 14, 2024
@jflambert
Copy link
Collaborator

jflambert commented Aug 14, 2024

Actually @darunrs my understanding is that there are two possibilities. One is to add auth_dbname to connection strings under [databases], the other is to add is as a global parameter under [pgbouncer].

I'll add AUTH_DBNAME env var support for the global setting. Since we do not yet support multiple databases (see #67) it's as good as it gets for now.

Try latest or v1.23.1-p2 and let me know please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants