diff --git a/bitnami/postgresql/14/debian-12/Dockerfile b/bitnami/postgresql/14/debian-12/Dockerfile index ae9b79376281..b4cb2dbcf12d 100644 --- a/bitnami/postgresql/14/debian-12/Dockerfile +++ b/bitnami/postgresql/14/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:34:05Z" \ + org.opencontainers.image.created="2024-12-03T11:50:01Z" \ 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="14.15.0-debian-12-r1" \ + org.opencontainers.image.ref.name="14.15.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/14/debian-12/rootfs/opt/bitnami/scripts/libpostgresql.sh b/bitnami/postgresql/14/debian-12/rootfs/opt/bitnami/scripts/libpostgresql.sh index ac1a25156502..74e19f4b9660 100644 --- a/bitnami/postgresql/14/debian-12/rootfs/opt/bitnami/scripts/libpostgresql.sh +++ b/bitnami/postgresql/14/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/14/debian-12/rootfs/opt/bitnami/scripts/postgresql-env.sh b/bitnami/postgresql/14/debian-12/rootfs/opt/bitnami/scripts/postgresql-env.sh index 6c491a2007fc..3a6cf2804f99 100644 --- a/bitnami/postgresql/14/debian-12/rootfs/opt/bitnami/scripts/postgresql-env.sh +++ b/bitnami/postgresql/14/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/14/debian-12/rootfs/opt/bitnami/scripts/postgresql/setup.sh b/bitnami/postgresql/14/debian-12/rootfs/opt/bitnami/scripts/postgresql/setup.sh index 3b6902995984..4539d0131579 100755 --- a/bitnami/postgresql/14/debian-12/rootfs/opt/bitnami/scripts/postgresql/setup.sh +++ b/bitnami/postgresql/14/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 diff --git a/bitnami/postgresql/README.md b/bitnami/postgresql/README.md index 249ddea200ff..6bc5eab282d3 100644 --- a/bitnami/postgresql/README.md +++ b/bitnami/postgresql/README.md @@ -246,32 +246,33 @@ docker-compose up -d #### Read-only environment variables -| Name | Description | Value | -|-------------------------------------|--------------------------------------------|-----------------------------------------------| -| `POSTGRESQL_BASE_DIR` | PostgreSQL installation directory | `/opt/bitnami/postgresql` | -| `POSTGRESQL_DEFAULT_CONF_DIR` | PostgreSQL configuration directory | `$POSTGRESQL_BASE_DIR/conf.default` | -| `POSTGRESQL_CONF_DIR` | PostgreSQL configuration directory | `$POSTGRESQL_BASE_DIR/conf` | -| `POSTGRESQL_MOUNTED_CONF_DIR` | PostgreSQL mounted configuration directory | `$POSTGRESQL_VOLUME_DIR/conf` | -| `POSTGRESQL_CONF_FILE` | PostgreSQL configuration file | `$POSTGRESQL_CONF_DIR/postgresql.conf` | -| `POSTGRESQL_PGHBA_FILE` | PostgreSQL pg_hba file | `$POSTGRESQL_CONF_DIR/pg_hba.conf` | -| `POSTGRESQL_RECOVERY_FILE` | PostgreSQL recovery file | `$POSTGRESQL_DATA_DIR/recovery.conf` | -| `POSTGRESQL_LOG_DIR` | PostgreSQL logs directory | `$POSTGRESQL_BASE_DIR/logs` | -| `POSTGRESQL_LOG_FILE` | PostgreSQL log file | `$POSTGRESQL_LOG_DIR/postgresql.log` | -| `POSTGRESQL_TMP_DIR` | PostgreSQL temporary directory | `$POSTGRESQL_BASE_DIR/tmp` | -| `POSTGRESQL_PID_FILE` | PostgreSQL PID file | `$POSTGRESQL_TMP_DIR/postgresql.pid` | -| `POSTGRESQL_BIN_DIR` | PostgreSQL executables directory | `$POSTGRESQL_BASE_DIR/bin` | -| `POSTGRESQL_INITSCRIPTS_DIR` | Init scripts directory | `/docker-entrypoint-initdb.d` | -| `POSTGRESQL_PREINITSCRIPTS_DIR` | Pre-init scripts directory | `/docker-entrypoint-preinitdb.d` | -| `POSTGRESQL_DAEMON_USER` | PostgreSQL system user | `postgres` | -| `POSTGRESQL_DAEMON_GROUP` | PostgreSQL system group | `postgres` | -| `POSTGRESQL_AUTOCTL_VOLUME_DIR` | The pg_autoctl home directory | `${POSTGRESQL_VOLUME_DIR}/pgautoctl` | -| `POSTGRESQL_PGBACKREST_VOLUME_DIR` | The pgbackrest home directory | `${POSTGRESQL_VOLUME_DIR}/pgbackrest` | -| `POSTGRESQL_PGBACKREST_LOGS_DIR` | The pgbackrest logs directory | `${POSTGRESQL_PGBACKREST_VOLUME_DIR}/logs` | -| `POSTGRESQL_PGBACKREST_BACKUPS_DIR` | The pgbackrest backups directory | `${POSTGRESQL_PGBACKREST_VOLUME_DIR}/backups` | -| `POSTGRESQL_PGBACKREST_SPOOL_DIR` | The pgbackrest spool directory | `${POSTGRESQL_PGBACKREST_VOLUME_DIR}/spool` | -| `POSTGRESQL_PGBACKREST_CONF_FILE` | The pgbackrest configuration file | `${POSTGRESQL_DATA_DIR}/pgbackrest.conf` | -| `POSTGRESQL_FIRST_BOOT` | Flag for startup (necessary for repmgr) | `yes` | -| `NSS_WRAPPER_LIB` | Flag for startup (necessary for repmgr) | `/opt/bitnami/common/lib/libnss_wrapper.so` | +| Name | Description | Value | +|----------------------------------------------|-----------------------------------------------------------------|-----------------------------------------------| +| `POSTGRESQL_BASE_DIR` | PostgreSQL installation directory | `/opt/bitnami/postgresql` | +| `POSTGRESQL_DEFAULT_CONF_DIR` | PostgreSQL configuration directory | `$POSTGRESQL_BASE_DIR/conf.default` | +| `POSTGRESQL_CONF_DIR` | PostgreSQL configuration directory | `$POSTGRESQL_BASE_DIR/conf` | +| `POSTGRESQL_MOUNTED_CONF_DIR` | PostgreSQL mounted configuration directory | `$POSTGRESQL_VOLUME_DIR/conf` | +| `POSTGRESQL_CONF_FILE` | PostgreSQL configuration file | `$POSTGRESQL_CONF_DIR/postgresql.conf` | +| `POSTGRESQL_PGHBA_FILE` | PostgreSQL pg_hba file | `$POSTGRESQL_CONF_DIR/pg_hba.conf` | +| `POSTGRESQL_RECOVERY_FILE` | PostgreSQL recovery file | `$POSTGRESQL_DATA_DIR/recovery.conf` | +| `POSTGRESQL_LOG_DIR` | PostgreSQL logs directory | `$POSTGRESQL_BASE_DIR/logs` | +| `POSTGRESQL_LOG_FILE` | PostgreSQL log file | `$POSTGRESQL_LOG_DIR/postgresql.log` | +| `POSTGRESQL_TMP_DIR` | PostgreSQL temporary directory | `$POSTGRESQL_BASE_DIR/tmp` | +| `POSTGRESQL_PID_FILE` | PostgreSQL PID file | `$POSTGRESQL_TMP_DIR/postgresql.pid` | +| `POSTGRESQL_BIN_DIR` | PostgreSQL executables directory | `$POSTGRESQL_BASE_DIR/bin` | +| `POSTGRESQL_INITSCRIPTS_DIR` | Init scripts directory | `/docker-entrypoint-initdb.d` | +| `POSTGRESQL_PREINITSCRIPTS_DIR` | Pre-init scripts directory | `/docker-entrypoint-preinitdb.d` | +| `POSTGRESQL_DAEMON_USER` | PostgreSQL system user | `postgres` | +| `POSTGRESQL_DAEMON_GROUP` | PostgreSQL system group | `postgres` | +| `POSTGRESQL_USE_CUSTOM_PGHBA_INITIALIZATION` | Initialize PostgreSQL with the custom, mounted pg_hba.conf file | `no` | +| `POSTGRESQL_AUTOCTL_VOLUME_DIR` | The pg_autoctl home directory | `${POSTGRESQL_VOLUME_DIR}/pgautoctl` | +| `POSTGRESQL_PGBACKREST_VOLUME_DIR` | The pgbackrest home directory | `${POSTGRESQL_VOLUME_DIR}/pgbackrest` | +| `POSTGRESQL_PGBACKREST_LOGS_DIR` | The pgbackrest logs directory | `${POSTGRESQL_PGBACKREST_VOLUME_DIR}/logs` | +| `POSTGRESQL_PGBACKREST_BACKUPS_DIR` | The pgbackrest backups directory | `${POSTGRESQL_PGBACKREST_VOLUME_DIR}/backups` | +| `POSTGRESQL_PGBACKREST_SPOOL_DIR` | The pgbackrest spool directory | `${POSTGRESQL_PGBACKREST_VOLUME_DIR}/spool` | +| `POSTGRESQL_PGBACKREST_CONF_FILE` | The pgbackrest configuration file | `${POSTGRESQL_DATA_DIR}/pgbackrest.conf` | +| `POSTGRESQL_FIRST_BOOT` | Flag for startup (necessary for repmgr) | `yes` | +| `NSS_WRAPPER_LIB` | Flag for startup (necessary for repmgr) | `/opt/bitnami/common/lib/libnss_wrapper.so` | ### On container start