From cfe25c489f698e04ff38cdfc12714fd3cb1b3905 Mon Sep 17 00:00:00 2001 From: Bruno Bottazzini Date: Tue, 31 May 2022 10:36:51 +0200 Subject: [PATCH 1/4] add: shared secret coturn configuration --- deploy-turnserver.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deploy-turnserver.sh b/deploy-turnserver.sh index 5956625..423fc6c 100644 --- a/deploy-turnserver.sh +++ b/deploy-turnserver.sh @@ -23,6 +23,11 @@ pkey=/etc/ssl/turn_server_pkey.pem no-stdout-log" | tee /etc/turnserver.conf +if [ -n "$SHARED_SECRET" ]; then + echo "use-auth-secret" >> /etc/turnserver.conf + echo "static-auth-secret=$SHARED_SECRET" >> /etc/turnserver.conf +fi + turnadmin -a -u $USERNAME -p $PASSWORD -r $REALM echo "Start TURN server..." From 8e175497aa59910f083fef512cefb397a80452ac Mon Sep 17 00:00:00 2001 From: Bruno Bottazzini Date: Tue, 31 May 2022 15:14:15 +0200 Subject: [PATCH 2/4] Add: verbose configuration --- deploy-turnserver.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deploy-turnserver.sh b/deploy-turnserver.sh index 423fc6c..f3be1ee 100644 --- a/deploy-turnserver.sh +++ b/deploy-turnserver.sh @@ -28,6 +28,10 @@ if [ -n "$SHARED_SECRET" ]; then echo "static-auth-secret=$SHARED_SECRET" >> /etc/turnserver.conf fi +if [ "$VERBOSE" == "true" ];then + echo "verbose" >> /etc/turnserver.conf +fi + turnadmin -a -u $USERNAME -p $PASSWORD -r $REALM echo "Start TURN server..." From e9fcc11c0c049f871a1f8c626c85dd470c487875 Mon Sep 17 00:00:00 2001 From: Bruno Bottazzini Date: Tue, 31 May 2022 15:14:25 +0200 Subject: [PATCH 3/4] Log set configuration --- deploy-turnserver.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deploy-turnserver.sh b/deploy-turnserver.sh index f3be1ee..b5879c4 100644 --- a/deploy-turnserver.sh +++ b/deploy-turnserver.sh @@ -2,6 +2,8 @@ echo "USERNAME: $USERNAME" echo "PASSWORD: $PASSWORD" echo "REALM: $REALM" echo "PORT RANGE: $MIN_PORT-$MAX_PORT" +echo "SHARED_SECRET: $SHARED_SECRET" +echo "VERBOSE: $VERBOSE" internalIp="$(ip a | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1')" externalIp="$(dig +short myip.opendns.com @resolver1.opendns.com)" From ef69a81ef7e687009a3c105942589f7a7d399cef Mon Sep 17 00:00:00 2001 From: Bruno Bottazzini Date: Tue, 31 May 2022 17:23:18 +0200 Subject: [PATCH 4/4] Update README.md with new variables --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 77b55ee..41b039b 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ This image supports some environment variables: * `USERNAME`: Username needed for turn. Defaults to `username` * `PASSWORD`: Password needed for turn. Defaults ro `password` +* `SHARED_SECRET`: To enable credentials generation from a third part server +* `VERBOSE`: to enable log in verbose mode * `REALM`: Realm needed for turn. Defaults to `realm` * `MIN_PORT`: This defines the min-port for the range used by turn. Defaults to `65435` * `MAX_PORT`: This defines the max-port for the range used by turn. Defaults to `65535`