Merge pull request #3705 from nextcloud/enh/noid/fix-getting-ipaddress

This commit is contained in:
Simon L 2023-11-08 15:18:19 +01:00 committed by GitHub
commit dc581f2321
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View file

@ -65,7 +65,8 @@ RUN set -ex; \
libusrsctp \
libwebsockets \
\
shadow; \
shadow \
grep; \
useradd --system -u 1000 eturnal; \
apk del --no-cache \
shadow; \

View file

@ -19,10 +19,15 @@ elif [ -z "$INTERNAL_SECRET" ]; then
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)"
set +x
if [ -n "$IPv4_ADDRESS_TALK" ] && [ "$IPv4_ADDRESS_TALK_RELAY" = "$IPv4_ADDRESS_TALK" ]; then
IPv4_ADDRESS_TALK=""
fi
# Turn
cat << TURN_CONF > "/conf/eturnal.yml"
eturnal:
@ -36,13 +41,14 @@ eturnal:
log_dir: stdout
log_level: warning
secret: "$TURN_SECRET"
relay_ipv4_addr: "$IPv4_ADDRESS_TALK"
relay_ipv4_addr: "$IPv4_ADDRESS_TALK_RELAY"
relay_ipv6_addr: "$IPv6_ADDRESS_TALK"
blacklist_peers:
- recommended
whitelist_peers:
- 127.0.0.1
- ::1
- "$IPv4_ADDRESS_TALK_RELAY"
- "$IPv4_ADDRESS_TALK"
- "$IPv6_ADDRESS_TALK"
TURN_CONF