Skip to main content

"Matrix IRC bridge"

Project description

Heisenbridge

a bouncer-style Matrix IRC bridge.

Heisenbridge brings IRC to Matrix by creating an environment where every user connects to each network individually like they would with a traditional IRC bouncer. Simplicity is achieved by exposing IRC in the most straightforward way as possible where it makes sense so it feels familiar for long time IRC users.

Please file an issue when you find something is missing or isn't working that you'd like to see fixed. Pull requests are more than welcome!

Support and development discussion in #heisenbridge:vi.fi on Matrix or by joining #heisenbridge on Libera.Chat IRC network. The IRC channel is plumbed with Heisenbridge to Matrix using the relaybot mode.

Features

  • "zero configuration" - no databases or storage required
  • brings IRC to Matrix rather than Matrix to IRC - not annoying to folks on IRC
  • completely managed through admin room - just DM @heisenbridge!
  • channel management through bridge bot - type heisenbridge: help to get started!
  • online help within Matrix
  • access control for local and federated users
  • fully puppeted users from IRC, they come and go as they would on Matrix
  • tested with up to 2000 users in a single channel
  • optional room plumbing with single puppeting on Matrix <-> relaybot on IRC
  • IRCnet !channels are supported, you're welcome
  • any number of IRC networks and users technically possible
  • channel customization by setting the name and avatar
  • TLS support for networks that have it
  • customizable ident support
  • long message splitting directly to IRC
  • automatic identify/auth with server password or command on connect

Comparison

To help understand where Heisenbridge is a good fit here's a feature matrix of some of the key differences between other popular solutions:

Matrix IRC Appservice Ratelimit Self-host Permissions
Heisenbridge (bouncer) one one yes no yes IRC only
Heisenbridge (relaybot) many one yes IRC yes separate
matrix-appservice-irc many many yes no no synchronized
matterbridge one one no both only separate

Matrix = actual users on Matrix
IRC = connected users to IRC from Matrix
Appservice = runs as an appservice (requires a homeserver)
Ratelimit = perceived ratelimiting in default setup (Matrix/IRC)
Self-host = is it recommended to run your own instance
Permissions = how room/channel permissions are managed (Matrix/IRC)

Heisenbridge in bouncer mode has one direct Matrix user per IRC connection and IRC users are puppeted on Matrix. The Matrix users identity is directly mapped to IRC and they are in full control. There are no Matrix side permission management in this mode as all channels and private messages are between the Matrix user and the bridge. Multiple authorized Matrix users can use the bridge separately to create their own IRC connections.

Heisenbridge in relaybot mode is part of a larger Matrix room and puppets everyone from IRC separately but still has only one IRC connection for relaying messages from Matrix. Matrix users' identities are only relayed through the messages they send. Permissions in this mode are separate meaning the bridge needs to be given explicit permission to join a Matrix room if it's not public. The bridge only requires enough power levels to invite puppets (if the room is invite-only) and for them to be able to talk with the default power level they get. Single authorized Matrix user manages the relaybot with Heisenbridge.

matrix-appservice-irc runs in full single puppeting mode where both IRC and Matrix users are puppeted both ways. The Matrix users identity is directly mapped to IRC and they are in full control. This method of bridging creates multiple IRC connections which makes is mostly transparent for both sides of the bridge. As the room and channel permissions are synchronized between IRC and Matrix (where applicable) means a Matrix user joining a Matrix room needs to be able to connect and join the IRC channel through the bridge as well. Any Matrix user joining plumbed or portal IRC rooms are automatically connected to the IRC network.

matterbridge is a bot which connects to each network as a single user and is fairly easy and quick to setup by anyone. Both IRC and Matrix users' identities are only relayed through the messages they send. The bot operator manages everything and does not require any user interaction on either side.

Docker

The master branch is automatically published to Docker Hub:

docker pull hif1/heisenbridge
docker run --rm hif1/heisenbridge -h

Additionally, if you use matrix-docker-ansible-deploy to deploy your Synapse server, you can use it to integrate Heisenbridge as well - just follow the relevant docs

Usage

usage: python -m heisenbridge [-h] [-v] -c CONFIG [-l LISTEN_ADDRESS]
                              [-p LISTEN_PORT] [-u UID] [-g GID] [-i]
                              [--identd-port IDENTD_PORT] [--generate]
                              [--reset] [-o OWNER]
                              [homeserver]

a bouncer-style Matrix IRC bridge

positional arguments:
  homeserver            URL of Matrix homeserver (default:
                        http://localhost:8008)

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose         logging verbosity level: once is info, twice is debug
                        (default: 0)
  -c CONFIG, --config CONFIG
                        registration YAML file path, must be writable if
                        generating (default: None)
  -l LISTEN_ADDRESS, --listen-address LISTEN_ADDRESS
                        bridge listen address (default: 127.0.0.1)
  -p LISTEN_PORT, --listen-port LISTEN_PORT
                        bridge listen port (default: 9898)
  -u UID, --uid UID     user id to run as (default: None)
  -g GID, --gid GID     group id to run as (default: None)
  -i, --identd          enable identd service (default: False)
  --identd-port IDENTD_PORT
                        identd listen port (default: 113)
  --generate            generate registration YAML for Matrix homeserver
  --reset               reset ALL bridge configuration from homeserver and
                        exit
  -o OWNER, --owner OWNER
                        set owner MXID (eg: @user:homeserver) or first talking
                        local user will claim the bridge (default: None)

Install

  1. Install Python 3.6 or newer

  2. Install dependencies in virtualenv

    virtualenv venv
    source venv/bin/activate
    pip install git+https://github.com/hifi/heisenbridge
    
  3. Generate registration YAML

    python -m heisenbridge -c /path/to/synapse/config/heisenbridge.yaml --generate
    
  4. Add heisenbridge.yaml to Synapse appservice list

  5. (Re)start Synapse

  6. Start Heisenbridge

    python -m heisenbridge -c /path/to/synapse/config/heisenbridge.yaml
    
  7. Start a DM with @heisenbridge:your.homeserver to get online usage help

To update your installation, run pip install --upgrade --force-reinstall git+https://github.com/hifi/heisenbridge

Develop

  1. Install Python 3.6 or newer

  2. Install dependencies

    virtualenv venv
    source venv/bin/activate
    pip install -e .[dev,test]
    
  3. (Optional) Set up pre-commit hooks

    pre-commit install
    

The pre-commit hooks are run by the CI as well.

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

heisenbridge-1.1.1.tar.gz (47.7 kB view details)

Uploaded Source

File details

Details for the file heisenbridge-1.1.1.tar.gz.

File metadata

  • Download URL: heisenbridge-1.1.1.tar.gz
  • Upload date:
  • Size: 47.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.4.2 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.5

File hashes

Hashes for heisenbridge-1.1.1.tar.gz
Algorithm Hash digest
SHA256 691b7104f876f26d3061efde3bbad21acb83b510d4d7e7bc293945f4480b5669
MD5 8f6f90031684947baae36bda9c8da20f
BLAKE2b-256 3118f5aad2a9989bd10fcf5165d4e42f515c430767a059d152f9f3189a779fcd

See more details on using hashes here.

Supported by

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