From 38f11321920641d5d7d75e8487014ec5861b6b1c Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Tue, 15 Oct 2024 22:50:30 +0200 Subject: [PATCH] ejabberd_stun: Omit 'auth_realm' log message These days, TURN authentication is usually performed using ephemeral credentials handed out by mod_stun_disco. In that case, the TURN realm is irrelevant. Therefore, omit the misleading log message that warned about a missing realm configuration. (Commit 6eb2f0727447d8e7a36f11bccbf19be819b7bcfd reduced the log level of that message already.) --- src/ejabberd_stun.erl | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/ejabberd_stun.erl b/src/ejabberd_stun.erl index e13dbbddc..5ce6c26af 100644 --- a/src/ejabberd_stun.erl +++ b/src/ejabberd_stun.erl @@ -106,7 +106,6 @@ prepare_turn_opts(Opts) -> prepare_turn_opts(Opts, _UseTurn = false) -> set_certfile(Opts); prepare_turn_opts(Opts, _UseTurn = true) -> - NumberOfMyHosts = length(ejabberd_option:hosts()), TurnIP = case proplists:get_value(turn_ipv4_address, Opts) of undefined -> MyIP = misc:get_my_ipv4_address(), @@ -129,18 +128,9 @@ prepare_turn_opts(Opts, _UseTurn = true) -> AuthType = proplists:get_value(auth_type, Opts, user), Realm = case proplists:get_value(auth_realm, Opts) of undefined when AuthType == user -> - if NumberOfMyHosts > 1 -> - ?INFO_MSG("You have several virtual hosts " - "configured, but option 'auth_realm' is " - "undefined and 'auth_type' is set to " - "'user', so the TURN relay might not be " - "working properly. Using ~ts as a " - "fallback", - [ejabberd_config:get_myname()]); - true -> - ok - end, - [{auth_realm, ejabberd_config:get_myname()}]; + MyName = ejabberd_config:get_myname(), + ?DEBUG("Using ~ts as TURN realm", [MyName]), + [{auth_realm, MyName}]; _ -> [] end,