25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Update mod_mqtt_bridge documentation

This commit is contained in:
Paweł Chmielowski 2023-01-16 15:33:37 +01:00
parent af2dae2ff3
commit 024f3be13a

View File

@ -173,17 +173,37 @@ mod_opt_type(servers) ->
%%%=================================================================== %%%===================================================================
mod_doc() -> mod_doc() ->
#{desc => #{desc =>
?T("This module adds ability to replicate data from or to external servers. " [?T("This module adds ability to synchronize local MQTT topics with data on remote servers"),
"It is available since ejabberd 23.01."), ?T("It can update topics on remote servers when local user updates local topic, or can subscribe "
"for changes on remote server, and update local copy when remote data is updated."),
?T("It is available since ejabberd 23.01.")],
example =>
["modules:",
" ...",
" mod_mqtt_bridge:",
" servers:",
" \"mqtt://server.com\":",
" publish:"
" \"localA\": \"remoteA\" # local changes to 'localA' will be replicated on remote server as 'remoteA'"
" \"topicB\": \"topicB\""
" subscribe:"
" \"remoteB\": \"localB\" # changes to 'remoteB' on remote server will be stored as 'localB' on local server",
" authentication:"
" certfile: \"/etc/ejabberd/mqtt_server.pem\"",
" replication_user: \"mqtt@xmpp.server.com\"",
" ..."],
opts => opts =>
[{servers, [{servers,
#{value => "{ServerUrl: Replication informations}", #{value => "{ServerUrl: {publish: [TopicPairs], subscribe: [TopicPairs], authentication: {username: User, password: Pass} | {certfile: PathToPemFile}}",
desc => desc =>
?T("Main entry point to define which topics should be replicated.")}}, ?T("Declaration of data to share, must contain 'publish' or 'subscribe' or both, and 'authentication' "
"section with username/password field or certfile pointing to client certifcate. "
"Accepted urls can use schema mqtt, mqtts (mqtt with tls), mqtt5, mqtt5s (both to trigger v5 protocol), "
"ws, wss, ws5, wss5. Certifcate authentication can be only used with mqtts, mqtt5s, wss, wss5.")}},
{replication_user, {replication_user,
#{value => "JID", #{value => "JID",
desc => desc =>
?T("Identifier of a user which will own all local modifications.")}}]}. ?T("Identifier of a user that will be assigned as owner of local changes.")}}]}.
%%%=================================================================== %%%===================================================================
%%% Internal functions %%% Internal functions