42wim / matterbridge

bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)
Apache License 2.0
6.45k stars 605 forks source link

IRC Bridge not really works with PVPGN IRC #2004

Open harleckinz opened 1 year ago

harleckinz commented 1 year ago

Hi!

I would like to connect my PVPGN IRC with Discord. The Discord gate works well, but the IRC not really.

So here is my configuration below:

[irc.pvpgn] Nick="test" NickServNick="test" Server="test.net:6667" UseTLS=false SkipTLSVerify=true RunCommands=["PRIVMSG nickserv :IDENTIFY password"]

And my log:

time="2023-03-08T07:37:39Z" level=info msg="Starting bridge: irc.pvpgn " prefix=router time="2023-03-08T07:37:39Z" level=info msg="Connecting test.net:6667" prefix=irc

It's keep connecting while the PVPGN config says the connection accepted.

Thanks!

harleckinz commented 1 year ago

time="2023-03-08T10:33:27Z" level=info msg="debug:10:33:27 handler.go:211: [1/2] exec NLURZVkhRnTBNHDdyiNO => " prefix=irc time="2023-03-08T10:33:27Z" level=info msg="debug:10:33:27 handler.go:232: [1/2] done NLURZVkhRnTBNHDdyiNO == 800ns" prefix=irc time="2023-03-08T10:33:27Z" level=info msg="debug:10:33:27 handler.go:232: [2/2] done QSBZFlQeHbpxFLUQZCAW == 214.9µs" prefix=irc time="2023-03-08T10:33:27Z" level=info msg="debug:10:33:27 handler.go:211: [1/1] exec MtZbitHCGvAFtcvMwykf => PING" prefix=irc time="2023-03-08T10:33:27Z" level=info msg="debug:10:33:27 handler.go:232: [1/1] done MtZbitHCGvAFtcvMwykf == 2.7µs" prefix=irc time="2023-03-08T10:33:27Z" level=info msg="debug:10:33:27 handler.go:29: < :test.net 421 UserName :Unrecognized command "CAP" (before login)" prefix=irc time="2023-03-08T10:33:27Z" level=info msg="debug:10:33:27 handler.go:211: [2/2] exec QSBZFlQeHbpxFLUQZCAW => " prefix=irc time="2023-03-08T10:33:27Z" level=info msg="debug:10:33:27 client.go:784: > PONG 73599487" prefix=irc time="2023-03-08T10:33:27Z" level=info msg="debug:10:33:27 handler.go:211: [1/2] exec NLURZVkhRnTBNHDdyiNO => " prefix=irc time="2023-03-08T10:33:27Z" level=info msg="debug:10:33:27 handler.go:232: [1/2] done NLURZVkhRnTBNHDdyiNO == 800ns" prefix=irc time="2023-03-08T10:33:27Z" level=info msg="debug:10:33:27 handler.go:232: [2/2] done QSBZFlQeHbpxFLUQZCAW == 73.1µs" prefix=irc time="2023-03-08T10:33:27Z" level=info msg="debug:10:33:27 handler.go:29: < :raspberry.redirectme.net 461 user USER :Not enough parameters" prefix=irc time="2023-03-08T10:33:27Z" level=info msg="debug:10:33:27 handler.go:211: [2/2] exec QSBZFlQeHbpxFLUQZCAW => " prefix=irc time="2023-03-08T10:33:27Z" level=info msg="debug:10:33:27 handler.go:232: [2/2] done QSBZFlQeHbpxFLUQZCAW == 80.7µs" prefix=irc time="2023-03-08T10:33:27Z" level=info msg="debug:10:33:27 handler.go:211: [1/2] exec NLURZVkhRnTBNHDdyiNO => " prefix=irc time="2023-03-08T10:33:27Z" level=info msg="debug:10:33:27 handler.go:232: [1/2] done NLURZVkhRnTBNHDdyiNO == 1.3µs" prefix=irc time="2023-03-08T10:34:27Z" level=info msg="Running version 1.26.0 6dafebc" prefix=main time="2023-03-08T10:34:27Z" level=info msg="Parsing gateway pvpgn" prefix=router time="2023-03-08T10:34:27Z" level=info msg="Starting bridge: discord " prefix=router time="2023-03-08T10:34:27Z" level=info msg=Connecting prefix=discord time="2023-03-08T10:34:27Z" level=info msg="Connection succeeded" prefix=discord time="2023-03-08T10:34:29Z" level=info msg="discord: joining ID:1082601232339828796 (ID: ID:1082601232339828796discord)" prefix=discord time="2023-03-08T10:34:29Z" level=info msg="Starting bridge: irc.pvpgn " prefix=router time="2023-03-08T10:34:29Z" level=info msg="Connecting test.net:6667" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 client.go:279: initializing debugging" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 builtin.go:15: registering built-in handlers" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "BBsMVXxofUwpfHFymdvu:bg" => 001 [int:true bg:true] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "XXZJBqKfXQnLUIwRBWnK" => PING [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "cmRxkHjUIhsewzKMUHbK" => PONG [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "qEpTbcRmdPcZAUXZFGhM" => JOIN [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "ygpPbALsWEWXkLOdOfZS" => PART [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "AWEvTLZlzBlXXdXOIvaT" => KICK [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "exoPlZsmuTIVlLasFdUk" => QUIT [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "IgoxNMCfWumlyLEyKzen" => NICK [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "kvlEKBObzaHDGEfGdgoz" => 353 [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "RSNAMwcfxBCgmfnlUuTE" => MODE [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "emtfKTZgZLVIroMfGzGH" => 324 [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "SEnkVHTFDMvgNvJepwPe" => 352 [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "eqKpMROdMVVhBlFhRRJs" => 354 [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "dGyxwmLQOVYiOlGxZEzI" => TOPIC [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "AeZNntKWYCYtemnojlce" => 332 [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "IEKEXZPBTlSSCHtFAEVh" => 004 [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "TcsldNFVrVKyPmWUQUQt" => 005 [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "ANswhOkBtGtaMEhHsRCQ" => 375 [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "mxSZHHmnWRHPoqkgXJdA" => 372 [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "HxFpDJakSzXBjzRumIXP" => PRIVMSG [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "sSTNQLxBDyYXEZXmjvMU" => NOTICE [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "jnGXriLGAgnKilVNsbon" => TOPIC [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "HCRKmnNvCvfrkRBuMjSv" => KICK [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "khUHzPUdppoXXTjRoAhP" => CAP [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "LyFyfkVUSlxWekyxLKRS" => CHGHOST [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "UCbVTmiOMCXeBmdjwghM" => AWAY [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "sOVAkCNvuVyenmPmFUth" => ACCOUNT [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "CmZpGgYEVFsbZagyNxNr" => [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "UPXfYACkIzDotkWWgMfz" => AUTHENTICATE [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "INNcGpeZJrzvgGlzzBMb" => 903 [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "svIZPGPpniGLiPbxiDVh" => 902 [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "aYWxVhYeErAVgWuHPUkY" => 904 [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "NkAiDBaesOYfhQjnoNNo" => 905 [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "BClRakjZQttQJbWWCSKP" => 906 [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "vAxvDDLvsqcFmMxCtnfN" => 908 [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "rgjbPZVnJOwZQyNqlxcC" => 433 [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "qzjNMkKxJSQVuCtgsZKf" => 436 [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "GpHTaJVRXCXMBfDtSrvl" => 437 [int:true bg:false] /go/src/matterbridge/bridge/irc/irc.go:313" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "FoJZnixAKWotlIDAVsPO" => 001 [int:false bg:false] /go/src/matterbridge/bridge/irc/irc.go:95" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "kRiacPLMbjGTimTkTMIR" => 376 [int:false bg:false] /go/src/matterbridge/bridge/irc/irc.go:96" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "szYkyYQLqQZdSBkYStGp" => 422 [int:false bg:false] /go/src/matterbridge/bridge/irc/irc.go:97" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:350: reg "SHCYAxHYcazAQNuAJlyp" => [int:false bg:false] /go/src/matterbridge/bridge/irc/irc.go:98" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 conn.go:278: connecting to test.net:6667... (sts: false, config-ssl: false)" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:29: < CLIENT_INIT test.net:6667" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:211: [2/2] exec SHCYAxHYcazAQNuAJlyp => " prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:232: [2/2] done SHCYAxHYcazAQNuAJlyp == 82.3µs" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 client.go:384: starting execLoop" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 conn.go:398: starting readLoop" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 conn.go:491: starting sendLoop" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 client.go:782: >%!(EXTRA string= %s redacted, string=PASS)" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 client.go:784: > CAP LS 302" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 client.go:784: > NICK user" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 client.go:784: > USER user user" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 conn.go:578: starting pingLoop" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:211: [1/2] exec CmZpGgYEVFsbZagyNxNr => " prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:232: [1/2] done CmZpGgYEVFsbZagyNxNr == 3.4µs" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:29: < PING 73661214" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:211: [2/2] exec SHCYAxHYcazAQNuAJlyp => " prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:232: [2/2] done SHCYAxHYcazAQNuAJlyp == 77.1µs" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:211: [1/2] exec CmZpGgYEVFsbZagyNxNr => " prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:232: [1/2] done CmZpGgYEVFsbZagyNxNr == 700ns" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:211: [1/1] exec XXZJBqKfXQnLUIwRBWnK => PING" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:232: [1/1] done XXZJBqKfXQnLUIwRBWnK == 6.9µs" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 client.go:784: > PONG 73661214" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:29: < :test.net 421 UserName :Unrecognized command "CAP" (before login)" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:211: [2/2] exec SHCYAxHYcazAQNuAJlyp => " prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:232: [2/2] done SHCYAxHYcazAQNuAJlyp == 27.2µs" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:211: [1/2] exec CmZpGgYEVFsbZagyNxNr => " prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:232: [1/2] done CmZpGgYEVFsbZagyNxNr == 700ns" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:29: < :test.net 461 user USER :Not enough parameters" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:211: [2/2] exec SHCYAxHYcazAQNuAJlyp => " prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:232: [2/2] done SHCYAxHYcazAQNuAJlyp == 48.6µs" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:211: [1/2] exec CmZpGgYEVFsbZagyNxNr => *" prefix=irc time="2023-03-08T10:34:29Z" level=info msg="debug:10:34:29 handler.go:232: [1/2] done CmZpGgYEVFsbZagyNxNr == 800ns" prefix=irc

harleckinz commented 1 year ago

Oh, I almost forget to mention that I could login with mIRC. After that I have to authorize myself with a following string:

/msg nickserv identify mypassword

harleckinz commented 1 year ago

Seems like it's a delay issue unfortunately there is no option to add delay after successful connection.

harleckinz commented 1 year ago

In order to reproduce my issue here is a test enviroment:

IP: raspberry.redirectme.net:6667 IRC Account: bot IRC Pass: test Channel: #diablo

Seems like the built-in IRC solution doesn't support the SASL at all. I tried thousands of different configs and I think it's a delay issue but may I'm wrong. After the connection the runcommands line must wait a bit, due the IRC sys cannot recognize all the config lines in same time.

Unfortunately I'm not a big dog to modify handlers.go and add sleep time after connection and also the Docker not made that task any easier.

Thanks!