Skip to content

Commit 856e414

Browse files
authored
prosody: add ability to configure external TURN server
Co-authored-by: Thomas Butter <tbutter@gmail.com>
1 parent bcae3b1 commit 856e414

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@ services:
172172
- JWT_TOKEN_AUTH_MODULE
173173
- LOG_LEVEL
174174
- PUBLIC_URL
175+
- TURN_CREDENTIALS
176+
- TURN_HOST
177+
- TURNS_HOST
178+
- TURN_PORT
179+
- TURNS_PORT
175180
- TZ
176181
networks:
177182
meet.jitsi:

env.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,13 @@ JIBRI_STRIP_DOMAIN_JID=muc
354354
# Directory for logs inside Jibri container
355355
JIBRI_LOGS_DIR=/config/logs
356356

357+
# Configure an external TURN server
358+
# TURN_CREDENTIALS="secret"
359+
# TURN_HOST=turnserver.example.com
360+
# TURN_PORT=443
361+
# TURNS_HOST=turnserver.example.com
362+
# TURNS_PORT=443
363+
357364
# Disable HTTPS: handle TLS connections outside of this setup
358365
#DISABLE_HTTPS=1
359366

prosody/rootfs/defaults/conf.d/jitsi-meet.cfg.lua

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,26 @@ http_default_host = "{{ .Env.XMPP_DOMAIN }}"
2424

2525
{{ $ENABLE_XMPP_WEBSOCKET := .Env.ENABLE_XMPP_WEBSOCKET | default "1" | toBool }}
2626
{{ $PUBLIC_URL := .Env.PUBLIC_URL | default "https://localhost:8443" -}}
27+
{{ $TURN_PORT := .Env.TURN_PORT | default "443" }}
28+
{{ $TURNS_PORT := .Env.TURNS_PORT | default "443" }}
29+
30+
{{ if .Env.TURN_CREDENTIALS }}
31+
external_service_secret = "{{.Env.TURN_CREDENTIALS}}";
32+
{{ end }}
33+
34+
{{ if or .Env.TURN_HOST .Env.TURNS_HOST }}
35+
external_services = {
36+
{{ if .Env.TURN_HOST }}
37+
{ type = "turn", host = "{{ .Env.TURN_HOST }}", port = {{ $TURN_PORT }}, transport = "tcp", secret = true, ttl = 86400, algorithm = "turn" }
38+
{{ end }}
39+
{{ if and .Env.TURN_HOST .Env.TURNS_HOST }}
40+
,
41+
{{ end }}
42+
{{ if .Env.TURNS_HOST }}
43+
{ type = "turns", host = "{{ .Env.TURNS_HOST }}", port = {{ $TURNS_PORT }}, transport = "tcp", secret = true, ttl = 86400, algorithm = "turn" }
44+
{{ end }}
45+
};
46+
{{ end }}
2747

2848
{{ if and $ENABLE_AUTH (eq $AUTH_TYPE "jwt") .Env.JWT_ACCEPTED_ISSUERS }}
2949
asap_accepted_issuers = { "{{ join "\",\"" (splitList "," .Env.JWT_ACCEPTED_ISSUERS) }}" }
@@ -93,6 +113,9 @@ VirtualHost "{{ .Env.XMPP_DOMAIN }}"
93113
"ping";
94114
"speakerstats";
95115
"conference_duration";
116+
{{ if or .Env.TURN_HOST .Env.TURNS_HOST }}
117+
"external_services";
118+
{{ end }}
96119
{{ if $ENABLE_LOBBY }}
97120
"muc_lobby_rooms";
98121
{{ end }}

0 commit comments

Comments
 (0)