Skip to content
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

Improve rocketchat-irc plugin #216

Closed
3 of 4 tasks
haosdent opened this issue Jun 22, 2015 · 45 comments
Closed
3 of 4 tasks

Improve rocketchat-irc plugin #216

haosdent opened this issue Jun 22, 2015 · 45 comments
Assignees
Labels
feat: irc feat: protocols stat: triaged Issue reviewed and properly tagged
Milestone

Comments

@haosdent
Copy link
Contributor

Current rocketchat-irc plugin just a prototype, I need do more works to improve it.

  • Add config to enable or disable this plugin
  • Reconnect when connection failed between irc server
  • Remove unused logs
  • Show member status

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@engelgabriel
Copy link
Member

Is this going to achieve something like https://www.irccloud.com/ ?

@haosdent
Copy link
Contributor Author

No sure, I just do it for fun. But I need to make this plugin reliable for other users which want to use it

@haosdent
Copy link
Contributor Author

For @posix4e 's question, I think it could replace irccloud finally.

@engelgabriel
Copy link
Member

That's the spirit @haosdent ! 👍

@Sing-Li
Copy link
Member

Sing-Li commented Jun 26, 2015

Interesting read (try to read to the end - I know its a little dry):

http://thenextweb.com/insider/2015/03/24/slack-is-quietly-unintentionally-killing-irc/

Then read the real, zero-hype account of the very same need/trend referenced by Pierre above.

This is no longer a technology looking for a solution; but an identified trending market void.

Rocket.Chat can service this niche better than Slack, and give them the forever-FREE, forever-in-their-control promise that they are looking for.

@engelgabriel
Copy link
Member

Depends on #222

@haosdent
Copy link
Contributor Author

Hi, this plugin is used for connect irc server. Not provide irc server and wait other client connect it through irc protocol.

@pierreozoux
Copy link
Contributor

Hi @haosdent and thanks for your work :) Do you have some sort of doc on how to install it? Thanks!

@simison
Copy link

simison commented Feb 5, 2016

Thanks for working on this!

I feel like this plugin should have a primary focus, as I keep hearing that this sort of connection is super important for projects with existing IRC communities. "Prototype" ain't gonna nail it.

https://www.bountysource.com/issues/22748500-improve-rocketchat-irc-plugin

@pierreozoux
Copy link
Contributor

Ok, I figured out:
You have to uncomment this line: https://github.com/RocketChat/Rocket.Chat/blob/develop/.meteor/packages#L96

I have a working example here: https://chat.indie.host/channel/indiehosters

