diff --git a/docker/coturn/rootfs/usr/local/bin/coturn.sh b/docker/coturn/rootfs/usr/local/bin/coturn.sh index f3476fe8..7216b7b5 100755 --- a/docker/coturn/rootfs/usr/local/bin/coturn.sh +++ b/docker/coturn/rootfs/usr/local/bin/coturn.sh @@ -1,30 +1,41 @@ #!/bin/bash cd /tmp/ cat > ./turnserver.conf << EOF external-ip=${TURN_PUBLIC_IP:-127.0.0.1} listening-port=${TURN_LISTEN_PORT:-3478} fingerprint -# For testing -#allow-loopback-peers -#cli-password=qwerty - -# Disabled by default to avoid DoS attacks. Logs all bind attempts in verbose log mode (useful for debugging) -#log-binding - max-port=${MAX_PORT:-65535} min-port=${MIN_PORT:-40000} pidfile="$(pwd)/turnserver.pid" realm=kolabmeet log-file=stdout +EOF + +if $TURN_STATIC_SECRET; then + cat >> ./turnserver.conf << EOF # Dynamically generate username/password for turn use-auth-secret -static-auth-secret=${TURN_STATIC_SECRET:-uzYguvIl9tpZFMuQOE78DpOi6Jc7VFSD0UAnvgMsg5n4e74MgIf6vQvbc6LWzZjz} +static-auth-secret=${TURN_STATIC_SECRET} + +EOF +fi + +if $DEBUG; then + cat >> ./turnserver.conf << EOF +# For testing +allow-loopback-peers +cli-password=simple123 + +# Disabled by default to avoid DoS attacks. Logs all bind attempts in verbose log mode (useful for debugging) +log-binding + +verbose -# verbose EOF +fi /usr/bin/turnserver -c ./turnserver.conf