mirror of
https://github.com/nextcloud/all-in-one.git
synced 2024-11-10 17:03:44 +08:00
Merge pull request #4560 from nextcloud/trust-ip-gateway
trust IP of docker network gateway
This commit is contained in:
commit
53836b6231
1 changed files with 8 additions and 0 deletions
|
@ -540,6 +540,14 @@ php /var/www/html/occ config:system:set trusted_proxies 1 --value="::1"
|
|||
if [ -n "$ADDITIONAL_TRUSTED_PROXY" ]; then
|
||||
php /var/www/html/occ config:system:set trusted_proxies 2 --value="$ADDITIONAL_TRUSTED_PROXY"
|
||||
fi
|
||||
|
||||
# Get ipv4-address of Nextcloud
|
||||
IPv4_ADDRESS="$(dig nextcloud-aio-nextcloud A +short +search | head -1)"
|
||||
# Bring it in CIDR notation
|
||||
# shellcheck disable=SC2001
|
||||
IPv4_ADDRESS="$(echo "$IPv4_ADDRESS" | sed 's|[0-9]\+$|1/32|')"
|
||||
php /var/www/html/occ config:system:set trusted_proxies 10 --value="$IPv4_ADDRESS"
|
||||
|
||||
if [ -n "$ADDITIONAL_TRUSTED_DOMAIN" ]; then
|
||||
php /var/www/html/occ config:system:set trusted_domains 2 --value="$ADDITIONAL_TRUSTED_DOMAIN"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue