mirror of
https://github.com/zabbix/zabbix-docker.git
synced 2025-08-09 08:35:05 +02:00
Using env variables for certs
This commit is contained in:
@ -171,17 +171,23 @@ check_db_connect() {
|
||||
fi
|
||||
|
||||
if [ -n "${ZBX_DBTLSCONNECT}" ]; then
|
||||
dbtlsconnect=${ZBX_DBTLSCONNECT//_/-}
|
||||
ssl_opts="sslmode=$dbtlsconnect sslrootcert=${ZBX_DBTLSCAFILE} sslcert=${ZBX_DBTLSCERTFILE} sslkey=${ZBX_DBTLSKEYFILE}"
|
||||
export PGSSLMODE=${ZBX_DBTLSCONNECT//_/-}
|
||||
export PGSSLROOTCERT=${ZBX_DBTLSCAFILE}
|
||||
export PGSSLCERT=${ZBX_DBTLSCERTFILE}
|
||||
export PGSSLKEY=${ZBX_DBTLSKEYFILE}
|
||||
fi
|
||||
|
||||
while [ ! "$(psql "$ssl_opts" --host ${DB_SERVER_HOST} --port ${DB_SERVER_PORT} --username ${DB_SERVER_ROOT_USER} --dbname ${DB_SERVER_DBNAME} --list --quiet 2>/dev/null)" ]; do
|
||||
while [ ! "$(psql --host ${DB_SERVER_HOST} --port ${DB_SERVER_PORT} --username ${DB_SERVER_ROOT_USER} --dbname ${DB_SERVER_DBNAME} --list --quiet 2>/dev/null)" ]; do
|
||||
echo "**** PostgreSQL server is not available. Waiting $WAIT_TIMEOUT seconds..."
|
||||
sleep $WAIT_TIMEOUT
|
||||
done
|
||||
|
||||
unset PGPASSWORD
|
||||
unset PGOPTIONS
|
||||
unset PGSSLMODE
|
||||
unset PGSSLROOTCERT
|
||||
unset PGSSLCERT
|
||||
unset PGSSLKEY
|
||||
}
|
||||
|
||||
prepare_web_server() {
|
||||
|
Reference in New Issue
Block a user