diff --git a/Containers/apache/start.sh b/Containers/apache/start.sh index 49270210..560dd84e 100644 --- a/Containers/apache/start.sh +++ b/Containers/apache/start.sh @@ -18,7 +18,8 @@ while ! nc -z "$NEXTCLOUD_HOST" 9000; do done # Get ipv4-address of Apache -IPv4_ADDRESS="$(dig nextcloud-aio-apache A +short +search | head -1)" +# shellcheck disable=SC2153 +IPv4_ADDRESS="$(dig "$APACHE_HOST" A +short +search | head -1)" # Bring it in CIDR notation # shellcheck disable=SC2001 IPv4_ADDRESS="$(echo "$IPv4_ADDRESS" | sed 's|[0-9]\+$|1/32|')" diff --git a/Containers/talk/start.sh b/Containers/talk/start.sh index 37d2682e..e73525b8 100644 --- a/Containers/talk/start.sh +++ b/Containers/talk/start.sh @@ -20,8 +20,10 @@ fi set -x IPv4_ADDRESS_TALK_RELAY="$(hostname -i | grep -oP '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | head -1)" -IPv4_ADDRESS_TALK="$(dig nextcloud-aio-talk IN A +short +search | grep '^[0-9.]\+$' | sort | head -n1)" -IPv6_ADDRESS_TALK="$(dig nextcloud-aio-talk AAAA +short +search | grep '^[0-9a-f:]\+$' | sort | head -n1)" +# shellcheck disable=SC2153 +IPv4_ADDRESS_TALK="$(dig "$TALK_HOST" IN A +short +search | grep '^[0-9.]\+$' | sort | head -n1)" +# shellcheck disable=SC2153 +IPv6_ADDRESS_TALK="$(dig "$TALK_HOST" AAAA +short +search | grep '^[0-9a-f:]\+$' | sort | head -n1)" set +x if [ -n "$IPv4_ADDRESS_TALK" ] && [ "$IPv4_ADDRESS_TALK_RELAY" = "$IPv4_ADDRESS_TALK" ]; then diff --git a/php/containers.json b/php/containers.json index fd1e137e..a8669744 100644 --- a/php/containers.json +++ b/php/containers.json @@ -29,6 +29,7 @@ "environment": [ "NC_DOMAIN=%NC_DOMAIN%", "NEXTCLOUD_HOST=nextcloud-aio-nextcloud", + "APACHE_HOST=nextcloud-aio-apache", "COLLABORA_HOST=nextcloud-aio-collabora", "TALK_HOST=nextcloud-aio-talk", "APACHE_PORT=%APACHE_PORT%", @@ -376,6 +377,7 @@ "internal_port": "%TALK_PORT%", "environment": [ "NC_DOMAIN=%NC_DOMAIN%", + "TALK_HOST=nextcloud-aio-talk", "TURN_SECRET=%TURN_SECRET%", "SIGNALING_SECRET=%SIGNALING_SECRET%", "TZ=%TIMEZONE%",