• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

processone / ejabberd / 1212

18 Nov 2025 12:37PM UTC coverage: 33.784% (+0.003%) from 33.781%
1212

push

github

badlop
mod_conversejs: Improve link to conversejs in WebAdmin (#4495)

Until now, the WebAdmin menu included a link to the first request handler
with mod_conversejs that the admin configured in ejabberd.yml
That link included the authentication credentials hashed as URI arguments
if using HTTPS. Then process/2 extracted those arguments and passed them
as autologin options to Converse.

From now, mod_conversejs automatically adds a request_handler nested in
webadmin subpath. The webadmin menu links to that converse URI; this allows
to access the HTTP auth credentials, no need to explicitly pass them.
process/2 extracts this HTTP auth and passes autologin options to Converse.
Now scram password storage is supported too.

This minimum configuration allows WebAdmin to access Converse:

listen:
  -
    port: 5443
    module: ejabberd_http
    tls: true
    request_handlers:
      /admin: ejabberd_web_admin
      /ws: ejabberd_http_ws
modules:
  mod_conversejs:
    conversejs_resources: "/home/conversejs/12.0.0/dist"

0 of 12 new or added lines in 1 file covered. (0.0%)

11290 existing lines in 174 files now uncovered.

15515 of 45924 relevant lines covered (33.78%)

1277.8 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/mod_pubsub_sql.erl
1
%%%----------------------------------------------------------------------
2
%%% ejabberd, Copyright (C) 2002-2025   ProcessOne
3
%%%
4
%%% This program is free software; you can redistribute it and/or
5
%%% modify it under the terms of the GNU General Public License as
6
%%% published by the Free Software Foundation; either version 2 of the
7
%%% License, or (at your option) any later version.
8
%%%
9
%%% This program is distributed in the hope that it will be useful,
10
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
11
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
%%% General Public License for more details.
13
%%%
14
%%% You should have received a copy of the GNU General Public License along
15
%%% with this program; if not, write to the Free Software Foundation, Inc.,
16
%%% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
%%%
18
%%%----------------------------------------------------------------------
19
-module(mod_pubsub_sql).
20

21
%% API
22
-export([init/3]).
23
-export([sql_schemas/0]).
24

25
-include("ejabberd_sql_pt.hrl").
26

27
%%%===================================================================
28
%%% API
29
%%%===================================================================
30
init(_Host, ServerHost, _Opts) ->
UNCOV
31
    ejabberd_sql_schema:update_schema(ServerHost, ?MODULE, sql_schemas()),
7✔
UNCOV
32
    ok.
7✔
33

34
%%%===================================================================
35
%%% Internal functions
36
%%%===================================================================
37
sql_schemas() ->
UNCOV
38
    [#sql_schema{
7✔
39
        version = 1,
40
        tables =
41
            [#sql_table{
42
                name = <<"pubsub_node">>,
43
                columns =
44
                    [#sql_column{name = <<"host">>, type = text},
45
                     #sql_column{name = <<"node">>, type = text},
46
                     #sql_column{name = <<"parent">>, type = text,
47
                                 default = true},
48
                     #sql_column{name = <<"plugin">>, type = text},
49
                     #sql_column{name = <<"nodeid">>, type = bigserial}],
50
                indices = [#sql_index{
51
                              columns = [<<"nodeid">>],
52
                              unique = true},
53
                           #sql_index{
54
                              columns = [<<"parent">>]},
55
                           #sql_index{
56
                              columns = [<<"host">>, <<"node">>],
57
                              unique = true}]},
58
             #sql_table{
59
                name = <<"pubsub_node_option">>,
60
                columns =
61
                    [#sql_column{name = <<"nodeid">>, type = bigint,
62
                                 opts = [#sql_references{
63
                                            table = <<"pubsub_node">>,
64
                                            column = <<"nodeid">>}]},
65
                     #sql_column{name = <<"name">>, type = text},
66
                     #sql_column{name = <<"val">>, type = text}],
67
                indices = [#sql_index{columns = [<<"nodeid">>]}]},
68
             #sql_table{
69
                name = <<"pubsub_node_owner">>,
70
                columns =
71
                    [#sql_column{name = <<"nodeid">>, type = bigint,
72
                                 opts = [#sql_references{
73
                                            table = <<"pubsub_node">>,
74
                                            column = <<"nodeid">>}]},
75
                     #sql_column{name = <<"owner">>, type = text}],
76
                indices = [#sql_index{columns = [<<"nodeid">>]}]},
77
             #sql_table{
78
                name = <<"pubsub_state">>,
79
                columns =
80
                    [#sql_column{name = <<"nodeid">>, type = bigint,
81
                                 opts = [#sql_references{
82
                                            table = <<"pubsub_node">>,
83
                                            column = <<"nodeid">>}]},
84
                     #sql_column{name = <<"jid">>, type = text},
85
                     #sql_column{name = <<"affiliation">>, type = {char, 1}},
86
                     #sql_column{name = <<"subscriptions">>, type = text,
87
                                 default = true},
88
                     #sql_column{name = <<"stateid">>, type = bigserial}],
89
                indices = [#sql_index{columns = [<<"stateid">>],
90
                                      unique = true},
91
                           #sql_index{columns = [<<"jid">>]},
92
                           #sql_index{columns = [<<"nodeid">>, <<"jid">>],
93
                                      unique = true}]},
94
             #sql_table{
95
                name = <<"pubsub_item">>,
96
                columns =
97
                    [#sql_column{name = <<"nodeid">>, type = bigint,
98
                                 opts = [#sql_references{
99
                                            table = <<"pubsub_node">>,
100
                                            column = <<"nodeid">>}]},
101
                     #sql_column{name = <<"itemid">>, type = text},
102
                     #sql_column{name = <<"publisher">>, type = text},
103
                     #sql_column{name = <<"creation">>, type = {text, 32}},
104
                     #sql_column{name = <<"modification">>, type = {text, 32}},
105
                     #sql_column{name = <<"payload">>, type = {text, big},
106
                                 default = true}],
107
                indices = [#sql_index{columns = [<<"nodeid">>, <<"itemid">>],
108
                                      unique = true},
109
                           #sql_index{columns = [<<"itemid">>]}]},
110
             #sql_table{
111
                name = <<"pubsub_subscription_opt">>,
112
                columns =
113
                    [#sql_column{name = <<"subid">>, type = text},
114
                     #sql_column{name = <<"opt_name">>, type = {text, 32}},
115
                     #sql_column{name = <<"opt_value">>, type = text}],
116
                indices = [#sql_index{columns = [<<"subid">>, <<"opt_name">>],
117
                                      unique = true}]}]}].
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc