fix(backup): send host backup notifications over HTTPS when the Monitor uses it

This commit is contained in:
MacRimi
2026-10-06 17:26:55 +02:00
parent c6b2b74bf0
commit b4f4d98e85
3 changed files with 70 additions and 3 deletions
@@ -3420,11 +3420,16 @@ Log: ${HB_NOTIFY_LOG_FILE:-}"
log_file:$log, reason:$reason}}' \
2>/dev/null)
[[ -z "$payload" ]] && return 0
# The Monitor answers on the same port over HTTPS once it has a certificate.
local scheme="http"
[[ -f /etc/proxmenux/ssl_config.json ]] && \
jq -e '.enabled' /etc/proxmenux/ssl_config.json >/dev/null 2>&1 && \
scheme="https"
curl -sk --connect-timeout 3 --max-time 5 \
-X POST \
-H "Content-Type: application/json" \
-d "$payload" \
http://127.0.0.1:8008/api/notifications/webhook \
"${scheme}://127.0.0.1:8008/api/notifications/webhook" \
>/dev/null 2>&1 || true
}