Package: xmppwb
Note that xmppwb is currently in early development and may contain bugs.A bot that bridges XMPP (chats and MUCs) with webhooks, thus making it possible
to interact with services outside the XMPP world. This can be used to connect
XMPP to other chat services that provide a webhook API (for exampleRocket.ChatorMattermost).InstallationUsageConfigurationIntegrating with Rocket.ChatIntegrating with MattermostLicenseInstallationNote: Python 3.5 is required. It will not work with Python 3.4 as xmppwb uses specific syntax that was introduced with Python 3.5.xmppwbrequiresPython 3.5+and can be installed using pip3:$pip3install--upgradexmppwbwhich will automatically install the dependencies (aiohttp,pyyamlandslixmpp).UsageThis bridge is meant to run on the same server as the application you are
bridging with, as it currently uses HTTP for incoming webhooks.To run the bridge:$xmppwb--configconfigfile.confor:$python3-mxmppwb--configconfigfile.confSynopsis:$xmppwb-cCONFIG[-h][-v][-lLOGFILE][-d][--version]See alsoxmppwb--help.ConfigurationPlease seeCONFIGURATION.rstfor detailed documentation. A simple config file looks like this (the<placeholders>need to be changed):xmpp:# This JID must exist.jid:<alice@example.com>password:"<bot-password>"# Define all MUCs that should be available to the bridges defined later.mucs:-jid:<conference1@conference.example.com>nickname:<nickname># password: "<muc-password>"incoming_webhook_listener:bind_address:"127.0.0.1"port:5000bridges:-xmpp_endpoints:-muc:<conference1@conference.example.com>outgoing_webhooks:-url:<incoming-webhook-url-from-other-end>incoming_webhooks:-token:<outgoing-webhook-token-from-other-end>Note that the password is stored in cleartext, so take precautions such as
restricting file permissions. It is recommended to use a dedicated JID for
this bridge.The terminologyincomingandoutgoingin the config file refers to
webhooks from the perspective of this bridge. The webhooks must also be defined
on the other end (Rocket.Chat and Mattermost provide a UI for this, for
example). Anoutgoing webhook in Rocket.Chatmust be set up in theincoming webhooks section in this bridgeand vice versa.Integrating with Rocket.ChatAn example config for bridging XMPP withRocket.Chatis provided inrocketchat.example.conf.
It is recommended to copy it and fill out all<placeholders>.To create the corresponding webhooks in RocketChat, go toAdministration->Integrationsand create a new incoming webhook.
Here you can select the channel that you want to bridge with.After saving, a webhook URL will be generated. Copy it and fill it into
the<incoming-webhook-url-from-rocketchat>placeholder in the config
file.Now create an outgoing webhook. The URL is of the formhttp://{bind_adress}:{port}/and depends on your settings in theincoming_webhook_listenersection. It defaults tohttp://127.0.0.1:5000/.Copy the token and fill it into the<outgoing-webhook-token-from-rocketchat>placeholder.After having filled out all other placeholders, the bridge is ready to run
(seeusage).Integrating with MattermostAn example config for bridging XMPP withMattermostis provided inmattermost.example.conf.
It is recommended to copy it and fill out all<placeholders>.To create the corresponding webhooks in Mattermost, go toAccount Settings->Integrationsand create a new incoming webhook.
Here you can select the channel that you want to bridge with.After saving, a webhook URL will be generated. Copy it and fill it into
the<incoming-webhook-url-from-mattermost>placeholder in the config
file.Now create an outgoing webhook. The callback URL is of the formhttp://{bind_adress}:{port}/and depends on your settings in theincoming_webhook_listenersection. It defaults tohttp://127.0.0.1:5000/.After saving, copy the token and fill it into the<outgoing-webhook-token-from-mattermost>placeholder.After having filled out all other placeholders, the bridge is ready to run
(seeusage).Licensexmppwb is released under the MIT license. Please readLICENSEfor details.