mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-01-23 05:58:49 +08:00
Merge pull request #4789 from nextcloud/enh/noid/fix-getting-ip-address
fix getting ip-address of talk and apache
This commit is contained in:
commit
80cf17b5a2
3 changed files with 8 additions and 3 deletions
|
@ -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|')"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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%",
|
||||
|
|
Loading…
Reference in a new issue