diff --git a/bitnami/postgresql/17/debian-12/Dockerfile b/bitnami/postgresql/17/debian-12/Dockerfile index f5f25c552850..03fbd03315c6 100644 --- a/bitnami/postgresql/17/debian-12/Dockerfile +++ b/bitnami/postgresql/17/debian-12/Dockerfile @@ -10,11 +10,11 @@ ARG WITH_ALL_LOCALES="no" LABEL com.vmware.cp.artifact.flavor="sha256:c50c90cfd9d12b445b011e6ad529f1ad3daea45c26d20b00732fae3cd71f6a83" \ org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \ - org.opencontainers.image.created="2024-11-27T09:41:42Z" \ + org.opencontainers.image.created="2024-12-03T14:22:48Z" \ org.opencontainers.image.description="Application packaged by Broadcom, Inc." \ org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/postgresql/README.md" \ org.opencontainers.image.licenses="Apache-2.0" \ - org.opencontainers.image.ref.name="17.2.0-debian-12-r1" \ + org.opencontainers.image.ref.name="17.2.0-debian-12-r2" \ org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/postgresql" \ org.opencontainers.image.title="postgresql" \ org.opencontainers.image.vendor="Broadcom, Inc." \ diff --git a/bitnami/postgresql/17/debian-12/rootfs/opt/bitnami/scripts/libpostgresql.sh b/bitnami/postgresql/17/debian-12/rootfs/opt/bitnami/scripts/libpostgresql.sh index ac1a25156502..74e19f4b9660 100644 --- a/bitnami/postgresql/17/debian-12/rootfs/opt/bitnami/scripts/libpostgresql.sh +++ b/bitnami/postgresql/17/debian-12/rootfs/opt/bitnami/scripts/libpostgresql.sh @@ -612,7 +612,7 @@ postgresql_initialize() { create_conf_file=no fi - if postgresql_is_file_external "pg_hba.conf"; then + if postgresql_is_file_external "pg_hba.conf" && is_boolean_yes "$POSTGRESQL_USE_CUSTOM_PGHBA_INITIALIZATION"; then info "Custom configuration $POSTGRESQL_PGHBA_FILE detected" create_pghba_file=no fi diff --git a/bitnami/postgresql/17/debian-12/rootfs/opt/bitnami/scripts/postgresql-env.sh b/bitnami/postgresql/17/debian-12/rootfs/opt/bitnami/scripts/postgresql-env.sh index 6c491a2007fc..3a6cf2804f99 100644 --- a/bitnami/postgresql/17/debian-12/rootfs/opt/bitnami/scripts/postgresql-env.sh +++ b/bitnami/postgresql/17/debian-12/rootfs/opt/bitnami/scripts/postgresql-env.sh @@ -334,6 +334,7 @@ export POSTGRESQL_WAL_LEVEL="${POSTGRESQL_WAL_LEVEL:-replica}" export POSTGRESQL_DEFAULT_TOAST_COMPRESSION="${POSTGRESQL_DEFAULT_TOAST_COMPRESSION:-}" export POSTGRESQL_PASSWORD_ENCRYPTION="${POSTGRESQL_PASSWORD_ENCRYPTION:-}" export POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION="${POSTGRESQL_DEFAULT_TRANSACTION_ISOLATION:-}" +export POSTGRESQL_USE_CUSTOM_PGHBA_INITIALIZATION="no" # pgAutoFailover settings export POSTGRESQL_AUTOCTL_VOLUME_DIR="${POSTGRESQL_VOLUME_DIR}/pgautoctl" diff --git a/bitnami/postgresql/17/debian-12/rootfs/opt/bitnami/scripts/postgresql/setup.sh b/bitnami/postgresql/17/debian-12/rootfs/opt/bitnami/scripts/postgresql/setup.sh index 3b6902995984..4539d0131579 100755 --- a/bitnami/postgresql/17/debian-12/rootfs/opt/bitnami/scripts/postgresql/setup.sh +++ b/bitnami/postgresql/17/debian-12/rootfs/opt/bitnami/scripts/postgresql/setup.sh @@ -47,3 +47,9 @@ if ! postgresql_is_file_external "pg_hba.conf" && [[ -n "$POSTGRESQL_PGHBA_REMOV info "Removing lines that match these filters: ${POSTGRESQL_PGHBA_REMOVE_FILTERS}" postgresql_remove_pghba_lines fi + +# Set custom pg_hba.conf after initialization to avoid conflicts +if postgresql_is_file_external "pg_hba.conf"; then + info "Applying custom $POSTGRESQL_PGHBA_FILE" + cp -f "$POSTGRESQL_MOUNTED_CONF_DIR"/pg_hba.conf "$POSTGRESQL_CONF_DIR" +fi \ No newline at end of file