From 833e8038c77c906675c2d3fc701d404d29869736 Mon Sep 17 00:00:00 2001 From: aptalca <541623+aptalca@users.noreply.github.com> Date: Wed, 29 May 2024 20:56:53 -0400 Subject: [PATCH] add `::1` to trusted proxies as well --- .../s6-rc.d/svc-mod-nextcloud-notify-push/run | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/svc-mod-nextcloud-notify-push/run b/root/etc/s6-overlay/s6-rc.d/svc-mod-nextcloud-notify-push/run index d5a332f..955f50b 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-mod-nextcloud-notify-push/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-mod-nextcloud-notify-push/run @@ -32,14 +32,16 @@ if [ ! -f "$NOTIFY_PUSH_BIN" ]; then fi # add to trusted proxies -if ! occ config:system:get trusted_proxies | grep -q "127.0.0.1"; then - NO_OF_PROXIES=$(occ config:system:get trusted_proxies --output=json | jq 'length') - if [[ -z "${NO_OF_PROXIES}" ]]; then - NO_OF_PROXIES="0" +for PROXY in '127.0.0.1' '::1'; do + if ! occ config:system:get trusted_proxies | grep -q "${PROXY}"; then + NO_OF_PROXIES=$(occ config:system:get trusted_proxies --output=json | jq 'length') + if [[ -z "${NO_OF_PROXIES}" ]]; then + NO_OF_PROXIES="0" + fi + echo "**** Adding notify_push (${PROXY}) to trusted proxies ****" + occ config:system:set trusted_proxies "${NO_OF_PROXIES}" --value="${PROXY}" fi - echo "**** Adding notify_push to trusted proxies ****" - occ config:system:set trusted_proxies "${NO_OF_PROXIES}" --value=127.0.0.1 -fi +done # run notify-push binary echo "**** Starting notify-push ****"