From 671a3dc94f117cb478025a9908cd17ddca47203c Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sat, 22 Feb 2025 13:44:14 +0200 Subject: [PATCH] Only advertise 3478/udp (STUN/TURN) if Coturn actually enables it Related to ac26cc1cb0d6423b751b74ddb06a8c793f63dd56 which disabled `3478/udp` by default. Without this patch, homeservers continued to advertise the `3478/udp` port, even though it was no longer exposed. While clients should handle that gracefully (by falling back to TCP, etc.), it seems like Element either doesn't do that or it doesn't support TCP (which this patch won't fix). In any case, it's better to only announce what is actually supported/exposed. --- roles/custom/matrix-coturn/vars/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roles/custom/matrix-coturn/vars/main.yml b/roles/custom/matrix-coturn/vars/main.yml index 96e9f60a2..0c0a1c24f 100644 --- a/roles/custom/matrix-coturn/vars/main.yml +++ b/roles/custom/matrix-coturn/vars/main.yml @@ -9,6 +9,9 @@ matrix_coturn_turn_uris: |- + ([ 'turn:' + matrix_server_fqn_matrix + '?transport=udp', + ] if (matrix_coturn_container_stun_plain_host_bind_port_udp != '' or matrix_coturn_container_network == 'host') else []) + + + ([ 'turn:' + matrix_server_fqn_matrix + '?transport=tcp', - ]) + ] if (matrix_coturn_container_stun_plain_host_bind_port_tcp != '' or matrix_coturn_container_network == 'host') else []) }}