5428c5f296
Generated by com2ann (slightly patched to avoid also converting assignment type annotations, which require Python 3.6), followed by some manual whitespace adjustment, and two fixes for use-before-define issues: - def set_zulip_client(self, zulipToJabberClient: ZulipToJabberBot) -> None: + def set_zulip_client(self, zulipToJabberClient: 'ZulipToJabberBot') -> None: -def init_from_options(options: Any, client: Optional[str] = None) -> Client: +def init_from_options(options: Any, client: Optional[str] = None) -> 'Client': Signed-off-by: Anders Kaseorg <anders@zulipchat.com> |
||
---|---|---|
.. | ||
__init__.py | ||
matrix_bridge.py | ||
README.md | ||
requirements.txt | ||
test_matrix.py |
Matrix <--> Zulip bridge
This acts as a bridge between Matrix and Zulip. It also enables a Zulip topic to be federated between two Zulip servers.
Usage
For IRC bridges
Matrix has been bridged to the listed
IRC networks,
where the 'Room alias format' refers to the room_id
for the corresponding IRC channel.
For example, for the freenode channel #zulip-test
, the room_id
would be
#freenode_#zulip-test:matrix.org
.
Hence, this can also be used as a IRC <--> Zulip bridge.
Steps to configure the Matrix bridge
To obtain a configuration file template, run the script with the
--write-sample-config
option to obtain a configuration file to fill in the
details mentioned below. For example:
-
If you installed the
zulip
package:zulip-matrix-bridge --write-sample-config matrix_bridge.conf
-
If you are running from the Zulip GitHub repo:
python matrix_bridge.py --write-sample-config matrix_bridge.conf
1. Zulip endpoint
- Create a generic Zulip bot, with a full name like
IRC Bot
orMatrix Bot
. - Subscribe the bot user to the stream you'd like to bridge your IRC or Matrix channel into.
- In the
zulip
section of the configuration file, enter the bot'szuliprc
details (email
,api_key
, andsite
). - In the same section, also enter the Zulip
stream
andtopic
.
2. Matrix endpoint
- Create a user on matrix.org, preferably with
a formal name like to
zulip-bot
. - In the
matrix
section of the configuration file, enter the user's username and password. - Also enter the
host
androom_id
into the same section.
Running the bridge
After the steps above have been completed, assuming you have the configuration
in a file called matrix_bridge.conf
:
-
If you installed the
zulip
package: runzulip-matrix-bridge -c matrix_bridge.conf
-
If you are running from the Zulip GitHub repo: run
python matrix_bridge.py -c matrix_bridge.conf
Caveats for IRC mirroring
There are certain IRC channels where the Matrix.org IRC bridge has been banned for technical reasons. You can't mirror those IRC channels using this integration.