* fix unreported bug with mismatch values in pg_hba.conf and fix health check test
pull/398/head
mazano 2022-12-02 13:44:07 +02:00 zatwierdzone przez GitHub
rodzic 3a49b1513a
commit d4ad04e57f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
4 zmienionych plików z 12 dodań i 2 usunięć

Wyświetl plik

@ -23,7 +23,7 @@ services:
- "5432"
restart: on-failure
healthcheck:
test: "exit 0"
test: "PGPASSWORD=docker pg_isready -h 127.0.0.1 -U docker -d gis"
dbbackups:
image: kartoza/pg-backup:15-3.3

Wyświetl plik

@ -418,7 +418,7 @@ function restart_postgres {
function entry_point_script {
SETUP_LOCKFILE="${SCRIPTS_LOCKFILE_DIR}/.entry_point.lock"
# If lockfile doesn't exists, proceed.
if [[ ! -f "${SETUP_LOCKFILE}" ]] || [ "${IGNORE_INIT_HOOK_LOCKFILE}" =~ [Tt][Rr][Uu][Ee] ]; then
if [[ ! -f "${SETUP_LOCKFILE}" ]] || [[ "${IGNORE_INIT_HOOK_LOCKFILE}" =~ [Tt][Rr][Uu][Ee] ]]; then
if find "/docker-entrypoint-initdb.d" -mindepth 1 -print -quit 2>/dev/null | grep -q .; then
for f in /docker-entrypoint-initdb.d/*; do
export PGPASSWORD=${POSTGRES_PASS}

Wyświetl plik

@ -81,4 +81,6 @@ if [[ -z "$REPLICATE_FROM" ]]; then
fi
# Put lock file to make sure conf was not reinitialized
export PASSWORD_AUTHENTICATION
envsubst < $ROOT_CONF/pg_hba.conf > /tmp/pg_hba.conf && mv /tmp/pg_hba.conf $ROOT_CONF/pg_hba.conf
touch ${SETUP_LOCKFILE}

Wyświetl plik

@ -7,4 +7,12 @@ source /scripts/env-data.sh
# Create backup template for conf
cat $CONF > $CONF.template
# Create backup template for pg_hba.conf
sed -i 's/scram-sha-256/${PASSWORD_AUTHENTICATION}/g' $ROOT_CONF/pg_hba.conf
sed -i 's/md5/${PASSWORD_AUTHENTICATION}/g' $ROOT_CONF/pg_hba.conf
cat $ROOT_CONF/pg_hba.conf > $ROOT_CONF/pg_hba.conf.template