Skip to content

Commit

Permalink
Merge pull request #4143 from esl/fix-live-start
Browse files Browse the repository at this point in the history
Fix "Unable to restart VM after applying CETS preset"
  • Loading branch information
chrzaszcz committed Oct 9, 2023
2 parents 507fcd5 + a54298f commit 27f7362
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions rel/files/mongooseim.toml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@
{{{mod_last}}}
{{/mod_last}}
[modules.mod_stream_management]
{{#stream_management_backend}}
backend = "{{{stream_management_backend}}}"
{{/stream_management_backend}}

{{#mod_offline}}
[modules.mod_offline]
Expand Down
4 changes: 3 additions & 1 deletion src/auth/ejabberd_auth_anonymous.erl
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@
-spec start(mongooseim:host_type()) -> ok.
start(HostType) ->
%% TODO: Check cluster mode
mongoose_mnesia:create_table(anonymous,
%% TODO: Add CETS backend, use mongoose_mnesia
mnesia:create_table(anonymous,
[{ram_copies, [node()]}, {type, bag},
{attributes, record_info(fields, anonymous)}]),
mnesia:add_table_copy(anonymous, node(), ram_copies),
%% The hooks are needed to add / remove users from the anonymous tables
gen_hook:add_handlers(hooks(HostType)),
ok.
Expand Down
4 changes: 3 additions & 1 deletion src/mod_register.erl
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@
start(HostType, #{iqdisc := IQDisc}) ->
[gen_iq_handler:add_iq_handler_for_domain(HostType, ?NS_REGISTER, Component, Fn, #{}, IQDisc) ||
{Component, Fn} <- iq_handlers()],
mongoose_mnesia:create_table(mod_register_ip,
%% TODO Add CETS backend, use mongoose_mnesia
mnesia:create_table(mod_register_ip,
[{ram_copies, [node()]},
{local_content, true},
{attributes, [key, value]}]),
mnesia:add_table_copy(mod_register_ip, node(), ram_copies),
ok.

-spec stop(mongooseim:host_type()) -> ok.
Expand Down

0 comments on commit 27f7362

Please sign in to comment.