From 5b49ec6da2da892b565dd9b8e697c2fe9171f919 Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Fri, 7 Jun 2024 15:17:27 +0200 Subject: [PATCH 1/2] fix getting ip-address of talk and apache Signed-off-by: Simon L --- Containers/apache/start.sh | 2 +- Containers/talk/start.sh | 4 ++-- php/containers.json | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Containers/apache/start.sh b/Containers/apache/start.sh index 49270210..9d2a8c2d 100644 --- a/Containers/apache/start.sh +++ b/Containers/apache/start.sh @@ -18,7 +18,7 @@ while ! nc -z "$NEXTCLOUD_HOST" 9000; do done # Get ipv4-address of Apache -IPv4_ADDRESS="$(dig nextcloud-aio-apache A +short +search | head -1)" +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..01206e16 100644 --- a/Containers/talk/start.sh +++ b/Containers/talk/start.sh @@ -20,8 +20,8 @@ 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)" +IPv4_ADDRESS_TALK="$(dig "$TALK_HOST" IN A +short +search | grep '^[0-9.]\+$' | sort | head -n1)" +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%", From 335026ce76cff6309cf9705575bf8c520bbab2be Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Mon, 10 Jun 2024 10:38:59 +0200 Subject: [PATCH 2/2] fix SC Signed-off-by: Simon L --- Containers/apache/start.sh | 1 + Containers/talk/start.sh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Containers/apache/start.sh b/Containers/apache/start.sh index 9d2a8c2d..560dd84e 100644 --- a/Containers/apache/start.sh +++ b/Containers/apache/start.sh @@ -18,6 +18,7 @@ while ! nc -z "$NEXTCLOUD_HOST" 9000; do done # Get ipv4-address of Apache +# shellcheck disable=SC2153 IPv4_ADDRESS="$(dig "$APACHE_HOST" A +short +search | head -1)" # Bring it in CIDR notation # shellcheck disable=SC2001 diff --git a/Containers/talk/start.sh b/Containers/talk/start.sh index 01206e16..e73525b8 100644 --- a/Containers/talk/start.sh +++ b/Containers/talk/start.sh @@ -20,7 +20,9 @@ fi set -x IPv4_ADDRESS_TALK_RELAY="$(hostname -i | grep -oP '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | head -1)" +# 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