Skip to content

Commit c120820

Browse files
committed
integration-docs: Update the doc of the IRC bridge integration.
1 parent 3a2c96e commit c120820

File tree

1 file changed

+49
-42
lines changed
  • zulip/integrations/bridge_with_irc

1 file changed

+49
-42
lines changed
Lines changed: 49 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,74 @@
1+
# Zulip IRC Integration
2+
13
Mirror an IRC channel in Zulip!
24

3-
### Install the bridge software
5+
{start_tabs}
46

5-
1. Clone the Zulip API repository, and install its dependencies.
7+
1. {!download-python-bindings.md!}
68

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.
1212

13-
This will create a new Python virtualenv. You'll run the bridge service
14-
inside this virtualenv.
13+
1. {!create-a-generic-bot.md!}
1514

16-
1. Activate the virtualenv by running the `source` command printed
17-
at the end of the output of the previous step.
15+
1. 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`.
1818

19-
1. Go to the directory containing the bridge script if you haven't already done so
19+
1. [Subscribe the bot][subscribe-channels] to the Zulip channel that will
20+
contain the mirror.
21+
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+
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:
2031

2132
```
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'
2336
```
2437
25-
1. Install the bridge dependencies in your virtualenv, by running:
38+
{end_tabs}
2639
27-
```
28-
pip install -r requirements.txt
29-
```
40+
You're done! Messages in your Zulip channel may look like:
3041
31-
### Configure the bridge
42+
![IRC message on Zulip](/static/images/integrations/irc/001.png)
3243
33-
1. {!create-a-generic-bot.md!}
34-
Download the bot's `zuliprc` configuration file to your computer.
44+
Messages in your IRC channel may look like:
3545
36-
1. [Subscribe the bot](/help/subscribe-users-to-a-channel) to the Zulip
37-
stream that will contain the mirror.
46+
![Zulip message on IRC](/static/images/integrations/irc/002.png)
3847
39-
1. Inside the virtualenv you created above, run:
48+
[subscribe-channels]: /help/manage-user-channel-subscriptions#subscribe-a-user-to-a-channel
4049
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-
```
50+
### Configuration options
4751
48-
`--topic` is a Zulip topic, is optionally specified, defaults to "IRC".
52+
The integration script accepts the following command-line arguments:
4953
50-
Example command:
54+
#### Required arguments
5155
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-
```
56+
- `--irc-server`: The IRC server to mirror.
5857
59-
**Congratulations! You're done!**
58+
- `--nick-prefix`: Your registered IRC nick without the `_zulip` suffix.
6059
61-
Your Zulip messages may look like:
60+
- `--channel`: The IRC channel to mirror.
6261
63-
![IRC message on Zulip](/static/images/integrations/irc/001.png)
62+
- `--stream`: The name of the Zulip channel you want to mirror. The default
63+
channel name is `#general`.
6464
65-
Your IRC messages may look like:
65+
#### Optional arguments
6666
67-
![Zulip message on IRC](/static/images/integrations/irc/002.png)
67+
- `--topic`: The name of the Zulip topic you want to receive and send
68+
messages in. The default topic name is `IRC`.
69+
70+
- `--port`: The port to connect to the IRC server on. Defaults to 6667.
71+
72+
- `--nickserv-pw`: Password corresponding to the IRC nick.
73+
74+
- `--sasl-password`: Password for SASL authentication.

0 commit comments

Comments
 (0)