Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upImprove IRC Gateway #106
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
timabbott
Sep 12, 2017
Member
I think the big thing we need to do here is have step-by-step instructions for how to run it, documenting its limitations. We can probably just put that in the /integrations/ docs. And then we can open issues for fixing the major limitations revealed in that documentation.
|
I think the big thing we need to do here is have step-by-step instructions for how to run it, documenting its limitations. We can probably just put that in the /integrations/ docs. And then we can open issues for fixing the major limitations revealed in that documentation. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
timabbott
Sep 12, 2017
Member
The discussion in zulip/zulip#249 should cover the special Zulip things one needs to know to run it, specifically the need to use manage.py knight to create an "API super user" bot.
|
The discussion in zulip/zulip#249 should cover the special Zulip things one needs to know to run it, specifically the need to use |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rht
Nov 21, 2017
Member
I tried running the mirror a while ago, found the USAGE content to be sufficient
to get me running. I modified the code so that 1. being an api-super-user is no
longer required, 2. it redirects the IRC messages to a hardcoded topic in a
hardcoded stream (this can be quickly patched as options to the current code
if necessary). Basically it is a one-liner of:
./irc-mirror.py --irc-server=irc.freenode.net --channel='#python-mypy' --nick-prefix='irc_mirror' --site="https://chat.zulip.org" --user=irc-bot@chat.zulip.org --api-key=$API_KEY.
This works.
However, a problem occurred when I tried to enable the bi-directional mode
(forwarding messages in Zulip to IRC) by uncommenting the line
This line is a blocking synchronous call, and furthermore it prevents the
forwarding from IRC to Zulip from happening, i.e. this line makes everything
non-functional. The
jaraco/irc library also has a problem in that it can'tsustain a connection for longer than 30 min, at which point a ping timeout will
happen.
I tried another library, pydle and reconstructed the public subset of the
mirroring script, but reached a dead end in the bidirectional area because
pydle has only one thread that captures the events happening in the IRC
channel (on_connect, on_channel_message, etc). It can't be hooked to an external
event listener such as events in a Zulip server (to have messages being
forwarded from Zulip to the IRC channel). One plus point for pydle is that it
can sustain a more stable connection than jaraco/irc.
The only stable bidirectional solution that has worked so far is via Matrix
(note: they had the entirety of freenode mirrored). So currently I have #git
bidirectional-mirrored to
https://chat.zulip.org/#narrow/stream/IRC/topic/.23git.
Another possible path is to use nodejs (if there is a better IRC library in the
ecosystem) instead of Python.
|
I tried running the mirror a while ago, found the USAGE content to be sufficient However, a problem occurred when I tried to enable the bi-directional mode This line is a blocking synchronous call, and furthermore it prevents the forwarding from IRC to Zulip from happening, i.e. this line makes everything non-functional. The jaraco/irc library also has a problem in that it can'tsustain a connection for longer than 30 min, at which point a ping timeout will happen. I tried another library, The only stable bidirectional solution that has worked so far is via Matrix |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
timabbott
Nov 21, 2017
Member
The bidirectional model that we have in mind with this script historically is just running 2 copies (after presumably patching it to make that commented out section an option). If you look at zephyr_mirror.py, it runs 2 copies of zephyr_mirror_backend.py with different options, one for each direction; that system is quite reliable.
The 30m timeout issue with the current library is annoying, though.
|
The bidirectional model that we have in mind with this script historically is just running 2 copies (after presumably patching it to make that commented out section an option). If you look at The 30m timeout issue with the current library is annoying, though. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rht
Nov 22, 2017
Member
The bidirectional model that we have in mind with this script historically is just running 2 copies (after presumably patching it to make that commented out section an option).
Yeah, I forgot to tell that I did also attempt to run two specialized scripts -- one for forwarding to IRC (zulip-irc-receiver), another for forwarding from IRC (zulip-irc-sender). This works for up to 30 min only though, after which they have to be restarted again.
Yeah, I forgot to tell that I did also attempt to run two specialized scripts -- one for forwarding to IRC (zulip-irc-receiver), another for forwarding from IRC (zulip-irc-sender). This works for up to 30 min only though, after which they have to be restarted again. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rheaparekh
May 15, 2018
Contributor
The current IRC gateway manages to run with two copies (for both side message forwarding) running. However all the Issues I identified were:
- Ping timeout for zulip-> IRC gateway (issue of the lib
jaraco/irc, however they are planning to move to asyncio jaraco/irc#135, with an open PR on it!) - Message formatting isn't correct, the users sending the messages in Zulip are not being shown in IRC.
- Messages are replicated (When we forward a message from Zulip->IRC, IRC forward the same message back to Zulip)
|
The current IRC gateway manages to run with two copies (for both side message forwarding) running. However all the Issues I identified were:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rht
Jul 9, 2018
Member
Ping timeout for zulip-> IRC gateway (issue of the lib jaraco/irc, however they are planning to move to asyncio jaraco/irc#135, with an open PR on it!)
@rheaparekh the PR was merged on May 21 2018. Did this resolve the timeout issue?
@rheaparekh the PR was merged on May 21 2018. Did this resolve the timeout issue? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rht
Aug 13, 2018
Member
Confirmed that irc.client_aio.AioReactor fixes the timeout. I ran ./irc-mirror.py --irc-server=irc.freenode.net --channel='#python-mypy' --nick-prefix='irc_mirror' --site="https://chat.zulip.org" --user=irc-bot@chat.zulip.org --api-key=$API_KEY again and had observed the 15-30 min disconnect become stable (1 hour and counting).
Then the remaining problem of running 2 scripts for each direction can be solved with threading once for all.
The patch: rht@7c08c98
|
Confirmed that Then the remaining problem of running 2 scripts for each direction can be solved with threading once for all. The patch: rht@7c08c98 |
roberthoenig commentedSep 4, 2017
See zulip/zulip#249
Moving the issue here, let's have a discussion on what parts of the original one are still relevant.