25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

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 6eb2f07274 reduced the log level
of that message already.)
This commit is contained in:
Holger Weiss 2024-10-15 22:50:30 +02:00
parent 50ef49d190
commit 38f1132192

View File

@ -106,7 +106,6 @@ prepare_turn_opts(Opts) ->
prepare_turn_opts(Opts, _UseTurn = false) -> prepare_turn_opts(Opts, _UseTurn = false) ->
set_certfile(Opts); set_certfile(Opts);
prepare_turn_opts(Opts, _UseTurn = true) -> prepare_turn_opts(Opts, _UseTurn = true) ->
NumberOfMyHosts = length(ejabberd_option:hosts()),
TurnIP = case proplists:get_value(turn_ipv4_address, Opts) of TurnIP = case proplists:get_value(turn_ipv4_address, Opts) of
undefined -> undefined ->
MyIP = misc:get_my_ipv4_address(), MyIP = misc:get_my_ipv4_address(),
@ -129,18 +128,9 @@ prepare_turn_opts(Opts, _UseTurn = true) ->
AuthType = proplists:get_value(auth_type, Opts, user), AuthType = proplists:get_value(auth_type, Opts, user),
Realm = case proplists:get_value(auth_realm, Opts) of Realm = case proplists:get_value(auth_realm, Opts) of
undefined when AuthType == user -> undefined when AuthType == user ->
if NumberOfMyHosts > 1 -> MyName = ejabberd_config:get_myname(),
?INFO_MSG("You have several virtual hosts " ?DEBUG("Using ~ts as TURN realm", [MyName]),
"configured, but option 'auth_realm' is " [{auth_realm, MyName}];
"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()}];
_ -> _ ->
[] []
end, end,