pglombardo / PasswordPusher

🔐 Securely share sensitive information with automatic expiration & deletion after a set number of views or duration. Track who, what and when with full audit logs.
https://docs.pwpush.com
Apache License 2.0
2.08k stars 359 forks source link

Expose PostgreSQL database, user and password with environment variables #269

Closed C4ArtZ closed 2 years ago

C4ArtZ commented 2 years ago

The current approach is to edit the dockerfile, which is kind of unusual. See here

Is there a security reason for not using environment variables? Or is DATABASE_URL intended to be used here?

pglombardo commented 2 years ago

DATABASE_URL environment variable is the suggested route.

You can either configure your PostgreSQL server to use these credentials or override the environment var in the command line:

docker run -d -p "5100:5100" -e "DATABASE_URL=postgresql://user:passwd@postgres:5432/my_db" pglombardo/pwpush-postgres:release

pglombardo commented 2 years ago

Those docs should eventually be updated/revised to make them a bit more readable with the most popular strategies first.

C4ArtZ commented 2 years ago

DATABASE_URL doesn't seem to work with an unmodified container. I'm thinking it might be because it's hardcoded in the dockerfile.

EDIT:

Nevermind. I forgot to remove postgres from /var/lib/ when recreating the containers.

pglombardo commented 2 years ago

Ok that is good news. I'll close this issue then. If anything remains, feel free to update here or create a new issue.