From 80ab39399840b2f28b01c4f885eaa85f53f2abc9 Mon Sep 17 00:00:00 2001 From: Armin Friedl Date: Mon, 4 Nov 2019 16:05:00 +0100 Subject: [PATCH] Add trusted proxies configuration by env var Solves #800 for external proxy Signed-off-by: Armin Friedl --- 15.0-rc/apache/entrypoint.sh | 9 +++++++++ 15.0-rc/fpm-alpine/entrypoint.sh | 9 +++++++++ 15.0-rc/fpm/entrypoint.sh | 9 +++++++++ 15.0/apache/entrypoint.sh | 9 +++++++++ 15.0/fpm-alpine/entrypoint.sh | 9 +++++++++ 15.0/fpm/entrypoint.sh | 9 +++++++++ 16.0-rc/apache/entrypoint.sh | 9 +++++++++ 16.0-rc/fpm-alpine/entrypoint.sh | 9 +++++++++ 16.0-rc/fpm/entrypoint.sh | 9 +++++++++ 16.0/apache/entrypoint.sh | 9 +++++++++ 16.0/fpm-alpine/entrypoint.sh | 9 +++++++++ 16.0/fpm/entrypoint.sh | 9 +++++++++ 17.0-rc/apache/entrypoint.sh | 9 +++++++++ 17.0-rc/fpm-alpine/entrypoint.sh | 9 +++++++++ 17.0-rc/fpm/entrypoint.sh | 9 +++++++++ 17.0/apache/entrypoint.sh | 9 +++++++++ 17.0/fpm-alpine/entrypoint.sh | 9 +++++++++ 17.0/fpm/entrypoint.sh | 9 +++++++++ docker-entrypoint.sh | 9 +++++++++ 19 files changed, 171 insertions(+) diff --git a/15.0-rc/apache/entrypoint.sh b/15.0-rc/apache/entrypoint.sh index 9514d881..d30b94e1 100755 --- a/15.0-rc/apache/entrypoint.sh +++ b/15.0-rc/apache/entrypoint.sh @@ -125,6 +125,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) done fi + if [ -n "${NEXTCLOUD_TRUSTED_PROXIES+x}" ]; then + echo "setting trusted proxies…" + NC_TRUSTED_PROXIES_IDX=1 + for PROXY in $NEXTCLOUD_TRUSTED_PROXIES ; do + PROXY=$(echo "$PROXY" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_proxies $NC_TRUSTED_PROXIES_IDX --value=$PROXY" + NC_TRUSTED_PROXIES_IDX=$(($NC_TRUSTED_PROXIES_IDX+1)) + done + fi else echo "running web-based installer on first connect!" fi diff --git a/15.0-rc/fpm-alpine/entrypoint.sh b/15.0-rc/fpm-alpine/entrypoint.sh index 9514d881..d30b94e1 100755 --- a/15.0-rc/fpm-alpine/entrypoint.sh +++ b/15.0-rc/fpm-alpine/entrypoint.sh @@ -125,6 +125,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) done fi + if [ -n "${NEXTCLOUD_TRUSTED_PROXIES+x}" ]; then + echo "setting trusted proxies…" + NC_TRUSTED_PROXIES_IDX=1 + for PROXY in $NEXTCLOUD_TRUSTED_PROXIES ; do + PROXY=$(echo "$PROXY" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_proxies $NC_TRUSTED_PROXIES_IDX --value=$PROXY" + NC_TRUSTED_PROXIES_IDX=$(($NC_TRUSTED_PROXIES_IDX+1)) + done + fi else echo "running web-based installer on first connect!" fi diff --git a/15.0-rc/fpm/entrypoint.sh b/15.0-rc/fpm/entrypoint.sh index 9514d881..d30b94e1 100755 --- a/15.0-rc/fpm/entrypoint.sh +++ b/15.0-rc/fpm/entrypoint.sh @@ -125,6 +125,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) done fi + if [ -n "${NEXTCLOUD_TRUSTED_PROXIES+x}" ]; then + echo "setting trusted proxies…" + NC_TRUSTED_PROXIES_IDX=1 + for PROXY in $NEXTCLOUD_TRUSTED_PROXIES ; do + PROXY=$(echo "$PROXY" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_proxies $NC_TRUSTED_PROXIES_IDX --value=$PROXY" + NC_TRUSTED_PROXIES_IDX=$(($NC_TRUSTED_PROXIES_IDX+1)) + done + fi else echo "running web-based installer on first connect!" fi diff --git a/15.0/apache/entrypoint.sh b/15.0/apache/entrypoint.sh index 9514d881..d30b94e1 100755 --- a/15.0/apache/entrypoint.sh +++ b/15.0/apache/entrypoint.sh @@ -125,6 +125,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) done fi + if [ -n "${NEXTCLOUD_TRUSTED_PROXIES+x}" ]; then + echo "setting trusted proxies…" + NC_TRUSTED_PROXIES_IDX=1 + for PROXY in $NEXTCLOUD_TRUSTED_PROXIES ; do + PROXY=$(echo "$PROXY" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_proxies $NC_TRUSTED_PROXIES_IDX --value=$PROXY" + NC_TRUSTED_PROXIES_IDX=$(($NC_TRUSTED_PROXIES_IDX+1)) + done + fi else echo "running web-based installer on first connect!" fi diff --git a/15.0/fpm-alpine/entrypoint.sh b/15.0/fpm-alpine/entrypoint.sh index 9514d881..d30b94e1 100755 --- a/15.0/fpm-alpine/entrypoint.sh +++ b/15.0/fpm-alpine/entrypoint.sh @@ -125,6 +125,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) done fi + if [ -n "${NEXTCLOUD_TRUSTED_PROXIES+x}" ]; then + echo "setting trusted proxies…" + NC_TRUSTED_PROXIES_IDX=1 + for PROXY in $NEXTCLOUD_TRUSTED_PROXIES ; do + PROXY=$(echo "$PROXY" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_proxies $NC_TRUSTED_PROXIES_IDX --value=$PROXY" + NC_TRUSTED_PROXIES_IDX=$(($NC_TRUSTED_PROXIES_IDX+1)) + done + fi else echo "running web-based installer on first connect!" fi diff --git a/15.0/fpm/entrypoint.sh b/15.0/fpm/entrypoint.sh index 9514d881..d30b94e1 100755 --- a/15.0/fpm/entrypoint.sh +++ b/15.0/fpm/entrypoint.sh @@ -125,6 +125,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) done fi + if [ -n "${NEXTCLOUD_TRUSTED_PROXIES+x}" ]; then + echo "setting trusted proxies…" + NC_TRUSTED_PROXIES_IDX=1 + for PROXY in $NEXTCLOUD_TRUSTED_PROXIES ; do + PROXY=$(echo "$PROXY" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_proxies $NC_TRUSTED_PROXIES_IDX --value=$PROXY" + NC_TRUSTED_PROXIES_IDX=$(($NC_TRUSTED_PROXIES_IDX+1)) + done + fi else echo "running web-based installer on first connect!" fi diff --git a/16.0-rc/apache/entrypoint.sh b/16.0-rc/apache/entrypoint.sh index 9514d881..d30b94e1 100755 --- a/16.0-rc/apache/entrypoint.sh +++ b/16.0-rc/apache/entrypoint.sh @@ -125,6 +125,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) done fi + if [ -n "${NEXTCLOUD_TRUSTED_PROXIES+x}" ]; then + echo "setting trusted proxies…" + NC_TRUSTED_PROXIES_IDX=1 + for PROXY in $NEXTCLOUD_TRUSTED_PROXIES ; do + PROXY=$(echo "$PROXY" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_proxies $NC_TRUSTED_PROXIES_IDX --value=$PROXY" + NC_TRUSTED_PROXIES_IDX=$(($NC_TRUSTED_PROXIES_IDX+1)) + done + fi else echo "running web-based installer on first connect!" fi diff --git a/16.0-rc/fpm-alpine/entrypoint.sh b/16.0-rc/fpm-alpine/entrypoint.sh index 9514d881..d30b94e1 100755 --- a/16.0-rc/fpm-alpine/entrypoint.sh +++ b/16.0-rc/fpm-alpine/entrypoint.sh @@ -125,6 +125,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) done fi + if [ -n "${NEXTCLOUD_TRUSTED_PROXIES+x}" ]; then + echo "setting trusted proxies…" + NC_TRUSTED_PROXIES_IDX=1 + for PROXY in $NEXTCLOUD_TRUSTED_PROXIES ; do + PROXY=$(echo "$PROXY" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_proxies $NC_TRUSTED_PROXIES_IDX --value=$PROXY" + NC_TRUSTED_PROXIES_IDX=$(($NC_TRUSTED_PROXIES_IDX+1)) + done + fi else echo "running web-based installer on first connect!" fi diff --git a/16.0-rc/fpm/entrypoint.sh b/16.0-rc/fpm/entrypoint.sh index 9514d881..d30b94e1 100755 --- a/16.0-rc/fpm/entrypoint.sh +++ b/16.0-rc/fpm/entrypoint.sh @@ -125,6 +125,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) done fi + if [ -n "${NEXTCLOUD_TRUSTED_PROXIES+x}" ]; then + echo "setting trusted proxies…" + NC_TRUSTED_PROXIES_IDX=1 + for PROXY in $NEXTCLOUD_TRUSTED_PROXIES ; do + PROXY=$(echo "$PROXY" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_proxies $NC_TRUSTED_PROXIES_IDX --value=$PROXY" + NC_TRUSTED_PROXIES_IDX=$(($NC_TRUSTED_PROXIES_IDX+1)) + done + fi else echo "running web-based installer on first connect!" fi diff --git a/16.0/apache/entrypoint.sh b/16.0/apache/entrypoint.sh index 9514d881..d30b94e1 100755 --- a/16.0/apache/entrypoint.sh +++ b/16.0/apache/entrypoint.sh @@ -125,6 +125,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) done fi + if [ -n "${NEXTCLOUD_TRUSTED_PROXIES+x}" ]; then + echo "setting trusted proxies…" + NC_TRUSTED_PROXIES_IDX=1 + for PROXY in $NEXTCLOUD_TRUSTED_PROXIES ; do + PROXY=$(echo "$PROXY" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_proxies $NC_TRUSTED_PROXIES_IDX --value=$PROXY" + NC_TRUSTED_PROXIES_IDX=$(($NC_TRUSTED_PROXIES_IDX+1)) + done + fi else echo "running web-based installer on first connect!" fi diff --git a/16.0/fpm-alpine/entrypoint.sh b/16.0/fpm-alpine/entrypoint.sh index 9514d881..d30b94e1 100755 --- a/16.0/fpm-alpine/entrypoint.sh +++ b/16.0/fpm-alpine/entrypoint.sh @@ -125,6 +125,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) done fi + if [ -n "${NEXTCLOUD_TRUSTED_PROXIES+x}" ]; then + echo "setting trusted proxies…" + NC_TRUSTED_PROXIES_IDX=1 + for PROXY in $NEXTCLOUD_TRUSTED_PROXIES ; do + PROXY=$(echo "$PROXY" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_proxies $NC_TRUSTED_PROXIES_IDX --value=$PROXY" + NC_TRUSTED_PROXIES_IDX=$(($NC_TRUSTED_PROXIES_IDX+1)) + done + fi else echo "running web-based installer on first connect!" fi diff --git a/16.0/fpm/entrypoint.sh b/16.0/fpm/entrypoint.sh index 9514d881..d30b94e1 100755 --- a/16.0/fpm/entrypoint.sh +++ b/16.0/fpm/entrypoint.sh @@ -125,6 +125,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) done fi + if [ -n "${NEXTCLOUD_TRUSTED_PROXIES+x}" ]; then + echo "setting trusted proxies…" + NC_TRUSTED_PROXIES_IDX=1 + for PROXY in $NEXTCLOUD_TRUSTED_PROXIES ; do + PROXY=$(echo "$PROXY" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_proxies $NC_TRUSTED_PROXIES_IDX --value=$PROXY" + NC_TRUSTED_PROXIES_IDX=$(($NC_TRUSTED_PROXIES_IDX+1)) + done + fi else echo "running web-based installer on first connect!" fi diff --git a/17.0-rc/apache/entrypoint.sh b/17.0-rc/apache/entrypoint.sh index 9514d881..d30b94e1 100755 --- a/17.0-rc/apache/entrypoint.sh +++ b/17.0-rc/apache/entrypoint.sh @@ -125,6 +125,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) done fi + if [ -n "${NEXTCLOUD_TRUSTED_PROXIES+x}" ]; then + echo "setting trusted proxies…" + NC_TRUSTED_PROXIES_IDX=1 + for PROXY in $NEXTCLOUD_TRUSTED_PROXIES ; do + PROXY=$(echo "$PROXY" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_proxies $NC_TRUSTED_PROXIES_IDX --value=$PROXY" + NC_TRUSTED_PROXIES_IDX=$(($NC_TRUSTED_PROXIES_IDX+1)) + done + fi else echo "running web-based installer on first connect!" fi diff --git a/17.0-rc/fpm-alpine/entrypoint.sh b/17.0-rc/fpm-alpine/entrypoint.sh index 9514d881..d30b94e1 100755 --- a/17.0-rc/fpm-alpine/entrypoint.sh +++ b/17.0-rc/fpm-alpine/entrypoint.sh @@ -125,6 +125,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) done fi + if [ -n "${NEXTCLOUD_TRUSTED_PROXIES+x}" ]; then + echo "setting trusted proxies…" + NC_TRUSTED_PROXIES_IDX=1 + for PROXY in $NEXTCLOUD_TRUSTED_PROXIES ; do + PROXY=$(echo "$PROXY" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_proxies $NC_TRUSTED_PROXIES_IDX --value=$PROXY" + NC_TRUSTED_PROXIES_IDX=$(($NC_TRUSTED_PROXIES_IDX+1)) + done + fi else echo "running web-based installer on first connect!" fi diff --git a/17.0-rc/fpm/entrypoint.sh b/17.0-rc/fpm/entrypoint.sh index 9514d881..d30b94e1 100755 --- a/17.0-rc/fpm/entrypoint.sh +++ b/17.0-rc/fpm/entrypoint.sh @@ -125,6 +125,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) done fi + if [ -n "${NEXTCLOUD_TRUSTED_PROXIES+x}" ]; then + echo "setting trusted proxies…" + NC_TRUSTED_PROXIES_IDX=1 + for PROXY in $NEXTCLOUD_TRUSTED_PROXIES ; do + PROXY=$(echo "$PROXY" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_proxies $NC_TRUSTED_PROXIES_IDX --value=$PROXY" + NC_TRUSTED_PROXIES_IDX=$(($NC_TRUSTED_PROXIES_IDX+1)) + done + fi else echo "running web-based installer on first connect!" fi diff --git a/17.0/apache/entrypoint.sh b/17.0/apache/entrypoint.sh index 9514d881..d30b94e1 100755 --- a/17.0/apache/entrypoint.sh +++ b/17.0/apache/entrypoint.sh @@ -125,6 +125,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) done fi + if [ -n "${NEXTCLOUD_TRUSTED_PROXIES+x}" ]; then + echo "setting trusted proxies…" + NC_TRUSTED_PROXIES_IDX=1 + for PROXY in $NEXTCLOUD_TRUSTED_PROXIES ; do + PROXY=$(echo "$PROXY" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_proxies $NC_TRUSTED_PROXIES_IDX --value=$PROXY" + NC_TRUSTED_PROXIES_IDX=$(($NC_TRUSTED_PROXIES_IDX+1)) + done + fi else echo "running web-based installer on first connect!" fi diff --git a/17.0/fpm-alpine/entrypoint.sh b/17.0/fpm-alpine/entrypoint.sh index 9514d881..d30b94e1 100755 --- a/17.0/fpm-alpine/entrypoint.sh +++ b/17.0/fpm-alpine/entrypoint.sh @@ -125,6 +125,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) done fi + if [ -n "${NEXTCLOUD_TRUSTED_PROXIES+x}" ]; then + echo "setting trusted proxies…" + NC_TRUSTED_PROXIES_IDX=1 + for PROXY in $NEXTCLOUD_TRUSTED_PROXIES ; do + PROXY=$(echo "$PROXY" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_proxies $NC_TRUSTED_PROXIES_IDX --value=$PROXY" + NC_TRUSTED_PROXIES_IDX=$(($NC_TRUSTED_PROXIES_IDX+1)) + done + fi else echo "running web-based installer on first connect!" fi diff --git a/17.0/fpm/entrypoint.sh b/17.0/fpm/entrypoint.sh index 9514d881..d30b94e1 100755 --- a/17.0/fpm/entrypoint.sh +++ b/17.0/fpm/entrypoint.sh @@ -125,6 +125,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) done fi + if [ -n "${NEXTCLOUD_TRUSTED_PROXIES+x}" ]; then + echo "setting trusted proxies…" + NC_TRUSTED_PROXIES_IDX=1 + for PROXY in $NEXTCLOUD_TRUSTED_PROXIES ; do + PROXY=$(echo "$PROXY" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_proxies $NC_TRUSTED_PROXIES_IDX --value=$PROXY" + NC_TRUSTED_PROXIES_IDX=$(($NC_TRUSTED_PROXIES_IDX+1)) + done + fi else echo "running web-based installer on first connect!" fi diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 9514d881..d30b94e1 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -125,6 +125,15 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP NC_TRUSTED_DOMAIN_IDX=$(($NC_TRUSTED_DOMAIN_IDX+1)) done fi + if [ -n "${NEXTCLOUD_TRUSTED_PROXIES+x}" ]; then + echo "setting trusted proxies…" + NC_TRUSTED_PROXIES_IDX=1 + for PROXY in $NEXTCLOUD_TRUSTED_PROXIES ; do + PROXY=$(echo "$PROXY" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') + run_as "php /var/www/html/occ config:system:set trusted_proxies $NC_TRUSTED_PROXIES_IDX --value=$PROXY" + NC_TRUSTED_PROXIES_IDX=$(($NC_TRUSTED_PROXIES_IDX+1)) + done + fi else echo "running web-based installer on first connect!" fi