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

Add Admin and Stats Users to userlist #38

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Natrinicle
Copy link
Contributor

In conjunction with the last PR creating the userlist if it doesn't already exist, also add in ADMIN_USERS and STATS_USERS if cooresponding ADMIN_PASSWORDS and STATS_PASSWORDS ENV variables are provided.

This is more of an out there PR and you can feel free to throw it out if you dislike it but I think it would make management easier.

For example with the following ENV variables

ADMIN_USERS=postgres,pg
ADMIN_PASSWORDS=postgres,pg
STATS_USERS=stats
STATS_PASSWORDS=stats

It produces STDOUT

Wrote postgres (admin) authentication credentials to /etc/pgbouncer/userlist.txt
Wrote pg (admin) authentication credentials to /etc/pgbouncer/userlist.txt
Wrote stats (stats) authentication credentials to /etc/pgbouncer/userlist.txt

and writes the following MD5 hashes into the userlist.txt

"postgres" "md53175bce1d3201d16594cebf9d7eb3f9d"
"pg" "md5971658c8903b1b9727ce2bc9081d71b0"
"stats" "md5a57ebe01934de43865125819a3c4af74"

This PR includes both the original PR as well as the new stuff for admin and stats users since you can't really run this new code without the touch fix.

Create /etc/pgbouncer/userlist.txt (or alternatively placed file) if it
doesn't exist by default. This file was apparently removed from upstream
around the end of 2020, beginning of 2021.
In conjunction with the last PR creating the userlist if it doesn't
already exist, also add in ADMIN_USERS and STATS_USERS if cooresponding
ADMIN_PASSWORDS and STATS_PASSWORDS ENV variables are provided.

This is more of an out there PR and you can feel free to throw it out if
you dislike it but I think it would make management easier.

For example with the following ENV variables

ADMIN_USERS=postgres,pg
ADMIN_PASSWORDS=postgres,pg
STATS_USERS=stats
STATS_PASSWORDS=stats

It produces STDOUT

Wrote postgres (admin) authentication credentials to /etc/pgbouncer/userlist.txt
Wrote pg (admin) authentication credentials to /etc/pgbouncer/userlist.txt
Wrote stats (stats) authentication credentials to /etc/pgbouncer/userlist.txt

and writes the following MD5 hashes into the userlist.txt

"postgres" "md53175bce1d3201d16594cebf9d7eb3f9d"
"pg" "md5971658c8903b1b9727ce2bc9081d71b0"
"stats" "md5a57ebe01934de43865125819a3c4af74"
@laerte-gaivota
Copy link

Please,

Aprove this pr to resolve this problem of docker. I'm testing and that is correct.

Regards.

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.

2 participants