From 9d154557f837dc4b2507c9dbab06e04238c3d46f Mon Sep 17 00:00:00 2001 From: Zoey Date: Mon, 7 Aug 2023 13:15:41 +0200 Subject: [PATCH] enable stun auto detection Signed-off-by: Zoey --- Containers/talk/Dockerfile | 4 +++- Containers/talk/start.sh | 11 ++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Containers/talk/Dockerfile b/Containers/talk/Dockerfile index 9581d2da..67d709bd 100644 --- a/Containers/talk/Dockerfile +++ b/Containers/talk/Dockerfile @@ -34,9 +34,11 @@ RUN set -ex; \ rename -v ".jcfg.sample" ".jcfg" /usr/local/etc/janus/*.jcfg.sample FROM alpine:3.18.2 - +ENV STUN_SERVICE="stun.nextcloud.com 443" COPY --from=janus /usr/local /usr/local COPY --from=eturnal /opt/eturnal /opt/eturnal +COPY --from=eturnal /usr/local/bin/stun /usr/local/bin/stun +COPY --from=eturnal /usr/local/bin/eturnalctl /usr/local/bin/eturnalctl COPY --from=nats /nats-server /usr/local/bin/nats-server COPY --from=signaling /usr/bin/nextcloud-spreed-signaling /usr/local/bin/nextcloud-spreed-signaling diff --git a/Containers/talk/start.sh b/Containers/talk/start.sh index 920e63dc..b76b029e 100644 --- a/Containers/talk/start.sh +++ b/Containers/talk/start.sh @@ -19,14 +19,11 @@ elif [ -z "$INTERNAL_SECRET" ]; then fi set -x -IPv4_ADDRESS_TALK="$(dig nextcloud-aio-talk A +short | grep -E "^[0-9.]+$" | sort | head -n1)" -IPv6_ADDRESS_TALK="$(dig nextcloud-aio-talk AAAA +short | grep -E "^[0-9a-f:]+$" | sort | head -n1)" +IPv4_ADDRESS_TALK="$(dig nextcloud-aio-talk IN A +short | grep '^[0-9.]\+$' | sort | head -n1)" +IPv6_ADDRESS_TALK="$(dig nextcloud-aio-talk AAAA +short | grep '^[0-9a-f:]\+$' | sort | head -n1)" -IPv4_ADDRESS_NC="$(dig "$NC_DOMAIN" A +short +https +tls-ca=/etc/ssl/certs/ca-certificates.crt @1.1.1.1 | grep "^[0-9.]\+$" | sort | head -n1)" -IPv6_ADDRESS_NC="$(dig "$NC_DOMAIN" AAAA +short +https +tls-ca=/etc/ssl/certs/ca-certificates.crt @1.1.1.1 | grep "^[0-9a-f:]\+$" | sort | head -n1)" -#if [ -z "$IPv4_ADDRESS_NC" ] && [ -z "$IPv6_ADDRESS_NC" ]; then -# export STUN_SERVICE="stun.nextcloud.com 443" -#fi +IPv4_ADDRESS_NC="$(dig "$NC_DOMAIN" IN A +short +https +tls-ca=/etc/ssl/certs/ca-certificates.crt @1.1.1.1 | grep '^[0-9.]\+$' | sort | head -n1)" +IPv6_ADDRESS_NC="$(dig "$NC_DOMAIN" IN AAAA +short +https +tls-ca=/etc/ssl/certs/ca-certificates.crt @1.1.1.1 | grep '^[0-9a-f:]\+$' | sort | head -n1)" set +x # Turn