#! /usr/bin/env bash # install latest version of coturn apt install -y coturn # set to enable coturn sed -i '/TURNSERVER_ENABLED/c\TURNSERVER_ENABLED=1' /etc/default/coturn # save the original turnserver.conf file mv /etc/turnserver.conf /etc/turnserver.conf.original # create a new turnserver.conf file with most of the stuff filled in cat </etc/turnserver.conf # If you change this, you must change the port in your firewall and your nextcloud talk config listening-port=3478 fingerprint use-auth-secret # randomly created key to be used on clients utilizing the server (your Talk server) static-auth-secret=`openssl rand -hex 32` realm=`hostname -f` total-quota=100 bps-capacity=0 stale-nonce no-multicast-peers no-stdout-log # turn off logging to STDOUT log-file=/var/log/turn.log # remove this to not have a separate file syslog # also use syslog for logging simple-log # modify the following if you are behind a NAT # (change external.ip.address to public IP) and uncomment #external-ip=`hostname -I | cut -d' ' -f1`/external.ip.address EOF service coturn start