Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
11 changes: 11 additions & 0 deletions deploy-turnserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -23,6 +25,15 @@ 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

if [ "$VERBOSE" == "true" ];then
echo "verbose" >> /etc/turnserver.conf
fi

turnadmin -a -u $USERNAME -p $PASSWORD -r $REALM

echo "Start TURN server..."
Expand Down