Skip to content

Commit

Permalink
Revert using mongoose_mnesia in ejabberd_auth_anonymous and mod_register
Browse files Browse the repository at this point in the history
It makes it impossible to start in the default configuration
Changing default configuration could be a separate issue
(Or we rather add CETS backends for these two modules - sounds easier)
  • Loading branch information
arcusfelis committed Oct 9, 2023
1 parent 507fcd5 commit 4945f21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
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 4945f21

Please sign in to comment.