From e156e9ccfd77ca5e09d2b764b542f17b794f8689 Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Thu, 28 Nov 2024 10:59:41 +0100 Subject: [PATCH] nextcloud: allow to adjust name of nextcloud container Signed-off-by: Simon L. --- Containers/nextcloud/entrypoint.sh | 11 ++++++++--- php/containers.json | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Containers/nextcloud/entrypoint.sh b/Containers/nextcloud/entrypoint.sh index 419401cda57..0e251884b8d 100644 --- a/Containers/nextcloud/entrypoint.sh +++ b/Containers/nextcloud/entrypoint.sh @@ -592,12 +592,17 @@ 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)" +# Get ipv4-address of Nextcloud +if [ -z "$NEXTCLOUD_HOST" ]; then + export NEXTCLOUD_HOST="nextcloud-aio-nextcloud" +fi +IPv4_ADDRESS="$(dig "$NEXTCLOUD_HOST" A +short +search | head -1)" # Bring it in CIDR notation # shellcheck disable=SC2001 IPv4_ADDRESS="$(echo "$IPv4_ADDRESS" | sed 's|[0-9]\+$|0/16|')" -php /var/www/html/occ config:system:set trusted_proxies 10 --value="$IPv4_ADDRESS" +if [ -n "$IPv4_ADDRESS" ]; then + php /var/www/html/occ config:system:set trusted_proxies 10 --value="$IPv4_ADDRESS" +fi if [ -n "$ADDITIONAL_TRUSTED_DOMAIN" ]; then php /var/www/html/occ config:system:set trusted_domains 2 --value="$ADDITIONAL_TRUSTED_DOMAIN" diff --git a/php/containers.json b/php/containers.json index 17f60b2d7fd..2a96774ab22 100644 --- a/php/containers.json +++ b/php/containers.json @@ -178,6 +178,7 @@ } ], "environment": [ + "NEXTCLOUD_HOST=nextcloud-aio-nextcloud", "POSTGRES_HOST=nextcloud-aio-database", "POSTGRES_PORT=5432", "POSTGRES_PASSWORD=%DATABASE_PASSWORD%",