-
Notifications
You must be signed in to change notification settings - Fork 519
services/horizon: Fix docker-compose Postgres' auth #2301
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
Conversation
This comment has been minimized.
This comment has been minimized.
9f36de9
to
58363d3
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Hi @2opremio! Thanks for bringing this problem to our attention and opening a fix! Please bare with me a moment while I update our clabot-config. In terms of how we address this breaking change in Postgres, I think we should set |
Yes, that's what the PR does. |
It pins the current version, not the past one. Do you mean you prefer to have the patch number unpinned? I can definitely do that if you prefer. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
58363d3
to
92e966b
Compare
By not pinning the Postgres version, authentication stopped working since now it requires either setting the Postgres password or an explicit `POSTGRES_HOST_AUTH_METHOD=trust`: ``` Error: Database is uninitialized and superuser password is not specified. You must specify POSTGRES_PASSWORD for the superuser. Use "-e POSTGRES_PASSWORD=password" to set it in "docker run". You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections without a password. This is *not* recommended. See PostgreSQL documentation about "trust": https://www.postgresql.org/docs/current/auth-trust.html ``` Making this breaking change on a patch release is arguably a mistake on Postgres' end (see docker-library/postgres#681 (comment) ) but ... it is what it is. This commit sets `POSTGRES_HOST_AUTH_METHOD=trust` and also pins the patch number of Postgres to make it future-proof.
92e966b
to
28f60cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, indeed you're already using the new environment variable. Sorry!
@@ -1,7 +1,7 @@ | |||
version: '3' | |||
services: | |||
core-postgres: | |||
image: postgres:9.6-alpine | |||
image: postgres:9.6.17-alpine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should leave this change out and continue to use the latest 9.6 patch version. It's valuable for us to continue to use the latest security patches and to not need to update this manually on each patch release. Normally a patch release won't include breaking changes and this seems like an exception, so the pain of a new version breaking use is unlikely to be frequent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's valuable for us to continue to use the latest security patches and to not need to update this manually on each patch release
As far as I understand this is only used for local development, so I am not sure security is more important than stability but, happy to make the change if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, but nobody wants their developer environment exploitable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's worth noting that this is only pinning to a version of Postgres, not to a version of the Docker image. The version number is the version of Postgres, and the Docker images can change independent of that with any change to the official Dockerfiles.
Specifying the patch version number wouldn't have prevented this breakage from occurring because the breaking change was a change to the Docker image (docker-library/postgres@42ce743), and not Postgres. See this PR for more information that is adding a warning to their docs about this as a result of this break: docker-library/postgres#689.
If we really want to ensure 100% stability this would need to pin to the image digest, but I think this is unnecessary as breaking changes are rare.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your point doesn't hold, because tags with the patch number are not rebuilt, and thus can be considered immutable for all they are worth
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice, TIL. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
PR Checklist
PR Structure
otherwise).
services/friendbot
, orall
ordoc
if the changes are broad or impact manypackages.
Thoroughness
.md
files, etc... affected by this change). Take a look in the
docs
folder for a given service,like this one.
Release planning
needed with deprecations, added features, breaking changes, and DB schema changes.
semver, or if it's mainly a patch change. The PR is targeted at the next
release branch if it's not a patch change.
What
Fix the authentication of the Horizon container against the Postgres Horizon container at
services/horizon/docker/docker-compose.yml
.Why/How
By not pinning the full Postgres version, authentication stopped working since now it requires either setting the Postgres password or an explicit
POSTGRES_HOST_AUTH_METHOD=trust
:Making this breaking change on a patch release is arguably a mistake on Postgres' end (see docker-library/postgres#681 (comment) ) but ... it is what it is.
This PR sets
POSTGRES_HOST_AUTH_METHOD=trust
and also pins the patch number of Postgres to make it future-proof.Known limitations
N/A