|
| 1 | +# Zulip IRC Integration |
| 2 | + |
1 | 3 | Mirror an IRC channel in Zulip!
|
2 | 4 |
|
3 |
| -### Install the bridge software |
| 5 | +{start_tabs} |
4 | 6 |
|
5 |
| -1. Clone the Zulip API repository, and install its dependencies. |
| 7 | +1. {!download-python-bindings.md!} |
6 | 8 |
|
7 |
| - ``` |
8 |
| - git clone https://github.com/zulip/python-zulip-api.git |
9 |
| - cd python-zulip-api |
10 |
| - python3 ./tools/provision |
11 |
| - ``` |
| 9 | +1. {!install-requirements.md!} |
| 10 | + |
| 11 | +1. Register a nick that ends with the suffix "_zulip" on your IRC server. |
| 12 | + |
| 13 | +1. {!create-a-generic-bot.md!} |
12 | 14 |
|
13 |
| - This will create a new Python virtualenv. You'll run the bridge service |
14 |
| - inside this virtualenv. |
| 15 | + Download the `zuliprc` configuration file of your bot by clicking the |
| 16 | + download (<i class="fa fa-download"></i>) icon under the bot's name, and |
| 17 | + save to `~/.zuliprc`. |
15 | 18 |
|
16 |
| -1. Activate the virtualenv by running the `source` command printed |
17 |
| - at the end of the output of the previous step. |
| 19 | +1. [Subscribe the bot][subscribe-channels] to the Zulip channel that will |
| 20 | + contain the mirror. |
18 | 21 |
|
19 |
| -1. Go to the directory containing the bridge script if you haven't already done so |
| 22 | +1. Mirror the IRC channel to the Zulip channel by running the |
| 23 | + `irc-mirror.py` script with the |
| 24 | + [required command-line arguments](#required-arguments). Use the |
| 25 | + [optional arguments](#optional-arguments) to configure the mirroring |
| 26 | + behavior. |
| 27 | + |
| 28 | +1. Here's an example command that mirrors the `#python-mypy` channel on the |
| 29 | + `irc.freenode.net` server to the `mypy` topic on the `irc-discussions` |
| 30 | + channel on Zulip: |
20 | 31 |
|
21 | 32 | ```
|
22 |
| - cd zulip/integrations/bridge_with_irc |
| 33 | + python {{ integration_path }}/irc-mirror.py \ |
| 34 | + --irc-server=irc.freenode.net --channel='#python-mypy' --nick-prefix=irc_mirror \ |
| 35 | + --stream='irc-discussions' --topic='mypy' |
23 | 36 | ```
|
24 | 37 |
|
25 |
| -1. Install the bridge dependencies in your virtualenv, by running: |
| 38 | +{end_tabs} |
| 39 | +
|
| 40 | +You're done! |
| 41 | +
|
| 42 | +Your Zulip messages may look like: |
| 43 | +
|
| 44 | + |
26 | 45 |
|
27 |
| - ``` |
28 |
| - pip install -r requirements.txt |
29 |
| - ``` |
| 46 | +Your IRC messages may look like: |
30 | 47 |
|
31 |
| -### Configure the bridge |
| 48 | + |
32 | 49 |
|
33 |
| -1. {!create-a-generic-bot.md!} |
34 |
| - Download the bot's `zuliprc` configuration file to your computer. |
| 50 | +[subscribe-channels]: /help/manage-user-channel-subscriptions#subscribe-a-user-to-a-channel |
35 | 51 |
|
36 |
| -1. [Subscribe the bot](/help/subscribe-users-to-a-channel) to the Zulip |
37 |
| - stream that will contain the mirror. |
| 52 | +### Configuration options |
38 | 53 |
|
39 |
| -1. Inside the virtualenv you created above, run: |
| 54 | +The integration script accepts the following command-line arguments: |
40 | 55 |
|
41 |
| - ``` |
42 |
| - python irc-mirror.py --irc-server=IRC_SERVER --channel=<CHANNEL> --nick-prefix=<NICK> \ |
43 |
| - --stream=<STREAM> [--topic=<TOPIC>] \ |
44 |
| - --site=<zulip.site> --user=<bot-email> \ |
45 |
| - --api-key=<api-key> |
46 |
| - ``` |
| 56 | +#### Required arguments |
47 | 57 |
|
48 |
| - `--topic` is a Zulip topic, is optionally specified, defaults to "IRC". |
| 58 | +- `--irc-server`: The IRC server to mirror. |
49 | 59 |
|
50 |
| -Example command: |
| 60 | +- `--nick-prefix`: Your registered IRC nick must always end with "_zulip". |
| 61 | + Use the prefix of your IRC nick without the "_zulip" suffix. |
51 | 62 |
|
52 |
| -``` |
53 |
| -./irc-mirror.py --irc-server=irc.freenode.net --channel='#python-mypy' --nick-prefix=irc_mirror \ |
54 |
| ---stream='test here' --topic='#mypy' \ |
55 |
| ---site=" https://chat.zulip.org" --user= [email protected] \ |
56 |
| ---api-key=DeaDbEEf |
57 |
| -``` |
| 63 | +- `--channel`: The IRC channel to mirror. |
58 | 64 |
|
59 |
| -**Congratulations! You're done!** |
| 65 | +- `--stream`: The name of the Zulip channel you want to receive |
| 66 | + notifications in. By default, messages are sent to the `general` channel. |
60 | 67 |
|
61 |
| -Your Zulip messages may look like: |
| 68 | +#### Optional arguments |
62 | 69 |
|
63 |
| - |
| 70 | +- `--topic`: The name of the Zulip topic you want to receive notifications |
| 71 | + in. By default, messages are sent to the "IRC" topic. |
64 | 72 |
|
65 |
| -Your IRC messages may look like: |
| 73 | +- `--port`: The port to connect to the IRC server on. Defaults to 6667. |
66 | 74 |
|
67 |
| - |
| 75 | +- `--nickserv-pw`: Password corresponding to the IRC nick. |
| 76 | +
|
| 77 | +- `--sasl-password`: Password for SASL authentication. |
0 commit comments