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

Connect to multiple databases and controlling the user list directly #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TimSC
Copy link

@TimSC TimSC commented Aug 29, 2021

For connecting to multiple databases and controlling the user list directly, the DB_DATABASES and AUTH_USERLIST env variables may be used.

docker run -e DB_DATABASES='flask = host = 192.168.1.5 port=5432 user=web_user password=xxxx dbname=flask,data_web = host = 192.168.1.10 port=5432 user=web_user password=xxxxx dbname=data_web' -e LISTEN_PORT=5439 -p 5439:5439 -e AUTH_USERLIST="\"username1\" \"password\",\"username2\" \"password2\"" pgbouncer

@jheld
Copy link

jheld commented Dec 20, 2021

Would love to have this support merged.

noyceb added a commit to dapperlabs-platform/docker-pgbouncer that referenced this pull request Feb 16, 2022
noyceb added a commit to dapperlabs-platform/docker-pgbouncer that referenced this pull request Feb 16, 2022
@homme
Copy link

homme commented Apr 7, 2022

It would be nice if this extended the current DATABASE_URL idiom to allow multiple URLs, e.g. by setting DATABASE_URLS. At the moment it's limited to the postgres specific DSN format.

@jflambert
Copy link
Collaborator

jflambert commented Aug 14, 2024

Hi @homme I see what you mean. However DATABASE_URL itself is limiting in that it doesn't let you override some global pgbouncer configs such as auth_user, auth_query, auth_dbname, etc. Please correct me if I'm wrong! Either way please feel free to open a second issue.

@TimSC I'm sorry it took me close to 3 years before evaluating this PR but I think I like your approach. I'm just trying to understand the relationship between DB_DATABASES and AUTH_USERLIST. Right now we add an entry to userlist.txt from user/pass vars. I wonder if some users would expect us to automatically parse the user/pass from each DB_DATABASES entry if AUTH_USERLIST is not provided.

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

Successfully merging this pull request may close these issues.

4 participants