1
1
# Matrix <--> Zulip bridge
2
2
3
- This acts as a bridge between Matrix and Zulip. It also enables a
4
- Zulip topic to be federated between two Zulip servers.
3
+ This acts as a bridge between Matrix and Zulip.
5
4
6
- ## Usage
5
+ ### Enhanced Features
6
+ - Supporting multiple (Zulip topic, Matrix channel)-pairs.
7
+ - Handling files according to their mimetype.
7
8
8
- ### For IRC bridges
9
9
10
- Matrix has been bridged to the listed
11
- [ IRC networks] ( https://github.com/matrix-org/matrix-appservice-irc/wiki/Bridged-IRC-networks ) ,
12
- where the 'Room alias format' refers to the ` room_id ` for the corresponding IRC channel.
10
+ ## Installation
13
11
14
- For example, for the freenode channel ` #zulip-test ` , the ` room_id ` would be
15
- ` #freenode_#zulip-test:matrix.org ` .
12
+ Run ` pip install -r requirements.txt ` in order to install the requirements.
13
+
14
+ Please note that the ` libmagic ` -library is required to be installed on your
15
+ system, which is usually the case on Linux systems. On Windows, you need to
16
+ additionally run ` pip install -r requirements_windows.txt ` in order to add
17
+ ` python-magic-bin ` which ships the necessary DLLs.
18
+
19
+ In case you'd like encryption to work, you need pip to install the ` matrix-nio `
20
+ package with e2e support:
21
+ - First, you need to make sure that the development files of the ` libolm `
22
+ C-library are installed on your system! See [ the corresponding documentation
23
+ of matrix-nio] ( https://github.com/poljar/matrix-nio#installation ) for further
24
+ information on this point.
25
+ - ` pip install matrix-nio[e2e] `
16
26
17
- Hence, this can also be used as a IRC <--> Zulip bridge.
18
27
19
28
## Steps to configure the Matrix bridge
20
29
@@ -27,19 +36,43 @@ details mentioned below. For example:
27
36
* If you are running from the Zulip GitHub repo: ` python matrix_bridge.py --write-sample-config matrix_bridge.conf `
28
37
29
38
### 1. Zulip endpoint
30
- 1 . Create a generic Zulip bot, with a full name like ` IRC Bot ` or ` Matrix Bot ` .
31
- 2 . Subscribe the bot user to the stream you'd like to bridge your IRC or Matrix
32
- channel into.
39
+ 1 . Create a generic Zulip bot, with a full name such as ` Matrix Bot ` .
40
+ 2 . The bot is able to subscribe to the necessary streams itself if they are
41
+ public. (It may even create them if they do not exist and if the bot user
42
+ has enough rights to create streams.)
43
+ Otherwise, you need to add the bot manually.
33
44
3 . In the ` zulip ` section of the configuration file, enter the bot's ` zuliprc `
34
45
details (` email ` , ` api_key ` , and ` site ` ).
35
46
4 . In the same section, also enter the Zulip ` stream ` and ` topic ` .
36
47
37
48
### 2. Matrix endpoint
38
- 1 . Create a user on [ matrix.org] ( https://matrix.org/ ) , preferably with
39
- a formal name like to ` zulip-bot ` .
40
- 2 . In the ` matrix ` section of the configuration file, enter the user's username
41
- and password.
42
- 3 . Also enter the ` host ` and ` room_id ` into the same section.
49
+ 1 . Create a user on the matrix server of your choice, e.g. [ matrix.org] ( https://matrix.org/ ) ,
50
+ preferably with a descriptive name such as ` zulip-bot ` .
51
+ 2 . In the ` matrix ` section of the configuration file, enter the user's Matrix
52
+ user ID ` mxid ` and password. Please use the Matrix user ID ([ MXID] ( https://matrix.org/faq/#what-is-a-mxid%3F ) )
53
+ as format for the username!
54
+ 3 . Create the Matrix room(s) to be bridged in case they do not exits yet.
55
+ Remember to invite the bot to private rooms! Otherwise, this error will be
56
+ thrown: ` Matrix bridge error: JoinError: M_UNKNOWN No known servers ` .
57
+ 4 . Enter the ` host ` and ` room_id ` into the same section.
58
+ In case the room is private you need to use the ` Internal room ID ` which has
59
+ the format ` !aBcDeFgHiJkLmNoPqR:example.org ` .
60
+ In the official Matrix client [ Element] ( https://github.com/vector-im ) , you
61
+ can find this ` Internal room ID ` in the ` Room Settings ` under ` Advanced ` .
62
+
63
+ ### Adding more (Zulip topic, Matrix channel)-pairs
64
+ 1 . Create a new section with a name starting with ` additional_bridge ` .
65
+ 2 . Add a ` room_id ` for the Matrix side and a ` stream ` and a ` topic ` for the
66
+ Zulip side.
67
+
68
+ Example:
69
+ ```
70
+ [additional_bridge1]
71
+ room_id = #zulip:matrix.org
72
+ stream = matrix test
73
+ topic = matrix test topic
74
+ ```
75
+
43
76
44
77
## Running the bridge
45
78
@@ -50,9 +83,29 @@ in a file called `matrix_bridge.conf`:
50
83
51
84
* If you are running from the Zulip GitHub repo: run ` python matrix_bridge.py -c matrix_bridge.conf `
52
85
53
- ## Caveats for IRC mirroring
86
+
87
+ ## Notes regarding IRC
88
+
89
+ ### Usage for IRC bridges
90
+
91
+ This can also be used to indirectly bridge between IRC and Zulip.
92
+
93
+ Matrix has been bridged to the listed
94
+ [ IRC networks] ( https://github.com/matrix-org/matrix-appservice-irc/wiki/Bridged-IRC-networks ) ,
95
+ where the 'Room alias format' refers to the ` room_id ` for the corresponding IRC channel.
96
+
97
+ For example, for the freenode channel ` #zulip-test ` , the ` room_id ` would be
98
+ ` #freenode_#zulip-test:matrix.org ` .
99
+
100
+ ### Caveats for IRC mirroring
54
101
55
102
There are certain
56
103
[ IRC channels] ( https://github.com/matrix-org/matrix-appservice-irc/wiki/Channels-from-which-the-IRC-bridge-is-banned )
57
104
where the Matrix.org IRC bridge has been banned for technical reasons.
58
105
You can't mirror those IRC channels using this integration.
106
+
107
+
108
+ ## TODO
109
+
110
+ - Adding support for editing and deleting messages?
111
+ - Handling encryption on the Matrix side (may need further discussion).
0 commit comments