25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-26 17:38:45 +01:00

Add global static shared_key option

This commit is contained in:
Evgeniy Khramtsov 2014-06-01 14:20:09 +04:00
parent f446e7fc0b
commit 9a0d77571d

View File

@ -68,8 +68,15 @@ start() ->
%% This start time is used by mod_last:
{MegaSecs, Secs, _} = now(),
UnixTime = MegaSecs*1000000 + Secs,
SharedKey = case erlang:get_cookie() of
nocookie ->
p1_sha:sha(randoms:get_string());
Cookie ->
p1_sha:sha(jlib:atom_to_binary(Cookie))
end,
State1 = set_option({node_start, global}, UnixTime, State),
set_opts(State1).
State2 = set_option({shared_key, global}, SharedKey, State1),
set_opts(State2).
%% @doc Get the filename of the ejabberd configuration file.
%% The filename can be specified with: erl -config "/path/to/ejabberd.yml".