diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c747e16b..0c7828fea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -146,7 +146,7 @@ jobs: - name: Run XMPP Interoperability Tests against CI server. if: matrix.otp == '27' continue-on-error: true - uses: XMPP-Interop-Testing/xmpp-interop-tests-action@v1.5.0 + uses: XMPP-Interop-Testing/xmpp-interop-tests-action@v1.6.0 with: domain: 'localhost' adminAccountUsername: 'admin' diff --git a/src/mod_conversejs.erl b/src/mod_conversejs.erl index c8ba4eb63..280bd8088 100644 --- a/src/mod_conversejs.erl +++ b/src/mod_conversejs.erl @@ -64,6 +64,7 @@ process([], #request{method = 'GET', host = Host, q = Query, raw_path = RawPath1 CSS = get_file_url(Host, conversejs_css, <>, <<"https://cdn.conversejs.org/dist/converse.min.css">>), + PluginsHtml = get_plugins_html(Host, RawPath), Init = [{<<"discover_connection_methods">>, false}, {<<"default_domain">>, Domain}, {<<"domain_placeholder">>, Domain}, @@ -89,7 +90,8 @@ process([], #request{method = 'GET', host = Host, q = Query, raw_path = RawPath1 <<"">>, <<"">>, - <<"">>, + <<"">> + ] ++ PluginsHtml ++ [ <<"">>, <<"">>, <<"">> + end, + gen_mod:get_module_opt(Host, ?MODULE, conversejs_plugins)). + %%---------------------------------------------------------------------- %% WebAdmin link and autologin %%---------------------------------------------------------------------- @@ -305,6 +327,8 @@ mod_opt_type(conversejs_script) -> econf:binary(); mod_opt_type(conversejs_css) -> econf:binary(); +mod_opt_type(conversejs_plugins) -> + econf:list(econf:binary()); mod_opt_type(default_domain) -> econf:host(). @@ -315,6 +339,7 @@ mod_options(Host) -> {conversejs_resources, undefined}, {conversejs_options, []}, {conversejs_script, auto}, + {conversejs_plugins, []}, {conversejs_css, auto}]. mod_doc() -> @@ -345,6 +370,7 @@ mod_doc() -> "modules:", " mod_bosh: {}", " mod_conversejs:", + " conversejs_plugins: [\"libsignal\"]", " websocket_url: \"ws://@HOST@:5280/websocket\""]}, {?T("Host Converse locally and let auto detection of WebSocket and Converse URLs:"), ["listen:", @@ -358,7 +384,9 @@ mod_doc() -> "", "modules:", " mod_conversejs:", - " conversejs_resources: \"/home/ejabberd/conversejs-9.0.0/package/dist\""]}, + " conversejs_resources: \"/home/ejabberd/conversejs-x.y.z/package/dist\"", + " conversejs_plugins: [\"libsignal-protocol.min.js\"]", + " # File path is: /home/ejabberd/conversejs-x.y.z/package/dist/plugins/libsignal-protocol.min.js"]}, {?T("Configure some additional options for Converse"), ["modules:", " mod_conversejs:", @@ -410,6 +438,15 @@ mod_doc() -> "See https://conversejs.org/docs/html/configuration.html[Converse configuration]. " "Only boolean, integer and string values are supported; " "lists are not supported.")}}, + {conversejs_plugins, + #{value => ?T("[Filename]"), + desc => + ?T("List of additional local files to include as scripts in the homepage. " + "Please make sure those files are available in the path specified in " + "'conversejs_resources' option, in subdirectory 'plugins/'. " + "If using the public Converse client, then '\"libsignal\"' " + "gets replaced with the URL of the public library. " + "The default value is '[]'.")}}, {conversejs_script, #{value => ?T("auto | URL"), desc =>