Merge pull request #5652 from KagurazakaNyaa/master
Allow user skip unbound healthcheck
This commit is contained in:
commit
3e02dcbb95
@ -1,5 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Skip Unbound (DNS Resolver) Healthchecks (NOT Recommended!)
|
||||||
|
if [[ "${SKIP_UNBOUND_HEALTHCHECK}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
|
||||||
|
SKIP_UNBOUND_HEALTHCHECK=y
|
||||||
|
fi
|
||||||
|
|
||||||
# Declare log function for logfile inside container
|
# Declare log function for logfile inside container
|
||||||
function log_to_file() {
|
function log_to_file() {
|
||||||
echo "$(date +"%Y-%m-%d %H:%M:%S"): $1" > /var/log/healthcheck.log
|
echo "$(date +"%Y-%m-%d %H:%M:%S"): $1" > /var/log/healthcheck.log
|
||||||
@ -66,6 +71,11 @@ function check_netcat() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [[ ${SKIP_UNBOUND_HEALTHCHECK} == "y" ]]; then
|
||||||
|
log_to_file "Healthcheck: ALL CHECKS WERE SKIPPED! Unbound is healthy!"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# run checks, if check is not returning 0 (return value if check is ok), healthcheck will exit with 1 (marked in docker as unhealthy)
|
# run checks, if check is not returning 0 (return value if check is ok), healthcheck will exit with 1 (marked in docker as unhealthy)
|
||||||
check_ping
|
check_ping
|
||||||
|
|
||||||
|
@ -2,9 +2,10 @@ version: '2.1'
|
|||||||
services:
|
services:
|
||||||
|
|
||||||
unbound-mailcow:
|
unbound-mailcow:
|
||||||
image: mailcow/unbound:1.19.1
|
image: mailcow/unbound:1.20
|
||||||
environment:
|
environment:
|
||||||
- TZ=${TZ}
|
- TZ=${TZ}
|
||||||
|
- SKIP_UNBOUND_HEALTHCHECK=${SKIP_UNBOUND_HEALTHCHECK:-n}
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/hooks/unbound:/hooks:Z
|
- ./data/hooks/unbound:/hooks:Z
|
||||||
- ./data/conf/unbound/unbound.conf:/etc/unbound/unbound.conf:ro,Z
|
- ./data/conf/unbound/unbound.conf:/etc/unbound/unbound.conf:ro,Z
|
||||||
|
@ -363,6 +363,10 @@ SKIP_IP_CHECK=n
|
|||||||
|
|
||||||
SKIP_HTTP_VERIFICATION=n
|
SKIP_HTTP_VERIFICATION=n
|
||||||
|
|
||||||
|
# Skip Unbound (DNS Resolver) Healthchecks (NOT Recommended!) - y/n
|
||||||
|
|
||||||
|
SKIP_UNBOUND_HEALTHCHECK=n
|
||||||
|
|
||||||
# Skip ClamAV (clamd-mailcow) anti-virus (Rspamd will auto-detect a missing ClamAV container) - y/n
|
# Skip ClamAV (clamd-mailcow) anti-virus (Rspamd will auto-detect a missing ClamAV container) - y/n
|
||||||
|
|
||||||
SKIP_CLAMD=${SKIP_CLAMD}
|
SKIP_CLAMD=${SKIP_CLAMD}
|
||||||
|
@ -480,6 +480,7 @@ CONFIG_ARRAY=(
|
|||||||
"WATCHDOG_VERBOSE"
|
"WATCHDOG_VERBOSE"
|
||||||
"WEBAUTHN_ONLY_TRUSTED_VENDORS"
|
"WEBAUTHN_ONLY_TRUSTED_VENDORS"
|
||||||
"SPAMHAUS_DQS_KEY"
|
"SPAMHAUS_DQS_KEY"
|
||||||
|
"SKIP_UNBOUND_HEALTHCHECK"
|
||||||
)
|
)
|
||||||
|
|
||||||
detect_bad_asn
|
detect_bad_asn
|
||||||
@ -747,6 +748,12 @@ for option in ${CONFIG_ARRAY[@]}; do
|
|||||||
echo '# Enable watchdog verbose logging' >> mailcow.conf
|
echo '# Enable watchdog verbose logging' >> mailcow.conf
|
||||||
echo 'WATCHDOG_VERBOSE=n' >> mailcow.conf
|
echo 'WATCHDOG_VERBOSE=n' >> mailcow.conf
|
||||||
fi
|
fi
|
||||||
|
elif [[ ${option} == "SKIP_UNBOUND_HEALTHCHECK" ]]; then
|
||||||
|
if ! grep -q ${option} mailcow.conf; then
|
||||||
|
echo "Adding new option \"${option}\" to mailcow.conf"
|
||||||
|
echo '# Skip Unbound (DNS Resolver) Healthchecks (NOT Recommended!) - y/n' >> mailcow.conf
|
||||||
|
echo 'SKIP_UNBOUND_HEALTHCHECK=n' >> mailcow.conf
|
||||||
|
fi
|
||||||
elif ! grep -q ${option} mailcow.conf; then
|
elif ! grep -q ${option} mailcow.conf; then
|
||||||
echo "Adding new option \"${option}\" to mailcow.conf"
|
echo "Adding new option \"${option}\" to mailcow.conf"
|
||||||
echo "${option}=n" >> mailcow.conf
|
echo "${option}=n" >> mailcow.conf
|
||||||
|
Loading…
Reference in New Issue
Block a user