Skip to content

Commit 31a6610

Browse files
authored
[bitnami/postgresql] Release 18.4.0-debian-12-r5 (#94397)
Signed-off-by: Bitnami Bot <bitnami.bot@broadcom.com>
1 parent ac6619b commit 31a6610

11 files changed

Lines changed: 53 additions & 12 deletions

bitnami/postgresql/18/debian-12/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ARG TARGETARCH
99
ARG WITH_ALL_LOCALES="no"
1010

1111
LABEL org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \
12-
org.opencontainers.image.created="2026-05-28T08:14:10Z" \
12+
org.opencontainers.image.created="2026-06-05T18:29:40Z" \
1313
org.opencontainers.image.description="Application packaged by Broadcom, Inc." \
1414
org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/postgresql/README.md" \
1515
org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/postgresql" \
@@ -31,7 +31,7 @@ RUN --mount=type=secret,id=downloads_url,env=SECRET_DOWNLOADS_URL \
3131
mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ || exit 1 ; \
3232
COMPONENTS=( \
3333
"nss-wrapper-1.1.16-0-linux-${OS_ARCH}-debian-12" \
34-
"postgresql-18.4.0-0-linux-${OS_ARCH}-debian-12" \
34+
"postgresql-18.4.0-1-linux-${OS_ARCH}-debian-12" \
3535
) ; \
3636
for COMPONENT in "${COMPONENTS[@]}"; do \
3737
if [ ! -f "${COMPONENT}.tar.gz" ]; then \
@@ -56,7 +56,7 @@ COPY rootfs /
5656
RUN /opt/bitnami/scripts/postgresql/postunpack.sh
5757
ENV APP_VERSION="18.4.0" \
5858
BITNAMI_APP_NAME="postgresql" \
59-
IMAGE_REVISION="4" \
59+
IMAGE_REVISION="5" \
6060
LANG="en_US.UTF-8" \
6161
LANGUAGE="en_US:en" \
6262
NSS_WRAPPER_LIB="/opt/bitnami/common/lib/libnss_wrapper.so" \

bitnami/postgresql/18/debian-12/prebuildfs/opt/bitnami/checksums/postgresql-18.4.0-0-linux-amd64-debian-12.tar.gz.sha256

Lines changed: 0 additions & 1 deletion
This file was deleted.

bitnami/postgresql/18/debian-12/prebuildfs/opt/bitnami/checksums/postgresql-18.4.0-0-linux-arm64-debian-12.tar.gz.sha256

Lines changed: 0 additions & 1 deletion
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
f899c1ed519370b9a04a32f672c5bcca52e180a4ade2fd787d248b122e50b028 postgresql-18.4.0-1-linux-amd64-debian-12.tar.gz
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4dce3513036f5aece69713f08c71ae3e27af7ebb34aa4dce39fa8a62f1a9153e postgresql-18.4.0-1-linux-arm64-debian-12.tar.gz

bitnami/postgresql/18/debian-12/prebuildfs/opt/bitnami/scripts/libos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ ensure_user_exists() {
170170
if [[ -n "$home" ]]; then
171171
mkdir -p "$home"
172172
usermod -d "$home" "$user" >/dev/null 2>&1
173-
configure_permissions_ownership "$home" -d "775" -f "664" -u "$user" -g "$group"
173+
configure_permissions_ownership "$home" -d "775" -f "664" -u "$user" -g "$group" -n
174174
fi
175175
}
176176

bitnami/postgresql/18/debian-12/prebuildfs/opt/bitnami/scripts/libvalidations.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#########################
2121
is_int() {
2222
local -r int="${1:?missing value}"
23-
if [[ "$int" =~ ^-?[0-9]+ ]]; then
23+
if [[ "$int" =~ ^-?[0-9]+$ ]]; then
2424
true
2525
else
2626
false

bitnami/postgresql/18/debian-12/prebuildfs/opt/bitnami/scripts/libversion.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,36 @@ get_sematic_version () {
4949
fi
5050
fi
5151
}
52+
53+
########################
54+
# Compares two semantic versions
55+
# Arguments:
56+
# $1 - version1: first version to compare
57+
# $2 - version2: second version to compare
58+
# Returns:
59+
# -1 if version1 is less than version2
60+
# 0 if version1 is equal to version2
61+
# 1 if version1 is greater than version2
62+
#########################
63+
compare_semantic_versions() {
64+
local version1="${1:?version1 is required}"
65+
local version2="${2:?version2 is required}"
66+
local major1 major2 minor1 minor2 patch1 patch2
67+
68+
major1="$(get_sematic_version "$version1" 1)"
69+
major2="$(get_sematic_version "$version2" 1)"
70+
minor1="$(get_sematic_version "$version1" 2)"
71+
minor2="$(get_sematic_version "$version2" 2)"
72+
patch1="$(get_sematic_version "$version1" 3)"
73+
patch2="$(get_sematic_version "$version2" 3)"
74+
75+
if [[ "$major1" -eq "$major2" ]] && [[ "$minor1" -eq "$minor2" ]] && [[ "$patch1" -eq "$patch2" ]]; then
76+
echo "0"
77+
elif [[ "$major1" -lt "$major2" ]] ||
78+
{ [[ "$major1" -eq "$major2" ]] && [[ "$minor1" -lt "$minor2" ]]; } ||
79+
{ [[ "$major1" -eq "$major2" ]] && [[ "$minor1" -eq "$minor2" ]] && [[ "$patch1" -lt "$patch2" ]]; }; then
80+
echo "-1"
81+
else
82+
echo "1"
83+
fi
84+
}

bitnami/postgresql/18/debian-12/rootfs/opt/bitnami/scripts/libpostgresql.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,25 @@ postgresql_validate() {
5555
error "$1"
5656
error_code=1
5757
}
58-
5958
check_multi_value() {
6059
if [[ " ${2} " != *" ${!1} "* ]]; then
6160
print_validation_error "The allowed values for ${1} are: ${2}"
6261
fi
6362
}
64-
6563
empty_password_enabled_warn() {
6664
warn "You set the environment variable ALLOW_EMPTY_PASSWORD=${ALLOW_EMPTY_PASSWORD}. For safety reasons, do not use this flag in a production environment."
6765
}
6866
empty_password_error() {
6967
print_validation_error "The $1 environment variable is empty or not set. Set the environment variable ALLOW_EMPTY_PASSWORD=yes to allow the container to be started with blank passwords. This is recommended only for development."
7068
}
69+
70+
check_multi_value "POSTGRESQL_PGHBA_AUTH_METHOD" "md5 scram-sha-256"
7171
if is_boolean_yes "$ALLOW_EMPTY_PASSWORD"; then
7272
empty_password_enabled_warn
7373
else
74+
if [[ "$POSTGRESQL_PGHBA_AUTH_METHOD" = "md5" ]]; then
75+
warn "POSTGRESQL_AUTH_METHOD is 'md5': md5 format is vulnerable to pass-the-hash attacks. Please consider using 'scram-sha-256' instead."
76+
fi
7477
if [[ -z "$POSTGRESQL_PASSWORD" ]]; then
7578
empty_password_error "POSTGRESQL_PASSWORD"
7679
fi
@@ -333,7 +336,7 @@ EOF
333336
#########################
334337
postgresql_restrict_pghba() {
335338
if [[ -n "$POSTGRESQL_PASSWORD" ]]; then
336-
replace_in_file "$POSTGRESQL_PGHBA_FILE" "trust" "md5" false
339+
replace_in_file "$POSTGRESQL_PGHBA_FILE" "trust" "$POSTGRESQL_PGHBA_AUTH_METHOD" false
337340
fi
338341
}
339342

@@ -349,7 +352,7 @@ postgresql_restrict_pghba() {
349352
postgresql_add_replication_to_pghba() {
350353
local replication_auth="trust"
351354
if [[ -n "$POSTGRESQL_REPLICATION_PASSWORD" ]]; then
352-
replication_auth="md5"
355+
replication_auth="$POSTGRESQL_PGHBA_AUTH_METHOD"
353356
fi
354357
cat <<EOF >>"$POSTGRESQL_PGHBA_FILE"
355358
host replication all 0.0.0.0/0 ${replication_auth}
@@ -369,7 +372,7 @@ EOF
369372
postgresql_add_sr_check_user_to_pghba() {
370373
local sr_check_auth="trust"
371374
if [[ -n "$POSTGRESQL_SR_CHECK_PASSWORD" ]]; then
372-
sr_check_auth="md5"
375+
sr_check_auth="$POSTGRESQL_PGHBA_AUTH_METHOD"
373376
fi
374377
cat <<EOF >>"$POSTGRESQL_PGHBA_FILE"
375378
host $POSTGRESQL_SR_CHECK_DATABASE $POSTGRESQL_SR_CHECK_USERNAME 0.0.0.0/0 ${sr_check_auth}

bitnami/postgresql/18/debian-12/rootfs/opt/bitnami/scripts/postgresql-env.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ postgresql_env_vars=(
9494
POSTGRESQL_TCP_KEEPALIVES_INTERVAL
9595
POSTGRESQL_TCP_KEEPALIVES_COUNT
9696
POSTGRESQL_STATEMENT_TIMEOUT
97+
POSTGRESQL_PGHBA_AUTH_METHOD
9798
POSTGRESQL_PGHBA_REMOVE_FILTERS
9899
POSTGRESQL_USERNAME_CONNECTION_LIMIT
99100
POSTGRESQL_POSTGRES_CONNECTION_LIMIT
@@ -168,6 +169,7 @@ postgresql_env_vars=(
168169
POSTGRES_TCP_KEEPALIVES_INTERVAL
169170
POSTGRES_TCP_KEEPALIVES_COUNT
170171
POSTGRES_STATEMENT_TIMEOUT
172+
POSTGRES_PGHBA_AUTH_METHOD
171173
POSTGRES_PGHBA_REMOVE_FILTERS
172174
POSTGRES_USER_CONNECTION_LIMIT
173175
POSTGRES_POSTGRES_CONNECTION_LIMIT
@@ -342,6 +344,8 @@ POSTGRESQL_TCP_KEEPALIVES_COUNT="${POSTGRESQL_TCP_KEEPALIVES_COUNT:-"${POSTGRES_
342344
export POSTGRESQL_TCP_KEEPALIVES_COUNT="${POSTGRESQL_TCP_KEEPALIVES_COUNT:-}"
343345
POSTGRESQL_STATEMENT_TIMEOUT="${POSTGRESQL_STATEMENT_TIMEOUT:-"${POSTGRES_STATEMENT_TIMEOUT:-}"}"
344346
export POSTGRESQL_STATEMENT_TIMEOUT="${POSTGRESQL_STATEMENT_TIMEOUT:-}"
347+
POSTGRESQL_PGHBA_AUTH_METHOD="${POSTGRESQL_PGHBA_AUTH_METHOD:-"${POSTGRES_PGHBA_AUTH_METHOD:-}"}"
348+
export POSTGRESQL_PGHBA_AUTH_METHOD="${POSTGRESQL_PGHBA_AUTH_METHOD:-md5}"
345349
POSTGRESQL_PGHBA_REMOVE_FILTERS="${POSTGRESQL_PGHBA_REMOVE_FILTERS:-"${POSTGRES_PGHBA_REMOVE_FILTERS:-}"}"
346350
export POSTGRESQL_PGHBA_REMOVE_FILTERS="${POSTGRESQL_PGHBA_REMOVE_FILTERS:-}"
347351
POSTGRESQL_USERNAME_CONNECTION_LIMIT="${POSTGRESQL_USERNAME_CONNECTION_LIMIT:-"${POSTGRES_USER_CONNECTION_LIMIT:-}"}"

0 commit comments

Comments
 (0)