• 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

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

27
-module(mod_time).
28

29
-author('alexey@process-one.net').
30

31
-protocol({xep, 202, '2.0', '2.1.0', "complete", ""}).
32

33
-behaviour(gen_mod).
34

35
-export([start/2, stop/1, reload/3, process_local_iq/1,
36
         mod_options/1, depends/2, mod_doc/0]).
37

38
-include("logger.hrl").
39
-include_lib("xmpp/include/xmpp.hrl").
40
-include("translate.hrl").
41

42
start(_Host, _Opts) ->
43
    {ok, [{iq_handler, ejabberd_local, ?NS_TIME, process_local_iq}]}.
144✔
44

45
stop(_Host) ->
46
    ok.
144✔
47

48
reload(_Host, _NewOpts, _OldOpts) ->
49
    ok.
×
50

51
-spec process_local_iq(iq()) -> iq().
52
process_local_iq(#iq{type = set, lang = Lang} = IQ) ->
53
    Txt = ?T("Value 'set' of 'type' attribute is not allowed"),
×
54
    xmpp:make_error(IQ, xmpp:err_not_allowed(Txt, Lang));
×
55
process_local_iq(#iq{type = get} = IQ) ->
UNCOV
56
    Now = os:timestamp(),
2✔
UNCOV
57
    Now_universal = calendar:now_to_universal_time(Now),
2✔
UNCOV
58
    Now_local = calendar:universal_time_to_local_time(Now_universal),
2✔
UNCOV
59
    Seconds_diff =
2✔
60
        calendar:datetime_to_gregorian_seconds(Now_local) -
61
        calendar:datetime_to_gregorian_seconds(Now_universal),
UNCOV
62
    {Hd, Md, _} = calendar:seconds_to_time(abs(Seconds_diff)),
2✔
UNCOV
63
    xmpp:make_iq_result(IQ, #time{tzo = {Hd, Md}, utc = Now}).
2✔
64

65
depends(_Host, _Opts) ->
66
    [].
180✔
67

68
mod_options(_Host) ->
69
    [].
180✔
70

71
mod_doc() ->
72
    #{desc =>
×
73
          ?T("This module adds support for "
74
             "https://xmpp.org/extensions/xep-0202.html"
75
             "[XEP-0202: Entity Time]. In other words, "
76
             "the module reports server's system time.")}.
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

© 2026 Coveralls, Inc