-
-
Notifications
You must be signed in to change notification settings - Fork 392
Update the doc of the IRC bridge integration. #870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Niloth-p
wants to merge
1
commit into
zulip:main
Choose a base branch
from
Niloth-p:docs/irc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+49
−42
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,74 @@ | ||
# Zulip IRC Integration | ||
|
||
Mirror an IRC channel in Zulip! | ||
|
||
### Install the bridge software | ||
{start_tabs} | ||
|
||
1. Clone the Zulip API repository, and install its dependencies. | ||
1. {!download-python-bindings.md!} | ||
|
||
``` | ||
git clone https://github.com/zulip/python-zulip-api.git | ||
cd python-zulip-api | ||
python3 ./tools/provision | ||
``` | ||
1. {!install-requirements.md!} | ||
|
||
1. Register a nick that ends with the suffix `_zulip` on your IRC server. | ||
|
||
This will create a new Python virtualenv. You'll run the bridge service | ||
inside this virtualenv. | ||
1. {!create-a-generic-bot.md!} | ||
|
||
1. Activate the virtualenv by running the `source` command printed | ||
at the end of the output of the previous step. | ||
1. Download the `zuliprc` configuration file of your bot by clicking the | ||
download (<i class="fa fa-download"></i>) icon under the bot's name, and | ||
save to `~/.zuliprc`. | ||
|
||
1. Go to the directory containing the bridge script if you haven't already done so | ||
1. [Subscribe the bot][subscribe-channels] to the Zulip channel that will | ||
contain the mirror. | ||
|
||
1. Mirror the IRC channel to the Zulip channel by running the | ||
`irc-mirror.py` script with the | ||
[required command-line arguments](#required-arguments). Use the | ||
[optional arguments](#optional-arguments) to configure the mirroring | ||
behavior. | ||
|
||
Here's an example command that mirrors the `#python-mypy` channel on the | ||
`irc.freenode.net` server to the `mypy` topic on the `#irc-discussions` | ||
channel on Zulip: | ||
Niloth-p marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
``` | ||
cd zulip/integrations/bridge_with_irc | ||
python {{ integration_path }}/irc-mirror.py \ | ||
--irc-server=irc.freenode.net --channel='#python-mypy' --nick-prefix=irc_mirror \ | ||
--stream='irc-discussions' --topic='mypy' | ||
``` | ||
|
||
1. Install the bridge dependencies in your virtualenv, by running: | ||
{end_tabs} | ||
|
||
``` | ||
pip install -r requirements.txt | ||
``` | ||
You're done! Messages in your Zulip channel may look like: | ||
|
||
### Configure the bridge | ||
 | ||
|
||
1. {!create-a-generic-bot.md!} | ||
Download the bot's `zuliprc` configuration file to your computer. | ||
Messages in your IRC channel may look like: | ||
|
||
1. [Subscribe the bot](/help/subscribe-users-to-a-channel) to the Zulip | ||
stream that will contain the mirror. | ||
 | ||
|
||
1. Inside the virtualenv you created above, run: | ||
[subscribe-channels]: /help/manage-user-channel-subscriptions#subscribe-a-user-to-a-channel | ||
|
||
``` | ||
python irc-mirror.py --irc-server=IRC_SERVER --channel=<CHANNEL> --nick-prefix=<NICK> \ | ||
--stream=<STREAM> [--topic=<TOPIC>] \ | ||
--site=<zulip.site> --user=<bot-email> \ | ||
--api-key=<api-key> | ||
``` | ||
### Configuration options | ||
|
||
`--topic` is a Zulip topic, is optionally specified, defaults to "IRC". | ||
The integration script accepts the following command-line arguments: | ||
|
||
Example command: | ||
#### Required arguments | ||
|
||
``` | ||
./irc-mirror.py --irc-server=irc.freenode.net --channel='#python-mypy' --nick-prefix=irc_mirror \ | ||
--stream='test here' --topic='#mypy' \ | ||
--site="https://chat.zulip.org" [email protected] \ | ||
--api-key=DeaDbEEf | ||
``` | ||
- `--irc-server`: The IRC server to mirror. | ||
|
||
**Congratulations! You're done!** | ||
- `--nick-prefix`: Your registered IRC nick without the `_zulip` suffix. | ||
|
||
Your Zulip messages may look like: | ||
- `--channel`: The IRC channel to mirror. | ||
|
||
 | ||
- `--stream`: The name of the Zulip channel you want to mirror. The default | ||
channel name is `#general`. | ||
|
||
Your IRC messages may look like: | ||
#### Optional arguments | ||
|
||
 | ||
- `--topic`: The name of the Zulip topic you want to receive and send | ||
messages in. The default topic name is `IRC`. | ||
|
||
- `--port`: The port to connect to the IRC server on. Defaults to 6667. | ||
|
||
- `--nickserv-pw`: Password corresponding to the IRC nick. | ||
|
||
- `--sasl-password`: Password for SASL authentication. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.