Skip to main content

XMPP Webhook Bridge

Project description

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 example Rocket.Chat, Mattermost or Slack).

Install

xmppwb requires Python 3.4+ and depends on the following libraries, which can be installed using pip3:

pip3 install aiohttp pyyaml slixmpp

After cloning this repository you can run xmppwb like this:

python3 xmppwb.py --help

Configuration

A documented example config is provided in example.conf. A simple config file looks like this:

xmpp:
  jid: alice@example.com
  password: "<bot-password>"
  mucs:
    - jid: conference1@conference.example.com
      nickname: WebhookBridge
      password: "<muc-password>"
incoming_webhook_listener:
  bind_address: "127.0.0.1"
  port: 5000
bridges:
  - xmpp:
      - muc: conference1@conference.example.com
      - relay_all_normal: true
    webhooks:
      outgoing:
        - url: http://127.0.0.1:8065/hooks/<yourtoken>
          override_username: "{nick}"
      incoming:
        - token: <your-token2>

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.

Usage

This 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:

python3 xmppwb.py --config configfile.conf

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xmppwb-0.1.0.tar.gz (6.0 kB view details)

Uploaded Source

File details

Details for the file xmppwb-0.1.0.tar.gz.

File metadata

  • Download URL: xmppwb-0.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for xmppwb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f3cedaade1b8edd8326187a1c0913594f2659830fb28a65ca97f0dceacba7b75
MD5 f67b4aba393459c05fc3df5b553b6a80
BLAKE2b-256 f2829cecef781f4bc5a781b381ba8172c1651915a075d353b25e6aca3564e820

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page