Fixed usage Vault DB credentials with server and proxy

This commit is contained in:
Alexey Pustovalov
2025-03-13 15:24:12 +09:00
parent d9888ffc48
commit 435e92fdbc
15 changed files with 165 additions and 30 deletions

View File

@ -364,8 +364,17 @@ update_zbx_config() {
export ZBX_DB_SOCKET="${DB_SERVER_SOCKET}"
export ZBX_DB_NAME="${DB_SERVER_DBNAME}"
export ZBX_DB_USER="${DB_SERVER_ZBX_USER}"
export ZBX_DB_PASSWORD="${DB_SERVER_ZBX_PASS}"
if [ -n "${ZBX_VAULT}" ] && [ -n "${ZBX_VAULTURL}" ] && [ ! -n "${ZBX_VAULTDBPATH}" ]; then
export ZBX_DB_USER="${DB_SERVER_ZBX_USER}"
export ZBX_DB_PASSWORD="${DB_SERVER_ZBX_PASS}"
elif [ ! -n "${ZBX_VAULT}" ] && [ ! -n "${ZBX_VAULTURL}" ]; then
export ZBX_DB_USER="${DB_SERVER_ZBX_USER}"
export ZBX_DB_PASSWORD="${DB_SERVER_ZBX_PASS}"
else
unset ZBX_DB_USER
unset ZBX_DB_PASSWORD
fi
: ${ZBX_ENABLE_SNMP_TRAPS:="false"}
[[ "${ZBX_ENABLE_SNMP_TRAPS,,}" == "true" ]] && export ZBX_STARTSNMPTRAPPER=1