# See https://manpages.debian.org/testing/coturn/coturn.1.en.html # Original file taken from Debian package, removed useless options # Note : we don't consider using behind_reverse_proxy variable, because we would have to # get its IP address so that coturn works (external-ip config key) and it is not known. # =============================== # Coturn TURN SERVER configuration file # # Boolean values note: where a boolean value is supposed to be used, # you can use '0', 'off', 'no', 'false', or 'f' as 'false, # and you can use '1', 'on', 'yes', 'true', or 't' as 'true' # If the value is missing, then it means 'true' by default. # # Number of the relay threads to handle the established connections # (in addition to authentication thread and the listener thread). # If explicitly set to 0 then application runs relay process in a # single thread, in the same thread with the listener process # (the authentication thread will still be a separate thread). # # If this parameter is not set, then the default OS-dependent # thread pattern algorithm will be employed. Usually the default # algorithm is optimal, so you have to change this option # if you want to make some fine tweaks. # #relay-threads=0 # Default, interchangeable listening-port=3478 tls-listening-port=5349 # Lower and upper bounds of the UDP relay endpoints: # (default values are 49152 and 65535) # min-port={{ coturn_min_port }} max-port={{ coturn_max_port }} # Uncomment to run TURN server in 'normal' 'moderate' verbose mode. # By default the verbose mode is off. #verbose # Uncomment to use fingerprints in the TURN messages. # By default the fingerprints are off. # fingerprint # TURN REST API flag. # (Time Limited Long Term Credential) # Flag that sets a special authorization option that is based upon authentication secret. # # This feature's purpose is to support "TURN Server REST API", see # "TURN REST API" link in the project's page # https://github.com/coturn/coturn/ # # This option is used with timestamp: # # usercombo -> "timestamp:userid" # turn user -> usercombo # turn password -> base64(hmac(secret key, usercombo)) # # This allows TURN credentials to be accounted for a specific user id. # If you don't have a suitable id, then the timestamp alone can be used. # This option is enabled by turning on secret-based authentication. # The actual value of the secret is defined either by the option static-auth-secret, # or can be found in the turn_secret table in the database (see below). # # Read more about it: # - https://tools.ietf.org/html/draft-uberti-behave-turn-rest-00 # - https://www.ietf.org/proceedings/87/slides/slides-87-behave-10.pdf # # Be aware that use-auth-secret overrides some parts of lt-cred-mech. # The use-auth-secret feature depends internally on lt-cred-mech, so if you set # this option then it automatically enables lt-cred-mech internally # as if you had enabled both. # # Note that you can use only one auth mechanism at the same time! This is because, # both mechanisms conduct username and password validation in different ways. # # Use either lt-cred-mech or use-auth-secret in the conf # to avoid any confusion. # use-auth-secret # 'Static' authentication secret value (a string) for TURN REST API only. # If not set, then the turn server # will try to use the 'dynamic' value in the turn_secret table # in the user database (if present). The database-stored value can be changed on-the-fly # by a separate program, so this is why that mode is considered 'dynamic'. # static-auth-secret={{ coturn_secret }} # SQLite database file name. # # The default file name is /var/db/turndb or /usr/local/var/db/turndb or # /var/lib/turn/turndb. # userdb={{ coturn_home }}/{{ coturn_db_name }} # The default realm to be used for the users when no explicit # origin/realm relationship is found in the database, or if the TURN # server is not using any database (just the commands-line settings # and the userdb file). Must be used with long-term credentials # mechanism or with TURN REST API. # # Note: If the default realm is not specified, then realm falls back to the host domain name. # If the domain name string is empty, or set to '(None)', then it is initialized as an empty string. # realm={{ application_domain }} # Taken from : https://element-hq.github.io/synapse/latest/setup/turn/coturn.html # 4 streams per video call, so 12 streams = 3 simultaneous relayed calls per user. user-quota=12 total-quota=1200 # Certificate file. # Use an absolute path or path relative to the # configuration file. # Use PEM file format. # cert=/etc/letsencrypt/live/{{ application_domain }}/fullchain.pem # Private key file. # Use an absolute path or path relative to the # configuration file. # Use PEM file format. # pkey=/etc/letsencrypt/live/{{ application_domain }}/privkey.pem # Flag to prevent stdout log messages. # By default, all log messages go to both stdout and to # the configured log file. With this option everything will # go to the configured log only (unless the log file itself is stdout). # no-stdout-log # Option to set the log file name. # By default, the turnserver tries to open a log file in # /var/log, /var/tmp, /tmp and the current directory # (Whichever file open operation succeeds first will be used). # With this option you can set the definite log file name. # The special names are "stdout" and "-" - they will force everything # to the stdout. Also, the "syslog" name will force everything to # the system log (syslog). # In the runtime, the logfile can be reset with the SIGHUP signal # to the turnserver process. # log-file={{ coturn_log }}/{{ application_id }}.log # Enable full ISO-8601 timestamp in all logs. new-log-timestamp # Option to suppress TURN functionality, only STUN requests will be processed. # Run as STUN server only, all TURN requests will be ignored. # By default, this option is NOT set. # #stun-only # Option to hide software version. Enhance security when used in production. # Revealing the specific software version of the agent through the # SOFTWARE attribute might allow them to become more vulnerable to # attacks against software that is known to contain security holes. # Implementers SHOULD make usage of the SOFTWARE attribute a # configurable option (https://tools.ietf.org/html/rfc5389#section-16.1.2) # no-software-attribute # Option to suppress STUN functionality, only TURN requests will be processed. # Run as TURN server only, all STUN requests will be ignored. # By default, this option is NOT set. # #no-stun # File name to store the pid of the process. # Default is /var/run/turnserver.pid (if superuser account is used) or # /var/tmp/turnserver.pid . # pidfile="/var/run/{{ application_id }}.pid" # Require authentication of the STUN Binding request. # By default, the clients are allowed anonymous access to the STUN Binding functionality. # Note: Nextcloud Talk doesn't support this. #secure-stun # User name to run the process. After the initialization, the turnserver process # will attempt to change the current user ID to that user. # proc-user={{ application_id }} # Group name to run the process. After the initialization, the turnserver process # will attempt to change the current group ID to that group. # proc-group={{ application_id }} # See https://nextcloud-talk.readthedocs.io/en/latest/coturn/#turn-server-and-internal-networks denied-peer-ip=0.0.0.0-0.255.255.255 denied-peer-ip=10.0.0.0-10.255.255.255 denied-peer-ip=100.64.0.0-100.127.255.255 denied-peer-ip=127.0.0.0-127.255.255.255 denied-peer-ip=169.254.0.0-169.254.255.255 denied-peer-ip=172.16.0.0-172.31.255.255 denied-peer-ip=192.0.0.0-192.0.0.255 denied-peer-ip=192.0.2.0-192.0.2.255 denied-peer-ip=192.88.99.0-192.88.99.255 denied-peer-ip=192.168.0.0-192.168.255.255 denied-peer-ip=198.18.0.0-198.19.255.255 denied-peer-ip=198.51.100.0-198.51.100.255 denied-peer-ip=203.0.113.0-203.0.113.255 denied-peer-ip=240.0.0.0-255.255.255.255 # Do not allow an TLS/DTLS version of protocol # no-tlsv1 no-tlsv1_1 # Still too early in 2025 ?? #no-tlsv1_2 # Disable RFC5780 (NAT behavior discovery). # # Originally, if there are more than one listener address from the same # address family, then by default the NAT behavior discovery feature enabled. # This option disables the original behavior, because the NAT behavior # discovery adds extra attributes to response, and this increase the # possibility of an amplification attack. # # Strongly encouraged to use this option to decrease gain factor in STUN # binding responses. # no-rfc5780 # Disable handling old STUN Binding requests and disable MAPPED-ADDRESS # attribute in binding response (use only the XOR-MAPPED-ADDRESS). # # Strongly encouraged to use this option to decrease gain factor in STUN # binding responses. # no-stun-backward-compatibility # Only send RESPONSE-ORIGIN attribute in binding response if RFC5780 is enabled. # # Strongly encouraged to use this option to decrease gain factor in STUN # binding responses. # response-origin-only-with-rfc5780