Adjust POSTGRES_HOST_AUTH_METHOD to automatically match configured password_encryption #897
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the swap to
scram-sha-256
as the default,initdb
uses that unless specified otherwise. So for the initial user created, the password is SCRAM encrypted.So, the current
md5
in the host auth method will usescram-sha-256
if that is how the password was saved.With this change on
postgres:14
, the host auth method inpg_hba.conf
will reflect the change toscram-sha-256
instead of usingmd5
. But there is the possibility of breaking users that are using a pre-hashed md5 password and are starting a newly initialized PostgreSQL 14 container.This change makes it possible to change the initial auth and have
pg_hba.conf
reflect the change automatically by usingPOSTGRES_INITDB_ARGS=--auth-host=scram-sha-256
and not having to also setPOSTGRES_HOST_AUTH_METHOD
.Setting
-c password_encryption=md5
is not enough to affect the initial user created by initdb (even though it is passed along toinitdb
😢).Our
POSTGRES_HOST_AUTH_METHOD
variable still only effects the line inpg_hba.conf
.