Skip to content

Set POSTGRES_HOST_AUTH_METHOD environment variable #4740

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

Merged
merged 1 commit into from
Mar 18, 2020

Conversation

ezkl
Copy link
Contributor

@ezkl ezkl commented Mar 18, 2020

What type of PR is this? (check all applicable)

  • Bug Fix

Description

Fixes #4739. Runs the postgres container with the environment variable POSTGRES_HOST_AUTH_METHOD set to the value trust.

Setting this environment variable is not recommended by the image maintainers, but results in a postgres container that operates in much the same way that it did before the change was introduced. It is also backwards-compatible with older copies of the postgres:9.5-alpine image, which will simply ignore the environment variable.

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

N/A

Redash's docker-compose file will no longer bring up an environment from
a cold start due to recent upstream changes to the postgres image that
force the user to either set a password for the default superuser or
opt-in to allowing all connections without a password via environment
variable.

Upstream PR: docker-library/postgres#658
Related Discussion: docker-library/postgres#681
Copy link
Member

@arikfr arikfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for addressing this!

Let's set the password instead. While it might break some existing dev setups (if they used this as a data source), but it's better to stick to best practices. While this is only dev setup, some people might use it for non dev work or with confidential information.

Beside the change in docker-compose.yml you will need to update the connection string in REDASH_DATABASE_URL.

To make things a bit more clear, let's use this-is-for-dev-only-dont-use-for-production as password :)

Copy link
Member

@arikfr arikfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thought, once the Postgres data directory is created, it will set the password value and won't read it again from POSTGRES_PASSWORD. So if we do this change now, we will break every existing dev setup -- regardless of the Postgres image version they are using.

Let's move on with the current change, and hope people realize they aren't supposed to use dev setup for anything but dev.

@arikfr arikfr merged commit 45914f9 into getredash:master Mar 18, 2020
@ezkl ezkl deleted the docker-compose-postgres-fix branch March 18, 2020 13:57
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.

Redash fails to start via docker-compose
2 participants