I have various remarks on the way it is working and the way we could improve it.

  • disable auto-join for users
  • disable auto join for channels
  • add possibility for admin/moderator to link a channel to irc
  • when a user join this channel, make him join irc
  • add possibility for a user to specify nick/pass on irc
  • admin should be able to specify irc server (I'm fine with freenode at the beginning)

@simison do you to try? (You could create a channel #trustroots and it will auto join the irc channel)

I could work on thess features, but I need ca$h :) Do you think we could run a mini crowdfunding between IndieHosters/Hitchwiki for that? Or is it good enough as this?

@geekgonecrazy
Copy link
Contributor

For sure doesn't mean that we are abandoning. Just was curious if helped solve some peoples use cases.

@misse
Copy link

misse commented May 3, 2018

I have two feature requests for this integration which I can't find any information about,
When connecting rocketchat to an IRC server

  • SSL support
  • Password support

@engelgabriel engelgabriel modified the milestones: Mid-term, 0.65.0 May 10, 2018
@engelgabriel
Copy link
Member

This whole thread needs to be reviewed once we merge the IRC Federation: RFC2813 implementation (ngIRCd)
#10113

@Hudell Hudell modified the milestones: 0.65.0, 0.66.0 Jun 5, 2018
@theorenck theorenck modified the milestones: 0.66.0, Short-term Jul 31, 2018
@realrill
Copy link

Any update for this feature? I just tried to use it but I could not reach any success. To be honest I could not find a proper documentation about the IRC setting page as well as how it should act after a proper setup.

I am happy to help in debugging as much as I can. The latest log, hope it helps.
[irc][server] Unhandled peer message: {"prefix":"barjavel.freenode.net","server":"barjavel.freenode.net","command":"NOTICE","rawCommand":"NOTICE","commandType":"normal","args":["*","*** Looking up your hostname..."]} [irc][server] Unhandled peer message: {"prefix":"barjavel.freenode.net","server":"barjavel.freenode.net","command":"NOTICE","rawCommand":"NOTICE","commandType":"normal","args":["*","*** Checking Ident"]} [irc][server] Unhandled peer message: {"prefix":"barjavel.freenode.net","server":"barjavel.freenode.net","command":"NOTICE","rawCommand":"NOTICE","commandType":"normal","args":["*","*** Found your hostname"]} [irc][server] Unhandled peer message: {"prefix":"barjavel.freenode.net","server":"barjavel.freenode.net","command":"NOTICE","rawCommand":"NOTICE","commandType":"normal","args":["*","*** No Ident response"]} [irc][server] Unhandled peer message: {"prefix":"barjavel.freenode.net","server":"barjavel.freenode.net","command":"err_needmoreparams","rawCommand":"461","commandType":"error","args":["*","SERVER","Not enough parameters"]} [irc][server] Unhandled peer message: {"command":"ERROR","rawCommand":"ERROR","commandType":"normal","args":["Closing Link: 127.0.0.1 (Connection timed out)"]} [irc][server] Connection Closed

Version:
➔ System ➔ startup ➔ +----------------------------------------------------+ ➔ | SERVER RUNNING | ➔ +----------------------------------------------------+ ➔ | | ➔ | Rocket.Chat Version: 0.68.5 | ➔ | NodeJS Version: 8.11.3 - x64 | ➔ | Platform: linux | ➔ | Process Port: 3000 | ➔ | Site URL: xxxxxxxxxxxxxxxxxxxx | ➔ | ReplicaSet OpLog: Disabled | ➔ | Commit Hash: e412d018f8 | ➔ | Commit Branch: HEAD | ➔ | | ➔ +----------------------------------------------------+

@RickvLeeuwen
Copy link

RickvLeeuwen commented Feb 20, 2019

Hi,
I could not get the IRC Federation working. After some debugging and reading the RFC, i found the following solution:

onConnect() {
    this.log('Connected! Registering as server...');
    this.write({
      command: 'PASS',
      parameters: [this.config.passwords.local] //Removed the other parameters since these should not be passed from client to server. According to the RFC. When these are passed, you will always get an authorisation failed on the IRC link
    });
    this.write({
      command: 'SERVER',
      parameters: [this.config.server.name, '1'], \\Added the 1 because it needs this as <hops> value, according to the RFC. If not, you will see an error that the SERVER command does not have enough parameters.
      trailer: this.config.server.description
    });
  }

Now still the bridge is not working, but at least the connection is setup now...

Received PASS command, continue registering...
Handling peer message: SERVER irc.xxx.nl 1 : IRC Server 
Received SERVER command, waiting for first PING...
[JOIN and MODE and such....]
[irc][server] Handling peer message: PING :irc.xxx.nl 
[irc][server] Sending Command: :xxx.yyy.nl PONG irclink.xxx.nl 

@pr1m07
Copy link

pr1m07 commented Jun 5, 2019

Hello,

I am trying to connect my IRCd (UnrealIRCd v.4) to Rocket.Chat. Unfortunately it is not working. Error (log file) is attached below this post. Any idea how to solve this issue?

Kind regards,

Steps to reproduce:

IRC Federation settings:
Enabled: True
Protocol: RFC2813
Host: irc.server.si
Port: 65520
Name: irc.server.si
Description: Chat.si IRC Bridge
Local Password: Empty
Peer Password: IRCD password I guess?

Server Setup Information:

Relevant logs:

I20190605-13:58:43.787(2) Updating process.env.MAIL_URL
I20190605-13:58:44.070(2) [irc][server] Connecting to @irc.server.si:65520
I20190605-13:58:44.076(2) [irc][server] Connected! Registering as server...
I20190605-13:58:44.078(2) [irc][server] Sending Command: PASS 0210 ngircd
I20190605-13:58:44.078(2) [irc][server] Sending Command: SERVER irc.server.si :server.si IRC Bridge
I20190605-13:58:44.082(2) [irc][server] Unhandled peer message: {"prefix":"irc.server.si","server":"irc.server.si","command":"NOTICE","rawCommand":"NOTICE","commandType":"normal","args":["","** Looking up your hostname..."]}
I20190605-13:58:44.082(2) [irc][server] Unhandled peer message: {"prefix":"irc.server.si","server":"irc.server.si","command":"NOTICE","rawCommand":"NOTICE","commandType":"normal","args":["","** Found your hostname (cached)"]}
I20190605-13:58:46.226(2) [irc][server] Unhandled peer message: {"command":"ERROR","rawCommand":"ERROR","commandType":"normal","args":["Not enough SERVER parameters"]}
I20190605-13:58:46.227(2) [irc][server] Unhandled peer message: {"command":"ERROR","rawCommand":"ERROR","commandType":"normal","args":["Closing Link: [94.130.225.252] (Not enough parameters)"]}
I20190605-13:58:46.233(2) [irc][server] Connection Closed
I20190605-13:58:46.657(2) ➔ server.js:207 System ➔ startup

@pr1m07
Copy link

pr1m07 commented Jun 5, 2019

Ok, how I finally managed to connect Rocket.Chat and IRCd. Just like @RickvLeeuwen it is necessary to edit the app.js file:

onConnect() { this.log('Connected! Registering as server...'); this.write({ command: 'PASS', parameters: [this.config.passwords.local] //Removed the other parameters since these should not be passed from client to server. According to the RFC. When these are passed, you will always get an authorisation failed on the IRC link }); this.write({ command: 'SERVER', parameters: [this.config.server.name, '1'], \\Added the 1 because it needs this as <hops> value, according to the RFC. If not, you will see an error that the SERVER command does not have enough parameters. trailer: this.config.server.description }); }

In addition, the link block must be enabled in the IRCd config file, so that the servers can connect to one another.

My unrealircd.conf:
`listen {
         ip 127.0.0.1;
         port 6900;
         / * options {serversonly; }; * /
};

link www.yourdomain.com
{
         incoming {
                 mask *;
         };
 
         outgoing {
                 bind-ip *;
                 hostname 127.0.0.1;
                 port 6900;
         };
 
         password "pass";
 
         class servers;
};`

So far so good now I see in syslog following output:

Jun 5 16:30:13 cryptowall rocketchat[7267]: Loaded the Apps Framework and loaded a total of 1 Apps!
Jun 5 16:30:14 cryptowall rocketchat[7267]: [irc][server] Connecting to @localhost:6900
Jun 5 16:30:14 cryptowall rocketchat[7267]: [irc][server] Connected! Registering as server...
Jun 5 16:30:14 cryptowall rocketchat[7267]: [irc][server] Sending Command: PASS password
Jun 5 16:30:14 cryptowall rocketchat[7267]: [irc][server] Sending Command: SERVER www.server.si 1 :Server.si IRC Bridge
Jun 5 16:30:14 cryptowall rocketchat[7267]: [irc][server] Unhandled peer message: {"prefix":"irc.server.si","server":"irc.server.si","command":"NOTICE","rawCommand":"NOTICE","commandType":"normal","args":["","** Looking up your hostname..."]}
Jun 5 16:30:14 cryptowall rocketchat[7267]: [irc][server] Unhandled peer message: {"prefix":"irc.server.si","server":"irc.server.si","command":"NOTICE","rawCommand":"NOTICE","commandType":"normal","args":["","** Found your hostname (cached)"]}
Jun 5 16:30:16 cryptowall rocketchat[7267]: [irc][server] Handling peer message: PASS :password
Jun 5 16:30:16 cryptowall rocketchat[7267]: [irc][server] Received PASS command, continue registering...
Jun 5 16:30:16 cryptowall rocketchat[7267]: [irc][server] Unhandled peer message: {"command":"PROTOCTL","rawCommand":"PROTOCTL","commandType":"normal","args":["NOQUIT","NICKv2","SJOIN","SJOIN2","UMODE2","VL","SJ3","TKLEXT","TKLEXT2","NICKIP","ESVID","SJSBY"]}
Jun 5 16:30:16 cryptowall rocketchat[7267]: [irc][server] Unhandled peer message: {"command":"PROTOCTL","rawCommand":"PROTOCTL","commandType":"normal","args":["CHANMODES=beI,kLf,l,psmntirzMQNRTOVKDdGPZSCc","USERMODES=iowrsxzdHtIDZRqpWGTSB","BOOTED=1559719023","PREFIX=(qaohv)~&@%+","NICKCHARS=","SID=001","MLOCK","TS=1559745016","EXTSWHOIS"]}
Jun 5 16:30:16 cryptowall rocketchat[7267]: [irc][server] Handling peer message: SERVER irc.server.si 1 :U4203-Fhin6OoEM-001 Chat Server
Jun 5 16:30:16 cryptowall rocketchat[7267]: [irc][server] Received SERVER command, waiting for first PING...
Jun 5 16:30:16 cryptowall rocketchat[7267]: [irc][server] Unhandled peer message:
{"prefix":"irc.server.si","server":"irc.server.si","command":"SMO","rawCommand":"SMO","commandType":"normal","args":["o","(\u0002link\u0002) Link irc.server.si -> www.server.si[@127.0.0.1.54064] established"]}
Jun 5 16:30:16 cryptowall rocketchat[7267]: [irc][server] Unhandled peer message: {"prefix":"irc.server.si","server":"irc.server.si","command":"MD","rawCommand":"MD","commandType":"normal","args":["client","irc.server.si","link-security","2"]}
Jun 5 16:30:16 cryptowall rocketchat[7267]: [irc][server] Handling peer message: :irc.server.si SERVER services.server.si 2 :Services for IRC Networks
Jun 5 16:30:16 cryptowall rocketchat[7267]: [irc][server] Received SERVER command, waiting for first PING...
Jun 5 16:30:16 cryptowall rocketchat[7267]: [irc][server] Unhandled peer message: {"prefix":"services.server.si","server":"services.server.si","command":"EOS","rawCommand":"EOS","commandType":"normal","args":["EOS"]}
Jun 5 16:30:16 cryptowall rocketchat[7267]: [irc][server] Unhandled peer message: {"prefix":"services.server.si","server":"services.server.si","command":"SINFO","rawCommand":"SINFO","commandType":"normal","args":["0","0","","","",""]}
Jun 5 16:30:16 cryptowall rocketchat[7267]: [irc][server] Handling peer message: NICK chat26425 1 1559719136 Dark hostname.org irc.server.si 0 +iowxzHtIRqWT chat.147DE31.dynamic.siol.net :realname
Jun 5 16:30:16 cryptowall rocketchat[7267]: [irc][server] Emitting peer command to local: {"identifier":"nickChanged","args":{"newNick":"chat26425"}}
Jun 5 16:30:16 cryptowall rocketchat[7267]: [irc][server] Unhandled peer message: {"prefix":"irc.server.si","server":"irc.server.si","command":"SWHOIS","rawCommand":"SWHOIS","commandType":"normal","args":["chat26425","Staff @ server.si"]}
Jun 5 16:30:16 cryptowall rocketchat[7267]: [irc][server] Handling peer message: :chat26425 JOIN #podpora
Jun 5 16:30:16 cryptowall rocketchat[7267]: [irc][server] Emitting peer command to local: {"identifier":"joinedChannel","args":{"roomName":"podpora","nick":"chat26425"}}

... so in syslog I can see things going here and there, but unfortunately I don't see people from IRCd on Rocket.chat or the other way around. Nothing is also printed on #klepet channel on Rocket.Chat. Even if you type something on Rocket.chat channel #klepet nothing is printed on IRCd site. Also users on IRCd are not visible in Rocket.Chat. Any idea how to sync ?

Kind regards,

@JoKneeMo
Copy link

JoKneeMo commented Jul 3, 2019

I haven't found a way to edit the snapd locally.
It looks like the file would be app/irc/server/servers/RFC2813/index.js

Is there a pull request to update this?

@Sing-Li
Copy link
Member

Sing-Li commented Oct 31, 2019

We have merged #10113

If there are additional concerns or problems, let's open new tickets against the new feature. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: irc feat: protocols stat: triaged Issue reviewed and properly tagged
Projects
None yet
Development

No branches or pull requests