Skip to content

Commit

Permalink
address review and fix another detail
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L <[email protected]>
  • Loading branch information
szaimen committed Nov 8, 2023
1 parent 30f5e27 commit 5808898
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Containers/talk/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ elif [ -z "$INTERNAL_SECRET" ]; then
fi

set -x
IPv4_ADDRESS_TALK="$(hostname -i | grep -oP '[0-9]+\.[0-9]+.[0-9]+\.[0-9]+' | head -1)"
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:
Expand All @@ -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
Expand Down

0 comments on commit 5808898

Please sign in to comment.