Skip to content

Commit f1bc878

Browse files
committed
Clarify that "POSTGRES_PASSWORD" should be non-empty
(Assuming "POSTGRES_HOST_AUTH_METHOD" is not set to the "trust" value which does not require passwords.)
1 parent 05ac2d3 commit f1bc878

11 files changed

+77
-66
lines changed

10/alpine/docker-entrypoint.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ docker_init_database_dir() {
8888
}
8989

9090
# print large warning if POSTGRES_PASSWORD is long
91-
# error if both POSTGRES_PASSWORD is unset and POSTGRES_HOST_AUTH_METHOD is not 'trust'
91+
# error if both POSTGRES_PASSWORD is empty and POSTGRES_HOST_AUTH_METHOD is not 'trust'
9292
# print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
9393
# assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
9494
docker_verify_minimum_env() {
@@ -110,12 +110,13 @@ docker_verify_minimum_env() {
110110
# The - option suppresses leading tabs but *not* spaces. :)
111111
cat >&2 <<-'EOE'
112112
Error: Database is uninitialized and superuser password is not specified.
113-
You must specify POSTGRES_PASSWORD for the superuser. Use
114-
"-e POSTGRES_PASSWORD=password" to set it in "docker run".
113+
You must specify POSTGRES_PASSWORD to a non-empty value for the
114+
superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
115115
116-
You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections
117-
without a password. This is *not* recommended. See PostgreSQL
118-
documentation about "trust":
116+
You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
117+
connections without a password. This is *not* recommended.
118+
119+
See PostgreSQL documentation about "trust":
119120
https://www.postgresql.org/docs/current/auth-trust.html
120121
EOE
121122
exit 1

10/docker-entrypoint.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ docker_init_database_dir() {
8888
}
8989

9090
# print large warning if POSTGRES_PASSWORD is long
91-
# error if both POSTGRES_PASSWORD is unset and POSTGRES_HOST_AUTH_METHOD is not 'trust'
91+
# error if both POSTGRES_PASSWORD is empty and POSTGRES_HOST_AUTH_METHOD is not 'trust'
9292
# print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
9393
# assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
9494
docker_verify_minimum_env() {
@@ -110,12 +110,13 @@ docker_verify_minimum_env() {
110110
# The - option suppresses leading tabs but *not* spaces. :)
111111
cat >&2 <<-'EOE'
112112
Error: Database is uninitialized and superuser password is not specified.
113-
You must specify POSTGRES_PASSWORD for the superuser. Use
114-
"-e POSTGRES_PASSWORD=password" to set it in "docker run".
113+
You must specify POSTGRES_PASSWORD to a non-empty value for the
114+
superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
115115
116-
You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections
117-
without a password. This is *not* recommended. See PostgreSQL
118-
documentation about "trust":
116+
You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
117+
connections without a password. This is *not* recommended.
118+
119+
See PostgreSQL documentation about "trust":
119120
https://www.postgresql.org/docs/current/auth-trust.html
120121
EOE
121122
exit 1

11/alpine/docker-entrypoint.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ docker_init_database_dir() {
8888
}
8989

9090
# print large warning if POSTGRES_PASSWORD is long
91-
# error if both POSTGRES_PASSWORD is unset and POSTGRES_HOST_AUTH_METHOD is not 'trust'
91+
# error if both POSTGRES_PASSWORD is empty and POSTGRES_HOST_AUTH_METHOD is not 'trust'
9292
# print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
9393
# assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
9494
docker_verify_minimum_env() {
@@ -110,12 +110,13 @@ docker_verify_minimum_env() {
110110
# The - option suppresses leading tabs but *not* spaces. :)
111111
cat >&2 <<-'EOE'
112112
Error: Database is uninitialized and superuser password is not specified.
113-
You must specify POSTGRES_PASSWORD for the superuser. Use
114-
"-e POSTGRES_PASSWORD=password" to set it in "docker run".
113+
You must specify POSTGRES_PASSWORD to a non-empty value for the
114+
superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
115115
116-
You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections
117-
without a password. This is *not* recommended. See PostgreSQL
118-
documentation about "trust":
116+
You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
117+
connections without a password. This is *not* recommended.
118+
119+
See PostgreSQL documentation about "trust":
119120
https://www.postgresql.org/docs/current/auth-trust.html
120121
EOE
121122
exit 1

11/docker-entrypoint.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ docker_init_database_dir() {
8888
}
8989

9090
# print large warning if POSTGRES_PASSWORD is long
91-
# error if both POSTGRES_PASSWORD is unset and POSTGRES_HOST_AUTH_METHOD is not 'trust'
91+
# error if both POSTGRES_PASSWORD is empty and POSTGRES_HOST_AUTH_METHOD is not 'trust'
9292
# print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
9393
# assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
9494
docker_verify_minimum_env() {
@@ -110,12 +110,13 @@ docker_verify_minimum_env() {
110110
# The - option suppresses leading tabs but *not* spaces. :)
111111
cat >&2 <<-'EOE'
112112
Error: Database is uninitialized and superuser password is not specified.
113-
You must specify POSTGRES_PASSWORD for the superuser. Use
114-
"-e POSTGRES_PASSWORD=password" to set it in "docker run".
113+
You must specify POSTGRES_PASSWORD to a non-empty value for the
114+
superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
115115
116-
You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections
117-
without a password. This is *not* recommended. See PostgreSQL
118-
documentation about "trust":
116+
You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
117+
connections without a password. This is *not* recommended.
118+
119+
See PostgreSQL documentation about "trust":
119120
https://www.postgresql.org/docs/current/auth-trust.html
120121
EOE
121122
exit 1

12/alpine/docker-entrypoint.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ docker_init_database_dir() {
8888
}
8989

9090
# print large warning if POSTGRES_PASSWORD is long
91-
# error if both POSTGRES_PASSWORD is unset and POSTGRES_HOST_AUTH_METHOD is not 'trust'
91+
# error if both POSTGRES_PASSWORD is empty and POSTGRES_HOST_AUTH_METHOD is not 'trust'
9292
# print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
9393
# assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
9494
docker_verify_minimum_env() {
@@ -110,12 +110,13 @@ docker_verify_minimum_env() {
110110
# The - option suppresses leading tabs but *not* spaces. :)
111111
cat >&2 <<-'EOE'
112112
Error: Database is uninitialized and superuser password is not specified.
113-
You must specify POSTGRES_PASSWORD for the superuser. Use
114-
"-e POSTGRES_PASSWORD=password" to set it in "docker run".
113+
You must specify POSTGRES_PASSWORD to a non-empty value for the
114+
superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
115115
116-
You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections
117-
without a password. This is *not* recommended. See PostgreSQL
118-
documentation about "trust":
116+
You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
117+
connections without a password. This is *not* recommended.
118+
119+
See PostgreSQL documentation about "trust":
119120
https://www.postgresql.org/docs/current/auth-trust.html
120121
EOE
121122
exit 1

12/docker-entrypoint.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ docker_init_database_dir() {
8888
}
8989

9090
# print large warning if POSTGRES_PASSWORD is long
91-
# error if both POSTGRES_PASSWORD is unset and POSTGRES_HOST_AUTH_METHOD is not 'trust'
91+
# error if both POSTGRES_PASSWORD is empty and POSTGRES_HOST_AUTH_METHOD is not 'trust'
9292
# print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
9393
# assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
9494
docker_verify_minimum_env() {
@@ -110,12 +110,13 @@ docker_verify_minimum_env() {
110110
# The - option suppresses leading tabs but *not* spaces. :)
111111
cat >&2 <<-'EOE'
112112
Error: Database is uninitialized and superuser password is not specified.
113-
You must specify POSTGRES_PASSWORD for the superuser. Use
114-
"-e POSTGRES_PASSWORD=password" to set it in "docker run".
113+
You must specify POSTGRES_PASSWORD to a non-empty value for the
114+
superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
115115
116-
You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections
117-
without a password. This is *not* recommended. See PostgreSQL
118-
documentation about "trust":
116+
You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
117+
connections without a password. This is *not* recommended.
118+
119+
See PostgreSQL documentation about "trust":
119120
https://www.postgresql.org/docs/current/auth-trust.html
120121
EOE
121122
exit 1

9.5/alpine/docker-entrypoint.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ docker_init_database_dir() {
8888
}
8989

9090
# print large warning if POSTGRES_PASSWORD is long
91-
# error if both POSTGRES_PASSWORD is unset and POSTGRES_HOST_AUTH_METHOD is not 'trust'
91+
# error if both POSTGRES_PASSWORD is empty and POSTGRES_HOST_AUTH_METHOD is not 'trust'
9292
# print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
9393
# assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
9494
docker_verify_minimum_env() {
@@ -110,12 +110,13 @@ docker_verify_minimum_env() {
110110
# The - option suppresses leading tabs but *not* spaces. :)
111111
cat >&2 <<-'EOE'
112112
Error: Database is uninitialized and superuser password is not specified.
113-
You must specify POSTGRES_PASSWORD for the superuser. Use
114-
"-e POSTGRES_PASSWORD=password" to set it in "docker run".
113+
You must specify POSTGRES_PASSWORD to a non-empty value for the
114+
superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
115115
116-
You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections
117-
without a password. This is *not* recommended. See PostgreSQL
118-
documentation about "trust":
116+
You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
117+
connections without a password. This is *not* recommended.
118+
119+
See PostgreSQL documentation about "trust":
119120
https://www.postgresql.org/docs/current/auth-trust.html
120121
EOE
121122
exit 1

9.5/docker-entrypoint.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ docker_init_database_dir() {
8888
}
8989

9090
# print large warning if POSTGRES_PASSWORD is long
91-
# error if both POSTGRES_PASSWORD is unset and POSTGRES_HOST_AUTH_METHOD is not 'trust'
91+
# error if both POSTGRES_PASSWORD is empty and POSTGRES_HOST_AUTH_METHOD is not 'trust'
9292
# print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
9393
# assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
9494
docker_verify_minimum_env() {
@@ -110,12 +110,13 @@ docker_verify_minimum_env() {
110110
# The - option suppresses leading tabs but *not* spaces. :)
111111
cat >&2 <<-'EOE'
112112
Error: Database is uninitialized and superuser password is not specified.
113-
You must specify POSTGRES_PASSWORD for the superuser. Use
114-
"-e POSTGRES_PASSWORD=password" to set it in "docker run".
113+
You must specify POSTGRES_PASSWORD to a non-empty value for the
114+
superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
115115
116-
You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections
117-
without a password. This is *not* recommended. See PostgreSQL
118-
documentation about "trust":
116+
You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
117+
connections without a password. This is *not* recommended.
118+
119+
See PostgreSQL documentation about "trust":
119120
https://www.postgresql.org/docs/current/auth-trust.html
120121
EOE
121122
exit 1

9.6/alpine/docker-entrypoint.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ docker_init_database_dir() {
8888
}
8989

9090
# print large warning if POSTGRES_PASSWORD is long
91-
# error if both POSTGRES_PASSWORD is unset and POSTGRES_HOST_AUTH_METHOD is not 'trust'
91+
# error if both POSTGRES_PASSWORD is empty and POSTGRES_HOST_AUTH_METHOD is not 'trust'
9292
# print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
9393
# assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
9494
docker_verify_minimum_env() {
@@ -110,12 +110,13 @@ docker_verify_minimum_env() {
110110
# The - option suppresses leading tabs but *not* spaces. :)
111111
cat >&2 <<-'EOE'
112112
Error: Database is uninitialized and superuser password is not specified.
113-
You must specify POSTGRES_PASSWORD for the superuser. Use
114-
"-e POSTGRES_PASSWORD=password" to set it in "docker run".
113+
You must specify POSTGRES_PASSWORD to a non-empty value for the
114+
superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
115115
116-
You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections
117-
without a password. This is *not* recommended. See PostgreSQL
118-
documentation about "trust":
116+
You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
117+
connections without a password. This is *not* recommended.
118+
119+
See PostgreSQL documentation about "trust":
119120
https://www.postgresql.org/docs/current/auth-trust.html
120121
EOE
121122
exit 1

9.6/docker-entrypoint.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ docker_init_database_dir() {
8888
}
8989

9090
# print large warning if POSTGRES_PASSWORD is long
91-
# error if both POSTGRES_PASSWORD is unset and POSTGRES_HOST_AUTH_METHOD is not 'trust'
91+
# error if both POSTGRES_PASSWORD is empty and POSTGRES_HOST_AUTH_METHOD is not 'trust'
9292
# print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
9393
# assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
9494
docker_verify_minimum_env() {
@@ -110,12 +110,13 @@ docker_verify_minimum_env() {
110110
# The - option suppresses leading tabs but *not* spaces. :)
111111
cat >&2 <<-'EOE'
112112
Error: Database is uninitialized and superuser password is not specified.
113-
You must specify POSTGRES_PASSWORD for the superuser. Use
114-
"-e POSTGRES_PASSWORD=password" to set it in "docker run".
113+
You must specify POSTGRES_PASSWORD to a non-empty value for the
114+
superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
115115
116-
You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections
117-
without a password. This is *not* recommended. See PostgreSQL
118-
documentation about "trust":
116+
You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
117+
connections without a password. This is *not* recommended.
118+
119+
See PostgreSQL documentation about "trust":
119120
https://www.postgresql.org/docs/current/auth-trust.html
120121
EOE
121122
exit 1

docker-entrypoint.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ docker_init_database_dir() {
8888
}
8989

9090
# print large warning if POSTGRES_PASSWORD is long
91-
# error if both POSTGRES_PASSWORD is unset and POSTGRES_HOST_AUTH_METHOD is not 'trust'
91+
# error if both POSTGRES_PASSWORD is empty and POSTGRES_HOST_AUTH_METHOD is not 'trust'
9292
# print large warning if POSTGRES_HOST_AUTH_METHOD is set to 'trust'
9393
# assumes database is not set up, ie: [ -z "$DATABASE_ALREADY_EXISTS" ]
9494
docker_verify_minimum_env() {
@@ -110,12 +110,13 @@ docker_verify_minimum_env() {
110110
# The - option suppresses leading tabs but *not* spaces. :)
111111
cat >&2 <<-'EOE'
112112
Error: Database is uninitialized and superuser password is not specified.
113-
You must specify POSTGRES_PASSWORD for the superuser. Use
114-
"-e POSTGRES_PASSWORD=password" to set it in "docker run".
113+
You must specify POSTGRES_PASSWORD to a non-empty value for the
114+
superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run".
115115
116-
You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections
117-
without a password. This is *not* recommended. See PostgreSQL
118-
documentation about "trust":
116+
You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all
117+
connections without a password. This is *not* recommended.
118+
119+
See PostgreSQL documentation about "trust":
119120
https://www.postgresql.org/docs/current/auth-trust.html
120121
EOE
121122
exit 1

0 commit comments

Comments
 (0)