From 6f98bbeeeab83b23ccc307c1068cfe3543288f7f Mon Sep 17 00:00:00 2001 From: simon <60380144+simon-kaiser@users.noreply.github.com> Date: Wed, 24 Apr 2024 10:14:35 +0200 Subject: [PATCH] prosody: add ability to customize TURN TTL value --- prosody/rootfs/defaults/conf.d/jitsi-meet.cfg.lua | 5 +++-- prosody/rootfs/defaults/conf.d/visitors.cfg.lua | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/prosody/rootfs/defaults/conf.d/jitsi-meet.cfg.lua b/prosody/rootfs/defaults/conf.d/jitsi-meet.cfg.lua index 1358057..d0e75b4 100644 --- a/prosody/rootfs/defaults/conf.d/jitsi-meet.cfg.lua +++ b/prosody/rootfs/defaults/conf.d/jitsi-meet.cfg.lua @@ -34,6 +34,7 @@ {{ $TURN_PORT := .Env.TURN_PORT | default "443" -}} {{ $TURN_TRANSPORT := .Env.TURN_TRANSPORT | default "tcp" -}} {{ $TURN_TRANSPORTS := splitList "," $TURN_TRANSPORT -}} +{{ $TURN_TTL := .Env.TURN_TTL | default "86400" -}} {{ $TURNS_HOST := .Env.TURNS_HOST | default "" -}} {{ $TURNS_HOSTS := splitList "," $TURNS_HOST -}} {{ $TURNS_PORT := .Env.TURNS_PORT | default "443" -}} @@ -95,7 +96,7 @@ external_services = { {{- range $idx1, $host := $TURN_HOSTS -}} {{- range $idx2, $transport := $TURN_TRANSPORTS -}} {{- if or $STUN_HOST $idx1 $idx2 -}},{{- end }} - { type = "turn", host = "{{ $host }}", port = {{ $TURN_PORT }}, transport = "{{ $transport }}", secret = true, ttl = 86400, algorithm = "turn" } + { type = "turn", host = "{{ $host }}", port = {{ $TURN_PORT }}, transport = "{{ $transport }}", secret = true, ttl = {{ $TURN_TTL }}, algorithm = "turn" } {{- end -}} {{- end -}} {{- end -}} @@ -103,7 +104,7 @@ external_services = { {{- if $TURNS_HOST -}} {{- range $idx, $host := $TURNS_HOSTS -}} {{- if or $STUN_HOST $TURN_HOST $idx -}},{{- end }} - { type = "turns", host = "{{ $host }}", port = {{ $TURNS_PORT }}, transport = "tcp", secret = true, ttl = 86400, algorithm = "turn" } + { type = "turns", host = "{{ $host }}", port = {{ $TURNS_PORT }}, transport = "tcp", secret = true, ttl = {{ $TURN_TTL }}, algorithm = "turn" } {{- end }} {{- end }} }; diff --git a/prosody/rootfs/defaults/conf.d/visitors.cfg.lua b/prosody/rootfs/defaults/conf.d/visitors.cfg.lua index b3214fc..035759a 100644 --- a/prosody/rootfs/defaults/conf.d/visitors.cfg.lua +++ b/prosody/rootfs/defaults/conf.d/visitors.cfg.lua @@ -20,6 +20,7 @@ {{ $TURN_PORT := .Env.TURN_PORT | default "443" -}} {{ $TURN_TRANSPORT := .Env.TURN_TRANSPORT | default "tcp" -}} {{ $TURN_TRANSPORTS := splitList "," $TURN_TRANSPORT -}} +{{ $TURN_TTL := .Env.TURN_TTL | default "86400" -}} {{ $TURNS_HOST := .Env.TURNS_HOST | default "" -}} {{ $TURNS_HOSTS := splitList "," $TURNS_HOST -}} {{ $TURNS_PORT := .Env.TURNS_PORT | default "443" -}} @@ -53,7 +54,7 @@ external_services = { {{- range $idx1, $host := $TURN_HOSTS -}} {{- range $idx2, $transport := $TURN_TRANSPORTS -}} {{- if or $idx1 $idx2 -}},{{- end }} - { type = "turn", host = "{{ $host }}", port = {{ $TURN_PORT }}, transport = "{{ $transport }}", secret = true, ttl = 86400, algorithm = "turn" } + { type = "turn", host = "{{ $host }}", port = {{ $TURN_PORT }}, transport = "{{ $transport }}", secret = true, ttl = {{ $TURN_TTL }}, algorithm = "turn" } {{- end -}} {{- end -}} {{- end -}} @@ -61,7 +62,7 @@ external_services = { {{- if $TURNS_HOST -}} {{- range $idx, $host := $TURNS_HOSTS -}} {{- if or $TURN_HOST $idx -}},{{- end }} - { type = "turns", host = "{{ $host }}", port = {{ $TURNS_PORT }}, transport = "tcp", secret = true, ttl = 86400, algorithm = "turn" } + { type = "turns", host = "{{ $host }}", port = {{ $TURNS_PORT }}, transport = "tcp", secret = true, ttl = {{ $TURN_TTL }}, algorithm = "turn" } {{- end }} {{- end }} };