Skip to content

Commit

Permalink
ejabberd_stun: Omit 'auth_realm' log message
Browse files Browse the repository at this point in the history
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 6eb2f07 reduced the log level
of that message already.)
  • Loading branch information
weiss committed Oct 15, 2024
1 parent 50ef49d commit 38f1132
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions src/ejabberd_stun.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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,
Expand Down

0 comments on commit 38f1132

Please sign in to comment.