GithubHelp home page GithubHelp logo

42wim / matterircd Goto Github PK

View Code? Open in Web Editor NEW
290.0 20.0 61.0 15.12 MB

Connect to your mattermost or slack using your IRC-client of choice.

License: MIT License

Go 99.77% Dockerfile 0.23%
ircd mattermost irc-server tls-support slack irc

matterircd's Introduction

matterircd

Join the IRC chat at https://web.libera.chat/gamja/?channels=#matterircd

Minimal IRC server which integrates with mattermost and slack Tested on FreeBSD / Linux / Windows

Compatibility

  • Matterircd works with slack, mastodon and mattermost 6.x, 7.x

Master branch of matterircd should always work against latest STABLE mattermost release.

Features

  • support direct messages / private channels / edited messages / deleted messages / reactions
  • auto-join/leave to same channels as on mattermost
  • reconnects with backoff on mattermost restarts
  • support multiple users
  • support channel/direct message backlog (messages when you're disconnected from IRC/mattermost)
  • search messages (/msg mattermost search query)
  • scrollback support (/msg mattermost scrollback #channel limit)
  • away support
  • restrict to specified mattermost instances
  • set default team/server
  • WHOIS, WHO, JOIN, LEAVE, NICK, LIST, ISON, PRIVMSG, MODE, TOPIC, LUSERS, AWAY, KICK, INVITE support
  • support TLS (ssl)
  • support unix sockets
  • support LDAP logins (mattermost enterprise) (use your ldap account/pass to login)
  • &users channel that contains members of all teams (if mattermost is so configured) for easy messaging
  • support for including/excluding channels from showing up in irc
  • supports mattermost roles (shows admins with @ status for now)
  • gitlab auth hack by using mmtoken cookie (see #29)
  • mattermost personal token support
  • support multiline pasting
  • prefixcontext option for mattermost (see https://github.com/42wim/matterircd/blob/master/prefixcontext.md)
    • threading support
    • reactions support
  • ....

Binaries

You can find the binaries here

Building

Go 1.17+ is required

go install github.com/42wim/matterircd

You should now have matterircd binary in the bin directory:

$ ls ~/go/bin/
matterircd

Config file

See matterircd.toml.example
Run with matterircd --conf matterircd.toml

Usage

Usage of ./matterircd:
      --bind string      interface:port to bind to, or a path to bind to a Unix socket. (default "127.0.0.1:6667")
      --conf string      config file (default "matterircd.toml")
      --debug            enable debug logging
      --tlsbind string   interface:port to bind to. (e.g 127.0.0.1:6697)
      --tlsdir string    directory to look for key.pem and cert.pem. (default ".")
      --version          show version

Matterircd will listen by default on localhost port 6667. Connect with your favorite irc-client to localhost:6667

For TLS support you'll need to generate certificates.
You can use this program generate_cert.go to generate key.pem and cert.pem

Mattermost user commands

Login with user/pass

/msg mattermost login <server> <team> <username/email> <password>

Login with personal token

/msg mattermost login <server> <team> <username/email> token=<yourpersonaltoken>

Login with MFA token

/msg mattermost login <server> <team> <username/email> <password> MFAToken=<mfatoken>

Search

/msg mattermost search query

Scrollback

/msg mattermost scrollback #<channel>|<user>|<post/thread ID> <limit>

e.g. /msg mattermost scrollback #bugs 100 shows the last 100 messages of #bugs e.g. /msg mattermost scrollback zdofdf1nctgsj87xgt6oco1a3w 0 shows all messages from the thread with root/parent zdofdf1nctgsj87xgt6oco1a3w

Mark messages in a channel/from a user as read (when DisableAutoView is set).

/msg mattermost updatelastviewed <channel>
/msg mattermost updatelastviewed <username>

Part/leave

/msg mattermost part #mychannel

Slack user commands

Get a slack token on https://api.slack.com/custom-integrations/legacy-tokens

Login

/msg slack login <token>

Or use team/login/pass to login

/msg slack login <team> <login> <password>

After login it'll show you a token you can use for the token login

Docker

A docker image for easily setting up and running matterircd on a server is available at docker hub.

Run the irc server on port 6667. You'll need to specify -bind 0.0.0.0:6667 otherwise it only listens on 127.0.0.1 in the container.

docker run -p 6667:6667 42wim/matterircd:latest --bind 0.0.0.0:6667

Now you can connect with your IRC client to port 6667 on your docker host.

Mastodon user commands

(still WIP)

Configure your mastodon settings
See the [mastodon] section in matterircd.toml.example

Login

/msg mastodon login

You'll see your timeline in #mastodon (automatically joined to that channel)

FreeBSD

Install the port.

# pkg install matterircd

Or with a local ports tree.

$ cd /usr/ports/net-im/matterircd
# make install clean

Enable the service.

echo "matterircd_enable="YES" >> /etc/rc.conf

Copy the default configuration and modify to your needs.

# cp /usr/local/etc/matterircd/matterircd.toml.sample /usr/local/etc/matterircd/matterircd.toml

Start the service.

# service matterircd start

Support/questions

We're also on the #matterircd channel on irc.libera.chat

FAQ

can I use matterircd for multiple mattermost or slack servers?

Yes, but not in the same connection (would cause problems with channel/user name conflicts).
matterircd supports multiple users, so you can configure your IRC client to have multiple networks that all connect to the same matterircd server.

mattermost login with sso/gitlab

You'll need to get the MMAUTHTOKEN from your cookies, login via the browser first.
Then in chrome run F12 - application - Storage/cookies - select your mattermostdomain and fetch the MMAUTHTOKEN

Now login with /msg mattermost login <username> MMAUTHTOKEN=<mytoken>
(if this doesn't work, try /msg mattermost login <username> token=<mytoken>)

See #29 for more information

Also see #98 for a script that fetches it for you.

slack sso login / xoxc tokens

Taken from: https://github.com/insomniacslk/irc-slack

Log via browser on the Slack team, open the browser's network tab in the developer tools, and look for an XHR transaction. Then look for the token (it starts with xoxc-) in the request data the auth cookie, contained in the d key-value in the request cookies (it looks like d=XXXX;)

Then concatenate the token and the auth cookie using a | character, like this:

xoxc-XXXX|d=XXXX; and use the above as your token with slack login

/msg slack login xoxc-XXXX|d=XXXX;

Guides

Here are some external guides and documentation that might help you get up and running more quickly:

Contributors

Contributors

Related

matterircd's People

Contributors

42wim avatar aketzu avatar bucko909 avatar cjwatson avatar dfskoll avatar eyenx avatar guilhermepiccoli avatar heichblatt avatar hloeung avatar mazhe avatar mk-fg avatar muesli avatar peter4825 avatar purpleidea avatar rmzg avatar runfalk avatar slowbro avatar tehpegasus avatar the-real-ed avatar vmiklos avatar vmpjdc avatar xyproto avatar yuvipanda avatar zauberfisch avatar zodman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

matterircd's Issues

Login fails after upgrading to Mattermost 3.0

After upgrading Mattermost Platform to version 3.0 matterircd can't login.
The only error message matterircd gives is We couldn't find an existing account matching your credentials. This team may require an invite from the team owner to join
I'm sure I'm using the right team name, login and password.
I couldn't find anything really useful in the logs of both matterircd and Mattermost, let me know what I can do to help troubleshoot this issue.

Expose port/volume in docker?

I'm not very familiar with docker, but shouldn't the dockerfile expose the port for external connections? I'm trying to run matterircd on the same remote host that also runs mattermost with docker.

Best regards

Having JSON auth issues

When trying to login (I can connect):

2016-02-23 19:40:43.894 INFO LOGIN: AppErrorFromJson: , invalid character '<' looking for beginning of value, reconnecting in 5m0s

I am running 2.x of mattermost and 0.3 of matterircd. I am use pidgin as my irc client.

I also verified the problem with circ.

Binaries missing for v0.6

There seem to be no binaries published for v0.6, as there have been for all previous releases.

No big issue, of course, since we could just build it ourselves. But we'd rather not set up a Go dev environment if we don't have to :)

Private messages between IRC and Mattermost users must be started by IRC user

If I send a 'Direct Message' (via the mattermost web interface) to a user who is using the IRC bridge, the messages are lost. However, if it is started by the IRC user sending a /msg or /query to the user on the web interface user, everything works fine.

As an example, in the following conversations, yuvipanda is on the web interface and halfak is on the irc bridge:

yuvipanda
hey
yuvipanda
are you seeing this?

halfak
TEst

yuvipanda
hi
yuvipanda
yes

halfak
Hey 

In this case, halfak user only saw messages sent by yuvipanda user after halfak also first said TEst. The first two messages from yuvipanda (hey and are you seeing this?) were totally lost.

MatterIRCD v0.8 Crashes on quit

I have run into an issue where MatterIRCD v0.8 seems to crash whenever someone disconnects their IRC client from the service. I have tested this with both "irssi" as well as "weechat". In "irssi", I get the following error message after using either "/quit" or "/disconnect".

GLib warning: SSL read error: server closed connection unexpectedly

In "weechat", I do not get that error message, but the daemon still crashes all the same. I also tested this without using SSL and the daemon still crashes, just without the "SSL read error". I have debugging turned on and was able to capture the the following errors from it:

Jun 29 08:07:08 white matterircd: time="2016-06-29T08:07:08-07:00" level=error msg="error:read tcp [redacted IPv6 Address]:45430->[redacted IPv6 Address]:443: use of closed network connection" module=matterclient
Jun 29 08:07:08 white systemd: matterircd.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Jun 29 08:07:08 white systemd: Unit matterircd.service entered failed state.
Jun 29 08:07:08 white systemd: matterircd.service failed.
Jun 29 08:07:08 white matterircd: panic: runtime error: invalid memory address or nil pointer dereference
Jun 29 08:07:08 white matterircd: [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x5fb347]
Jun 29 08:07:08 white matterircd: goroutine 27 [running]:
Jun 29 08:07:08 white matterircd: panic(0x7d6040, 0xc420010060)
Jun 29 08:07:08 white matterircd: /usr/local/go/src/runtime/panic.go:500 +0x1a1
Jun 29 08:07:08 white matterircd: github.com/42wim/matterircd/vendor/github.com/42wim/matterbridge-plus/matterclient.(*MMClient).GetChannelName(0x0, 0xc4203a63e0, 0x1a, 0xc42001aee8, 0x1)
Jun 29 08:07:08 white matterircd: /go/src/github.com/42wim/matterircd/vendor/github.com/42wim/matterbridge-plus/matterclient/matterclient.go:252 +0x37
Jun 29 08:07:08 white matterircd: github.com/42wim/matterircd/vendor/github.com/42wim/mm-go-irckit.(*User).checkWsActionMessage(0xc4200d21e0, 0xc42041dae0)
Jun 29 08:07:08 white matterircd: /go/src/github.com/42wim/matterircd/vendor/github.com/42wim/mm-go-irckit/mmuser.go:279 +0xb6
Jun 29 08:07:08 white matterircd: github.com/42wim/matterircd/vendor/github.com/42wim/mm-go-irckit.(*User).handleWsMessage(0xc4200d21e0)
Jun 29 08:07:08 white matterircd: /go/src/github.com/42wim/matterircd/vendor/github.com/42wim/mm-go-irckit/mmuser.go:172 +0x1b4
Jun 29 08:07:08 white matterircd: created by github.com/42wim/matterircd/vendor/github.com/42wim/mm-go-irckit.(*User).loginToMattermost
Jun 29 08:07:08 white matterircd: /go/src/github.com/42wim/matterircd/vendor/github.com/42wim/mm-go-irckit/mmuser.go:73 +0x429

The service does not crash when I use MatterIRCd v0.7, so it looks like the problem was introduced in the v0.8 release.

Can't log in with ldap

We've set up mattermost with the enterprise LDAP plug in. After configuring LDAP authentication, when I try to log in with my ldap account it replies:

Please sign in using ldap

When using the web interface it presents two login forms, one for regular log in and one for LDAP.

Support /nick

So right now if you send /nick something, matterirc internally changes your /nick to be something (or the IRC client does it, not sure?) but it doesn't get communicated to mattermost.

IMO changing /nick should set the 'nick' property of the mattermost user.

IRC clients lose some messages right after disconnect

In the following log, user @halfak was on IRC and user @yuvipanda was on the mattermost web interface. 'yuvipanda' sent numbers from 1 to 30, and 2-6 were missed...

[13:10:27] <yuvipanda> @halfak ok next
[13:10:36] <yuvipanda> @halfak is the 1 to 30 disconnection thing
[13:10:45] <halfak> OK.  Ready to disconnect
[13:10:52] <yuvipanda> 1
[13:10:55] <yuvipanda> @halfak go! :)
[13:10:56] <yuvipanda> 2
[13:10:59] * Disconnected ()
[13:11:22] * Now talking on #town-square
[13:11:22] * subbu (3j5u8mfb57rg8c3dsozno8a1qh@https://mattermost.wmflabs.org) has joined
[13:11:22] * tgr (6ezx1bib83898dh6x9g3cz71iw@https://mattermost.wmflabs.org) has joined
[13:11:22] * joe (akr6t7k3ubdhmnit96cazh1xth@https://mattermost.wmflabs.org) has joined
[13:11:22] * robla (idxrsxk1ubd95p4pjq83rqzu4e@https://mattermost.wmflabs.org) has joined
[13:11:22] * luisv (n5fbhrmwwibifjaerouxqracyr@https://mattermost.wmflabs.org) has joined
[13:11:22] * stu (pgj4t7yuffbq3xdks773kijqdc@https://mattermost.wmflabs.org) has joined
[13:11:22] * hashar (tfr5g9rscj8hxbazod4qrcaibr@https://mattermost.wmflabs.org) has joined
[13:11:22] <yuvipanda> 6
[13:11:22] <yuvipanda> 7
[13:11:22] <yuvipanda> 8
[13:11:22] <yuvipanda> 9
[13:11:22] <yuvipanda> 10
[13:11:22] <yuvipanda> 11
[13:11:22] <yuvipanda> 12
[13:11:22] <yuvipanda> 13
[13:11:22] <yuvipanda> 14
[13:11:22] <yuvipanda> 15
[13:11:22] <yuvipanda> 16
[13:11:22] <yuvipanda> 17
[13:11:22] <yuvipanda> 18
[13:11:22] <yuvipanda> 19
[13:11:22] <yuvipanda> 20
[13:11:22] <yuvipanda> 21
[13:11:22] <yuvipanda> 22
[13:11:22] <yuvipanda> 23
[13:11:23] <yuvipanda> 24
[13:11:24] <yuvipanda> 25
[13:11:25] <yuvipanda> 26
[13:11:26] <yuvipanda> 27
[13:11:26] <halfak> Back
[13:11:27] <yuvipanda> 28
[13:11:32] <yuvipanda> @halfak what did you see
[13:11:43] <halfak> So, it looks like 2-6 dropped.

matterircd crashes after joining first channel

I am able to run matterircd, it connects to server, but when i do LOGIN, it joins one channel and the binary crashes. I attach debug log of matterircd with traces from go:

[12:38:39][maciejjo@fireball:matterircd][0]$ ./matterircd -port=6669 -mmserver="10.157.66.93" -mminsecure=true -mmteam="myteam" -debug=true
2016-01-28 12:38:42.365 INFO enabling debug
2016-01-28 12:38:50.660 INFO New connection: 127.0.0.1:34806
2016-01-28 12:38:50.666 DEBUG <- CAP LS
2016-01-28 12:38:50.666 DEBUG <- NICK maciejjo
2016-01-28 12:38:50.667 DEBUG <- USER maciejjo maciejjo localhost :Maciej Sobkowski
2016-01-28 12:38:50.667 DEBUG -> :matterircd 001 maciejjo :Welcome! maciejjo!maciejjo@localhost
2016-01-28 12:38:50.667 DEBUG -> :matterircd 002 maciejjo :Your host is matterircd, running version 0.2
2016-01-28 12:38:50.667 DEBUG -> :matterircd 003 maciejjo :This server was created Thu Jan 28 12:38:50 CET 2016
2016-01-28 12:38:50.667 DEBUG -> :matterircd 004 maciejjo :matterircd 0.2 o o
2016-01-28 12:38:50.667 DEBUG -> :matterircd 251 maciejjo :There are 2 users and 0 services on 1 servers
2016-01-28 12:38:50.667 DEBUG -> :matterircd 375 maciejjo :- matterircd Message of the Day -
2016-01-28 12:38:50.667 DEBUG -> :matterircd 376 maciejjo :End of /MOTD command.
2016-01-28 12:38:50.678 DEBUG <- MODE maciejjo +i
2016-01-28 12:38:53.543 DEBUG <- PING matterircd
2016-01-28 12:38:53.543 DEBUG -> :matterircd PONG matterircd
2016-01-28 12:39:54.600 DEBUG <- PING matterircd
2016-01-28 12:39:54.600 DEBUG -> :matterircd PONG matterircd
2016-01-28 12:40:55.665 DEBUG <- PING matterircd
2016-01-28 12:40:55.665 DEBUG -> :matterircd PONG matterircd
2016-01-28 12:41:56.720 DEBUG <- PING matterircd
2016-01-28 12:41:56.720 DEBUG -> :matterircd PONG matterircd
2016-01-28 12:42:57.778 DEBUG <- PING matterircd
2016-01-28 12:42:57.778 DEBUG -> :matterircd PONG matterircd
2016-01-28 12:43:58.836 DEBUG <- PING matterircd
2016-01-28 12:43:58.836 DEBUG -> :matterircd PONG matterircd
2016-01-28 12:44:59.883 DEBUG <- PING matterircd
2016-01-28 12:44:59.883 DEBUG -> :matterircd PONG matterircd
2016-01-28 12:45:43.523 DEBUG <- PRIVMSG mattermost :login
2016-01-28 12:45:43.523 DEBUG -> :mattermost!mattermost@service PRIVMSG maciejjo :need LOGIN <login> <pass>
2016-01-28 12:45:57.923 DEBUG <- PRIVMSG mattermost :login [email protected] ********
2016-01-28 12:45:57.923 DEBUG retrying login myteam [email protected] 10.157.66.93
2016-01-28 12:46:00.929 DEBUG <- PING matterircd
2016-01-28 12:46:00.929 DEBUG -> :matterircd PONG matterircd
2016-01-28 12:46:01.547 DEBUG -> :maciejjo!maciejjo@localhost JOIN #mychannel
2016-01-28 12:46:01.548 DEBUG -> :matterircd 353 maciejjo = #mychannel :maciejjo
2016-01-28 12:46:01.548 DEBUG -> :matterircd 366 maciejjo #mychannel :End of /NAMES list.
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x20]

goroutine 32 [running]:
irckit.$nested0
        /home/maciejjo/code/golang/src/github.com/42wim/mm-go-irckit/mmuser.go:150
created by github_com_42wim_mm_go_irckit.addUsersToChannels.pN34_github_com_42wim_mm_go_irckit.User
        /home/maciejjo/code/golang/src/github.com/42wim/mm-go-irckit/mmuser.go:138

goroutine 16 [IO wait, 5 minutes]:
net.runtime_pollWait
        /build/gcc/src/gcc-5.3.0/libgo/runtime/netpoll.goc:151
net.Wait.pN12_net.pollDesc
        /build/gcc/src/gcc-5.3.0/libgo/go/net/fd_poll_runtime.go:84
net.WaitRead.pN12_net.pollDesc
        /build/gcc/src/gcc-5.3.0/libgo/go/net/fd_poll_runtime.go:89
net.accept.pN9_net.netFD
        /build/gcc/src/gcc-5.3.0/libgo/go/net/fd_unix.go:419
net.AcceptTCP.pN15_net.TCPListener
        /build/gcc/src/gcc-5.3.0/libgo/go/net/tcpsock_posix.go:234
net.Accept.pN15_net.TCPListener
        /build/gcc/src/gcc-5.3.0/libgo/go/net/tcpsock_posix.go:244
main.start
        /home/maciejjo/code/matterircd/main.go:46
main.main
        /home/maciejjo/code/matterircd/main.go:41

goroutine 18 [finalizer wait, 5 minutes]:
created by runtime_createfing
        /build/gcc/src/gcc-5.3.0/libgo/runtime/mgc0.c:2572

goroutine 19 [chan receive, 5 minutes]:
github_com_alecthomas_log4go.run.pN45_github_com_alecthomas_log4go.ConsoleLogWriter
        /home/maciejjo/code/golang/src/github.com/alecthomas/log4go/termlog.go:33
created by github_com_alecthomas_log4go.NewConsoleLogWriter
        /home/maciejjo/code/golang/src/github.com/alecthomas/log4go/termlog.go:26

goroutine 27 [chan receive]:
github_com_42wim_mm_go_irckit.addUsersToChannels.pN34_github_com_42wim_mm_go_irckit.User
        /home/maciejjo/code/golang/src/github.com/42wim/mm-go-irckit/mmuser.go:137
github_com_42wim_mm_go_irckit.loginToMattermost.pN34_github_com_42wim_mm_go_irckit.User
        /home/maciejjo/code/golang/src/github.com/42wim/mm-go-irckit/mmuser.go:107
github_com_42wim_mm_go_irckit.handleMMServiceBot.pN34_github_com_42wim_mm_go_irckit.User
        /home/maciejjo/code/golang/src/github.com/42wim/mm-go-irckit/mmuser.go:527
created by github_com_42wim_mm_go_irckit.handle.pN36_github_com_42wim_mm_go_irckit.server
        /home/maciejjo/code/golang/src/github.com/42wim/mm-go-irckit/server.go:783

goroutine 22 [runnable]:
net.runtime_pollWait
        /build/gcc/src/gcc-5.3.0/libgo/runtime/netpoll.goc:151
net.Wait.pN12_net.pollDesc
        /build/gcc/src/gcc-5.3.0/libgo/go/net/fd_poll_runtime.go:84
net.WaitRead.pN12_net.pollDesc
        /build/gcc/src/gcc-5.3.0/libgo/go/net/fd_poll_runtime.go:89
net.Read.pN9_net.netFD
        /build/gcc/src/gcc-5.3.0/libgo/go/net/fd_unix.go:242
net.Read.pN8_net.conn
        /build/gcc/src/gcc-5.3.0/libgo/go/net/net.go:121
net.Read.pN11_net.TCPConn
        /build/gcc/src/gcc-5.3.0/libgo/go/net/tcpsock_posix.go:57
bufio.fill.pN12_bufio.Reader
        /build/gcc/src/gcc-5.3.0/libgo/go/bufio/bufio.go:97
bufio.ReadSlice.pN12_bufio.Reader
        /build/gcc/src/gcc-5.3.0/libgo/go/bufio/bufio.go:295
bufio.ReadBytes.pN12_bufio.Reader
        /build/gcc/src/gcc-5.3.0/libgo/go/bufio/bufio.go:374
bufio.ReadString.pN12_bufio.Reader
        /build/gcc/src/gcc-5.3.0/libgo/go/bufio/bufio.go:414
github_com_sorcix_irc.Decode.pN29_github_com_sorcix_irc.Decoder
        /home/maciejjo/code/golang/src/github.com/sorcix/irc/stream.go:80
github_com_42wim_mm_go_irckit.Decode.N34_github_com_42wim_mm_go_irckit.conn
        /home/maciejjo/code/golang/src/github.com/42wim/mm-go-irckit/net.go:20
github_com_42wim_mm_go_irckit.Decode.pN34_github_com_42wim_mm_go_irckit.User
        /home/maciejjo/code/golang/src/github.com/42wim/mm-go-irckit/user.go:137
github_com_42wim_mm_go_irckit.handle.pN36_github_com_42wim_mm_go_irckit.server
        /home/maciejjo/code/golang/src/github.com/42wim/mm-go-irckit/server.go:581
created by github_com_42wim_mm_go_irckit.Connect.pN36_github_com_42wim_mm_go_irckit.server
        /home/maciejjo/code/golang/src/github.com/42wim/mm-go-irckit/server.go:282

goroutine 29 [select]:
net_http.readLoop.pN20_net_http.persistConn
        /build/gcc/src/gcc-5.3.0/libgo/go/net/http/transport.go:928
created by net_http.dialConn.pN18_net_http.Transport
        /build/gcc/src/gcc-5.3.0/libgo/go/net/http/transport.go:660

goroutine 30 [select]:
net_http.writeLoop.pN20_net_http.persistConn
        /build/gcc/src/gcc-5.3.0/libgo/go/net/http/transport.go:945
created by net_http.dialConn.pN18_net_http.Transport
        /build/gcc/src/gcc-5.3.0/libgo/go/net/http/transport.go:661

matterircd dies when pm'ed

The matterircd seems to die pretty regularly for me. I note in the log this time that it died immediately after someone pm'ed the mattermost user.

2016-05-30 02:51:09.987 DEBUG -> :matterircd PONG matterircd
2016-05-30 02:51:22.903 DEBUG <- PRIVMSG mattermost ty
panic: runtime error: index out of range

goroutine 85 [running]:
panic(0x92c9e0, 0xc8200100a0)
/nasfs/users/u0022146/.gvm/gos/go1.6.2/src/runtime/panic.go:481 +0x3e6
github.com/42wim/matterircd/vendor/github.com/42wim/mm-go-irckit.(_User).handleMMServiceBot(0xc8200e4000, 0xc8200e40e0, 0x0, 0x0)
/tmp/go7/src/github.com/42wim/matterircd/vendor/github.com/42wim/mm-go-irckit/mmuser.go:398 +0x1e11
created by github.com/42wim/matterircd/vendor/github.com/42wim/mm-go-irckit.(_server).handle
/tmp/go7/src/github.com/42wim/matterircd/vendor/github.com/42wim/mm-go-irckit/server.go:797 +0x54f1

messages posted by webhook bots (ie, matterbridge) show as the bot user

I have matterbridge configured to bridge between the #opennms channel on freenode and a channel on my mattermost server using webhooks. When it proxies posts from IRC to mattermost, it sets the user to irc-<username> in the mattermost display, but when those same posts show up in matterircd, they show as coming from the username the webhook is registered as.

Is it possible to use the "display name" that the webhook is using as the username shown in matterircd?

Using matterircd with Gitlab authentication

I have enabled Mattermost (v1.3) that was installed with my Gitlab instance. It is set-up to use Gitlab for login. From matterircd (v0.2) I get the following error:

2016-01-27 09:48:22.590 DEBUG -> :mattermost!mattermost@service PRIVMSG chitz :Please sign in using gitlab

How can I get matterircd to work in this setup?

Direct messages from Limechat have no content

Hi, I'm using matterircd build from master with Mattermost 1.3.0. There is some weird behaviour when posting messages using an IRC client.

Example 1:

  • User A using IRC client posts a direct message to user B using the Mattermost web client.
  • The Mattermost client of user B shows a new message but without any text.

Example 2:

  • User A posts "hubot ping" using an IRC client to a public channel which has a hubot.
  • Other users (using the Mattermost web client) can see the message in the channel, but hubot doesn't respond.
  • User A posts "hubot ping" using the Mattermost web client to the public channel.
  • Hubot responds with "PONG".

Do you have any idea?

Increasing file descriptor usage requires restart

Our setup: CentOS 7.2 running Mattermost behind nginx; matterircd on the same box. 16 users total, 4 connected through matterircd.

After some period of time (dependent on amount of chatting that occurs), matterircd will refuse to accept any further connections. Following the logs and watching the /proc/<matterircd_pid>/fd directory, it appears that some file descriptors are created with each message sent, but they don't always go away; used descriptor count increases until 1024 (the soft limit for the process), at which point the "connection refused" messages start to appear and the process must be restarted.

Inspection of the output of lsof -p <matterircd_pid> reveals many TYPE: sock and NAME: TCP sockets open (not in a connected state or listing connection source/destination); ls -al /proc/<matterircd_pid>/ lists up to 1024 descriptors before the process must be restarted.

Not sure if this is actually an issue with matterircd or one of the libraries it uses.

Thanks!

Login to a local instance of mattermost fails

In my configuration I use mattermost on custom port and seems it runs without https

/msg mattermost login 192.168.59.103:8065 testing <login> <pass>
We encountered an error while connecting to the server

Also, log lack any messages according to login attempts

matterircd crashes on new connections a lot of times

Stack trace:

Nov 18 21:29:15 mattermost-02 matterircd[27928]: panic: runtime error: invalid memory address or nil pointer dereference
Nov 18 21:29:15 mattermost-02 matterircd[27928]: [signal 0xb code=0x1 addr=0x0 pc=0x482d64]
Nov 18 21:29:15 mattermost-02 matterircd[27928]: goroutine 34 [running]:
Nov 18 21:29:15 mattermost-02 matterircd[27928]: github.com/42wim/mm-go-irckit.(*User).getMMChannelId(0xc8200716c0, 0xc820103250, 0xb, 0x0, 0x0)
Nov 18 21:29:15 mattermost-02 matterircd[27928]: /home/yuvipanda/code/kubernetes/src/github.com/42wim/mm-go-irckit/mmuser.go:351 +0x2e4
Nov 18 21:29:15 mattermost-02 matterircd[27928]: github.com/42wim/mm-go-irckit.(*User).joinMMChannel(0xc8200716c0, 0xc820075be5, 0xc, 0x0, 0x0)
Nov 18 21:29:15 mattermost-02 matterircd[27928]: /home/yuvipanda/code/kubernetes/src/github.com/42wim/mm-go-irckit/mmuser.go:476 +0xae
Nov 18 21:29:15 mattermost-02 matterircd[27928]: github.com/42wim/mm-go-irckit.(*server).handle(0xc8200715f0, 0xc8200716c0)
Nov 18 21:29:15 mattermost-02 matterircd[27928]: /home/yuvipanda/code/kubernetes/src/github.com/42wim/mm-go-irckit/server.go:621 +0x134a
Nov 18 21:29:15 mattermost-02 matterircd[27928]: created by github.com/42wim/mm-go-irckit.(*server).Connect
Nov 18 21:29:15 mattermost-02 matterircd[27928]: /home/yuvipanda/code/kubernetes/src/github.com/42wim/mm-go-irckit/server.go:282 +0xb5
Nov 18 21:29:15 mattermost-02 matterircd[27928]: goroutine 1 [IO wait]:
Nov 18 21:29:15 mattermost-02 matterircd[27928]: net.runtime_pollWait(0x7fc6ce522978, 0x72, 0xc82006c0a0)
Nov 18 21:29:15 mattermost-02 matterircd[27928]: /usr/lib/go/src/runtime/netpoll.go:157 +0x60
Nov 18 21:29:15 mattermost-02 matterircd[27928]: net.(*pollDesc).Wait(0xc820104290, 0x72, 0x0, 0x0)
Nov 18 21:29:15 mattermost-02 matterircd[27928]: /usr/lib/go/src/net/fd_poll_runtime.go:73 +0x3a
Nov 18 21:29:15 mattermost-02 matterircd[27928]: net.(*pollDesc).WaitRead(0xc820104290, 0x0, 0x0)
Nov 18 21:29:15 mattermost-02 matterircd[27928]: /usr/lib/go/src/net/fd_poll_runtime.go:78 +0x36
Nov 18 21:29:15 mattermost-02 matterircd[27928]: net.(*netFD).accept(0xc820104230, 0x0, 0x7fc6ce522a38, 0xc8200757a0)
Nov 18 21:29:15 mattermost-02 matterircd[27928]: /usr/lib/go/src/net/fd_unix.go:408 +0x27c
Nov 18 21:29:15 mattermost-02 matterircd[27928]: net.(*TCPListener).AcceptTCP(0xc820072088, 0xc820101d70, 0x0, 0x0)
Nov 18 21:29:15 mattermost-02 matterircd[27928]: /usr/lib/go/src/net/tcpsock_posix.go:254 +0x4d

Disconnected from matterircd

Using irssi I'm able to connect to matterircd through an Amazon ELB, I'm also able to login in using my credentials and then interact with mattermost. If I leave the connection idle for a few minutes then eventually it will disconnect from the matterircd server with the following error in the logs:

2016-03-20 23:44:59.531 ERROR handle decode error for gareth: EOF

Tutorial for a working matteircd example using docker images

I used Docker images on a Fedora 23 x64 machine:

docker pull mattermost/platform
docker run --name mattermost-dev -d --publish 8065:80 mattermost/platform

Visit the address http://localhost:8065/ then

  • create an account [email protected] ( user hello , and password hello ),
  • and also an organization named temporary
docker run -d -p 6667:6667 --name ircd xyproto/matterircd -mmserver localhost -mmteam temporary -interface 0.0.0.0

Then opened IRC client ( e.g. xchat ), and in an new server tab and enter:

/server localhost

This connecs to the matterircd IRC server, and login:

/msg mattermost login hello hello
LOGIN hello@localhost hello

Next step fails:

/j #town-square for which I get Cannot join join (Channel is invite only)

This seems to connect and refuse, but not yet fully working.

I think there needs to be a working demo example using Docker images. That will enable someone to evaluate IRC integration.

Scrollback replayed in reverse order

Steps to reproduce:

  1. Have two users, one on the mattermost web client and one on the irc bridge
  2. IRC user disconnects
  3. Mattermost user starts sending messages from 1 to 30
  4. IRC user reconnects

Expected result:

IRC user gets the numbers 1 to 30 in the same order it was sent

Observed result:

IRC user gets the numbers in the reverse order - starting at 30 and counting down.

[17:49:43] <yuvipanda> @halfak ready}?
[17:50:13] <halfak> Disconnect!
[17:50:17] <yuvipanda> 1
[17:50:17] <yuvipanda> 2
[17:50:18] <yuvipanda> 3
[17:50:19] <yuvipanda> 4
[17:50:19] <yuvipanda> 5
[17:50:19] * Disconnected ()
[17:51:10] * Now talking on #town-square
[17:51:10] * subbu (3j5u8mfb57rg8c3dsozno8a1qh@https://mattermost.wmflabs.org) has joined
[17:51:10] * joe (akr6t7k3ubdhmnit96cazh1xth@https://mattermost.wmflabs.org) has joined
[17:51:10] * yuvipanda (benytojn1inytny4ifk8yo9m5w@https://mattermost.wmflabs.org) has joined
[17:51:10] * robla (idxrsxk1ubd95p4pjq83rqzu4e@https://mattermost.wmflabs.org) has joined
[17:51:10] * luisv (n5fbhrmwwibifjaerouxqracyr@https://mattermost.wmflabs.org) has joined
[17:51:10] * hashar (tfr5g9rscj8hxbazod4qrcaibr@https://mattermost.wmflabs.org) has joined
[17:51:10] <yuvipanda> 30
[17:51:10] <yuvipanda> 29
[17:51:10] <yuvipanda> 28
[17:51:10] <yuvipanda> 27
[17:51:10] <yuvipanda> 26
[17:51:10] <yuvipanda> 25
[17:51:10] <yuvipanda> 24
[17:51:10] <yuvipanda> 23
[17:51:10] <yuvipanda> 22
[17:51:10] <yuvipanda> 21
[17:51:10] <yuvipanda> 20
[17:51:10] <yuvipanda> 19
[17:51:10] <yuvipanda> 18
[17:51:10] <yuvipanda> 17
[17:51:10] <yuvipanda> 16
[17:51:10] <yuvipanda> 15
[17:51:10] <yuvipanda> 14
[17:51:10] <yuvipanda> 13
[17:51:10] <yuvipanda> 12
[17:51:10] <yuvipanda> 11
[17:51:10] <yuvipanda> 10
[17:51:10] <yuvipanda> 9
[17:51:10] <yuvipanda> 8
[17:51:10] <yuvipanda> 7
[17:51:10] <yuvipanda> 6

Note the ordering is wrong, so even though messages aren't lost the ordering is reversed when @halfak reconnects.

/whois output wrong

yuvipanda signed on at December 31, 1969 at 5:00:00 PM MST and has been idle for 8 minutes, 14 seconds

Seems the time value is the 0 value with TZ offset, and idle time is also wonky.

Indirect dependency to "code.google.com/p/log4go"

  1. Thats mercurial repo (I need to install it)
  2. code.google will be shut down soon

Consider this facts, please remove such dependency. I not sure witch package need it but I sure there must be right fork on github.

Crash with TLS Enabled

Excited about the the TLS support! Unfortunately when I attempted to use it crashed. I was able to connect fine but as soon as I attempted to login I saw this:

2016-03-28 02:02:22.147 DEBUG <- PRIVMSG mattermost :login [email protected] xxxx
2016/03/28 02:02:22 retrying login croscon [email protected] localhost:82
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x4b408f]

goroutine 10 [running]:
github.com/42wim/mm-go-irckit.(_User).addUsersToChannels(0xc8200b6460)
/go/src/github.com/42wim/mm-go-irckit/mmuser.go:72 +0x74f
github.com/42wim/mm-go-irckit.(_User).handleMMServiceBot(0xc8200b6460, 0xc8200b6540, 0xc8201c6f54, 0x29)
/go/src/github.com/42wim/mm-go-irckit/mmuser.go:458 +0xf48
created by github.com/42wim/mm-go-irckit.(*server).handle
/go/src/github.com/42wim/mm-go-irckit/server.go:786 +0x511b

goroutine 1 [IO wait]:
net.runtime_pollWait(0x7f465accfb28, 0x72, 0xc820012160)
/usr/lib/go/src/runtime/netpoll.go:157 +0x60
net.(_pollDesc).Wait(0xc8200e9090, 0x72, 0x0, 0x0)
/usr/lib/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(_pollDesc).WaitRead(0xc8200e9090, 0x0, 0x0)
/usr/lib/go/src/net/fd_poll_runtime.go:78 +0x36
net.(_netFD).accept(0xc8200e9030, 0x0, 0x7f465accfbe8, 0xc8200119a0)
/usr/lib/go/src/net/fd_unix.go:408 +0x27c
net.(_TCPListener).AcceptTCP(0xc8200240f8, 0xc8ffffffff, 0x0, 0x0)
/usr/lib/go/src/net/tcpsock_posix.go:254 +0x4d
net.(*TCPListener).Accept(0xc8200240f8, 0x0, 0x0, 0x0, 0x0)
/usr/lib/go/src/net/tcpsock_posix.go:264 +0x3d
main.start(0x7f465acceb80, 0xc8200240f8)
/go/src/github.com/42wim/matterircd/main.go:83 +0x4e
main.main()
/go/src/github.com/42wim/matterircd/main.go:62 +0xe4e

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
/usr/lib/go/src/runtime/asm_amd64.s:1721 +0x1

goroutine 5 [chan receive]:
github.com/alecthomas/log4go.(*ConsoleLogWriter).run(0xc820010520, 0x7f465acce358, 0xc820024010)
/go/src/github.com/alecthomas/log4go/termlog.go:33 +0x69
created by github.com/alecthomas/log4go.NewConsoleLogWriter
/go/src/github.com/alecthomas/log4go/termlog.go:26 +0xb5

goroutine 6 [IO wait]:
net.runtime_pollWait(0x7f465accfa68, 0x72, 0xc820012160)
/usr/lib/go/src/runtime/netpoll.go:157 +0x60
net.(_pollDesc).Wait(0xc820118fb0, 0x72, 0x0, 0x0)
/usr/lib/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(_pollDesc).WaitRead(0xc820118fb0, 0x0, 0x0)
/usr/lib/go/src/net/fd_poll_runtime.go:78 +0x36
net.(_netFD).accept(0xc820118f50, 0x0, 0x7f465accfbe8, 0xc820129140)
/usr/lib/go/src/net/fd_unix.go:408 +0x27c
net.(_TCPListener).AcceptTCP(0xc820024110, 0x7f465af51000, 0x0, 0x0)
/usr/lib/go/src/net/tcpsock_posix.go:254 +0x4d
net.(_TCPListener).Accept(0xc820024110, 0x0, 0x0, 0x0, 0x0)
/usr/lib/go/src/net/tcpsock_posix.go:264 +0x3d
crypto/tls.(_listener).Accept(0xc8201290e0, 0x0, 0x0, 0x0, 0x0)
/usr/lib/go/src/crypto/tls/tls.go:46 +0x60
main.start(0x7f465accfc88, 0xc8201290e0)
/go/src/github.com/42wim/matterircd/main.go:83 +0x4e
main.main.func1()
/go/src/github.com/42wim/matterircd/main.go:49 +0x68
created by main.main
/go/src/github.com/42wim/matterircd/main.go:50 +0x8c7

goroutine 9 [IO wait]:
net.runtime_pollWait(0x7f465accf9a8, 0x72, 0xc820012160)
/usr/lib/go/src/runtime/netpoll.go:157 +0x60
net.(_pollDesc).Wait(0xc820119020, 0x72, 0x0, 0x0)
/usr/lib/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(_pollDesc).WaitRead(0xc820119020, 0x0, 0x0)
/usr/lib/go/src/net/fd_poll_runtime.go:78 +0x36
net.(_netFD).Read(0xc820118fc0, 0xc820136400, 0x400, 0x400, 0x0, 0x7f465acca168, 0xc820012160)
/usr/lib/go/src/net/fd_unix.go:232 +0x23a
net.(_conn).Read(0xc820024118, 0xc820136400, 0x400, 0x400, 0x0, 0x0, 0x0)
/usr/lib/go/src/net/net.go:172 +0xe4
crypto/tls.(_block).readFromUntil(0xc8201bfe00, 0x7f465acd01f0, 0xc820024118, 0x5, 0x0, 0x0)
/usr/lib/go/src/crypto/tls/conn.go:455 +0xcc
crypto/tls.(_Conn).readRecord(0xc8200c02c0, 0x9fee17, 0x0, 0x0)
/usr/lib/go/src/crypto/tls/conn.go:540 +0x2d1
crypto/tls.(_Conn).Read(0xc8200c02c0, 0xc820132000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
/usr/lib/go/src/crypto/tls/conn.go:901 +0x167
bufio.(_Reader).fill(0xc82011e300)
/usr/lib/go/src/bufio/bufio.go:97 +0x1e9
bufio.(_Reader).ReadSlice(0xc82011e300, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/lib/go/src/bufio/bufio.go:328 +0x21a
bufio.(_Reader).ReadBytes(0xc82011e300, 0xc82012910a, 0x0, 0x0, 0x0, 0x0, 0x0)
/usr/lib/go/src/bufio/bufio.go:406 +0xa9
bufio.(_Reader).ReadString(0xc82011e300, 0x7e130a, 0x0, 0x0, 0x0, 0x0)
/usr/lib/go/src/bufio/bufio.go:446 +0x4d
github.com/sorcix/irc.(_Decoder).Decode(0xc8201291c0, 0x0, 0x0, 0x0)
/go/src/github.com/sorcix/irc/stream.go:80 +0x59
github.com/42wim/mm-go-irckit.(_User).Decode(0xc8200b6460, 0x9fe1b8, 0x0, 0x0)
/go/src/github.com/42wim/mm-go-irckit/user.go:137 +0xab
github.com/42wim/mm-go-irckit.(_server).handle(0xc8200f2340, 0xc8200b6460)
/go/src/github.com/42wim/mm-go-irckit/server.go:582 +0xb1
created by github.com/42wim/mm-go-irckit.(*server).Connect
/go/src/github.com/42wim/mm-go-irckit/server.go:283 +0xb5

I used an existing key/cert pay and I used the go certificate generator to get a self signed cert. Both had the same results.

Support optional 'scrollback'

So when users disconnect and then reconnect, they can get all the messages in channels since their last connection. This would make it work similar to an IRC Bouncer (like ZNC)

This would require that there be state kept however to mark the 'last read position' via IRC.

Login failed because email ddress has not been verified

Hi,

We just enabled e-mails in our mattermost instance (we didn't verify e-mails before because our mail server wasn't set up). Now that's it's enabled, I can no longer log in using mattericd:develop and mattermost 2.1.0.

Upon trying the login command, I get a reply from matterircd saying "Login failed because email address has not been verified". The thing is, the email was verified, and even trying to change to a new email to verify it again doesn't solve the issue. The docker logs doesn't say much either: It's

Trying login...
PRIVMSG :Login failed because email ...

back to back.

Anything I can try to fix that?

Best regards

crash on login

I get a crash when I msg my login with correct credentials (if I use wrong ones it tells me ;)

~ ❯❯❯ docker run -it -p 6667:6667 --name ircd --link mattermost-dev:mm xyproto/matterircd -mmserver mm -mmteam maxandersen -interface 0.0.0.0 -debug -mminsecure=true
2016-03-19 21:45:05.095 INFO enabling debug
2016-03-19 21:45:20.171 INFO New connection: 192.168.99.1:64986
2016-03-19 21:45:20.181 DEBUG <- CAP LS 302
2016-03-19 21:45:20.185 DEBUG <- NICK maxandersen
2016-03-19 21:45:20.190 DEBUG <- USER maxandersen 0 * :Max Rydahl Andersen
2016-03-19 21:45:20.190 DEBUG -> :matterircd 001 maxandersen :Welcome! [email protected]
2016-03-19 21:45:20.191 DEBUG -> :matterircd 002 maxandersen :Your host is matterircd, running version 0.3
2016-03-19 21:45:20.191 DEBUG -> :matterircd 003 maxandersen :This server was created Sat Mar 19 21:45:20 UTC 2016
2016-03-19 21:45:20.192 DEBUG -> :matterircd 004 maxandersen :matterircd 0.3 o o
2016-03-19 21:45:20.192 DEBUG -> :matterircd 251 maxandersen :There are 2 users and 0 services on 1 servers
2016-03-19 21:45:20.193 DEBUG -> :matterircd 375 maxandersen :- matterircd Message of the Day -
2016-03-19 21:45:20.193 DEBUG -> :matterircd 376 maxandersen :End of /MOTD command.
2016-03-19 21:45:29.544 DEBUG <- HELP
2016-03-19 21:45:49.512 DEBUG <- JOIN #off-topic
2016-03-19 21:45:49.512 DEBUG -> :matterircd 473 :Cannot join channel (+i)
2016-03-19 21:45:54.620 DEBUG <- JOIN #max
2016-03-19 21:45:54.620 DEBUG -> :matterircd 473 :Cannot join channel (+i)
2016-03-19 21:46:02.675 DEBUG <- JOIN #townsquare
2016-03-19 21:46:02.676 DEBUG -> :matterircd 473 :Cannot join channel (+i)
2016-03-19 21:46:13.777 DEBUG <- PRIVMSG mattermost :login [email protected] secret
2016-03-19 21:46:13.777 DEBUG retrying login maxandersen [email protected] mm
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x591d2b]

goroutine 9 [running]:
github.com/mattermost/platform/model.(*Client).login(0xc820051720, 0xc8200c3110, 0xc82003ebb8, 0xc82003eba8)
    /go/src/github.com/mattermost/platform/model/client.go:308 +0x53b
github.com/mattermost/platform/model.(*Client).LoginByEmail(0xc820051720, 0x7ffd8a5b4c8f, 0xb, 0xc8200c303a, 0xb, 0xc8200c3046, 0x8, 0xc81ffff53f, 0x43fa05)
    /go/src/github.com/mattermost/platform/model/client.go:280 +0x16a
github.com/42wim/mm-go-irckit.(*User).loginToMattermost(0xc8200b6750, 0x0, 0x0)
    /go/src/github.com/42wim/mm-go-irckit/mmuser.go:54 +0x59f
github.com/42wim/mm-go-irckit.(*User).handleMMServiceBot(0xc8200b6750, 0xc8200b6820, 0xc8200c3034, 0x1a)
    /go/src/github.com/42wim/mm-go-irckit/mmuser.go:527 +0xdfe
created by github.com/42wim/mm-go-irckit.(*server).handle
    /go/src/github.com/42wim/mm-go-irckit/server.go:783 +0x520a

goroutine 1 [IO wait]:
net.runtime_pollWait(0x7fe03f6d8ac8, 0x72, 0xc820010160)
    /usr/local/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc8200e2f40, 0x72, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc8200e2f40, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).accept(0xc8200e2ee0, 0x0, 0x7fe03f6d8b88, 0xc82000fa60)
    /usr/local/go/src/net/fd_unix.go:408 +0x27c
net.(*TCPListener).AcceptTCP(0xc8200260f0, 0xc8200e1d70, 0x0, 0x0)
    /usr/local/go/src/net/tcpsock_posix.go:254 +0x4d
net.(*TCPListener).Accept(0xc8200260f0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/tcpsock_posix.go:264 +0x3d
main.start(0x7fe03f6d7b48, 0xc8200260f0)
    /go/src/github.com/42wim/matterircd/main.go:46 +0x4e
main.main()
    /go/src/github.com/42wim/matterircd/main.go:41 +0x8a9

goroutine 5 [chan receive]:
github.com/alecthomas/log4go.(*ConsoleLogWriter).run(0xc82000e660, 0x7fe03f6d7330, 0xc820026010)
    /go/src/github.com/alecthomas/log4go/termlog.go:33 +0x69
created by github.com/alecthomas/log4go.NewConsoleLogWriter
    /go/src/github.com/alecthomas/log4go/termlog.go:26 +0xb5

goroutine 8 [IO wait]:
net.runtime_pollWait(0x7fe03f6d8a08, 0x72, 0xc820010160)
    /usr/local/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc8200e2fb0, 0x72, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc8200e2fb0, 0x0, 0x0)
    /usr/local/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc8200e2f50, 0xc8200ea000, 0x1000, 0x1000, 0x0, 0x7fe03f6d3050, 0xc820010160)
    /usr/local/go/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc8200260f8, 0xc8200ea000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/local/go/src/net/net.go:172 +0xe4
bufio.(*Reader).fill(0xc8200187e0)
    /usr/local/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).ReadSlice(0xc8200187e0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/bufio/bufio.go:328 +0x21a
bufio.(*Reader).ReadBytes(0xc8200187e0, 0xc82000fa0a, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/bufio/bufio.go:406 +0xa9
bufio.(*Reader).ReadString(0xc8200187e0, 0x7d680a, 0x0, 0x0, 0x0, 0x0)
    /usr/local/go/src/bufio/bufio.go:446 +0x4d
github.com/sorcix/irc.(*Decoder).Decode(0xc82000fae0, 0x0, 0x0, 0x0)
    /go/src/github.com/sorcix/irc/stream.go:80 +0x59
github.com/42wim/mm-go-irckit.(*User).Decode(0xc8200b6750, 0x9ef4d8, 0x0, 0x0)
    /go/src/github.com/42wim/mm-go-irckit/user.go:137 +0xab
github.com/42wim/mm-go-irckit.(*server).handle(0xc8200b6680, 0xc8200b6750)
    /go/src/github.com/42wim/mm-go-irckit/server.go:581 +0xb1
created by github.com/42wim/mm-go-irckit.(*server).Connect
    /go/src/github.com/42wim/mm-go-irckit/server.go:282 +0xb5

goroutine 12 [select]:
net/http.(*persistConn).readLoop(0xc8200e86e0)
    /usr/local/go/src/net/http/transport.go:976 +0xac7
created by net/http.(*Transport).dialConn
    /usr/local/go/src/net/http/transport.go:685 +0xc78

goroutine 13 [select]:
net/http.(*persistConn).writeLoop(0xc8200e86e0)
    /usr/local/go/src/net/http/transport.go:1009 +0x40c
created by net/http.(*Transport).dialConn
    /usr/local/go/src/net/http/transport.go:686 +0xc9d

Crash at /msg mattermost search

Hi,

This is using the latest master branch (commit aec9b49).

go 1.5.3 on 64-bit Arch Linux.

Here is a log of the crash:

./matterircd --debug=true --interface="server" --mmserver="mattermost" --mmteam="team" --port=6667           
2016-02-09 09:55:49.736 INFO enabling debug
2016-02-09 09:56:50.023 INFO New connection: 10.10.48.238:36204
2016-02-09 09:56:50.026 DEBUG <- NICK afr
2016-02-09 09:56:50.026 DEBUG <- USER afr 0 * :afr
2016-02-09 09:56:50.026 DEBUG -> :matterircd 001 afr :Welcome! afr!afr@server
2016-02-09 09:56:50.026 DEBUG -> :matterircd 002 afr :Your host is matterircd, running version 0.2
2016-02-09 09:56:50.026 DEBUG -> :matterircd 003 afr :This server was created Tue Feb  9 09:56:50 CET 2016
2016-02-09 09:56:50.026 DEBUG -> :matterircd 004 afr :matterircd 0.2 o o
2016-02-09 09:56:50.026 DEBUG -> :matterircd 251 afr :There are 2 users and 0 services on 1 servers
2016-02-09 09:56:50.026 DEBUG -> :matterircd 375 afr :- matterircd Message of the Day -
2016-02-09 09:56:50.026 DEBUG -> :matterircd 376 afr :End of /MOTD command.
2016-02-09 09:57:04.578 DEBUG <- LIST
2016-02-09 09:57:04.578 DEBUG -> :matterircd 321 afr :Channel Users Topic
2016-02-09 09:57:04.578 DEBUG -> :matterircd 323 afr :End of /LIST
2016-02-09 09:57:21.530 DEBUG <- PRIVMSG mattermost :login mattermost afr password
2016-02-09 09:57:21.530 DEBUG -> :mattermost!mattermost@service PRIVMSG afr :need LOGIN <login> <pass>
2016-02-09 09:57:32.044 DEBUG <- PRIVMSG mattermost :search queryt
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x590727]

goroutine 9 [running]:
github.com/mattermost/platform/model.(*Client).DoApiGet(0x0, 0xc820013f80, 0x1a, 0x0, 0x0, 0x0, 0x0, 0x7, 0x0)
    /home/afr/go/src/github.com/mattermost/platform/model/client.go:84 +0x517
github.com/mattermost/platform/model.(*Client).SearchPosts(0x0, 0xc8200e106b, 0x6, 0x2, 0x2)
    /home/afr/go/src/github.com/mattermost/platform/model/client.go:747 +0xc4
github.com/42wim/mm-go-irckit.(*User).searchMMPosts(0xc8200d4d00, 0xc8200e106b, 0x6, 0x91c2c0)
    /home/afr/go/src/github.com/42wim/mm-go-irckit/mmuser.go:651 +0x3d
github.com/42wim/mm-go-irckit.(*User).handleMMServiceBot(0xc8200d4d00, 0xc8200d4dd0, 0xc8200e1064, 0xd)
    /home/afr/go/src/github.com/42wim/mm-go-irckit/mmuser.go:538 +0x113d
created by github.com/42wim/mm-go-irckit.(*server).handle
    /home/afr/go/src/github.com/42wim/mm-go-irckit/server.go:783 +0x520a

goroutine 1 [IO wait]:
net.runtime_pollWait(0x7f5a16f55c38, 0x72, 0xc82000e200)
    /usr/lib/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc82010ced0, 0x72, 0x0, 0x0)
    /usr/lib/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc82010ced0, 0x0, 0x0)
    /usr/lib/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).accept(0xc82010ce70, 0x0, 0x7f5a16f55cf8, 0xc820013d80)
    /usr/lib/go/src/net/fd_unix.go:408 +0x27c
net.(*TCPListener).AcceptTCP(0xc820030108, 0xc820103d70, 0x0, 0x0)
    /usr/lib/go/src/net/tcpsock_posix.go:254 +0x4d
net.(*TCPListener).Accept(0xc820030108, 0x0, 0x0, 0x0, 0x0)
    /usr/lib/go/src/net/tcpsock_posix.go:264 +0x3d
main.start(0x7f5a16f54c90, 0xc820030108)
    /home/afr/checkout/matterircd/main.go:46 +0x4e
main.main()
    /home/afr/checkout/matterircd/main.go:41 +0x8a9

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    /usr/lib/go/src/runtime/asm_amd64.s:1721 +0x1

goroutine 5 [chan receive]:
github.com/alecthomas/log4go.(*ConsoleLogWriter).run(0xc820012760, 0x7f5a16f54330, 0xc820030010)
    /home/afr/go/src/github.com/alecthomas/log4go/termlog.go:33 +0x69
created by github.com/alecthomas/log4go.NewConsoleLogWriter
    /home/afr/go/src/github.com/alecthomas/log4go/termlog.go:26 +0xb5

goroutine 7 [IO wait]:
net.runtime_pollWait(0x7f5a16f55b78, 0x72, 0xc82000e200)
    /usr/lib/go/src/runtime/netpoll.go:157 +0x60
net.(*pollDesc).Wait(0xc82010cf40, 0x72, 0x0, 0x0)
    /usr/lib/go/src/net/fd_poll_runtime.go:73 +0x3a
net.(*pollDesc).WaitRead(0xc82010cf40, 0x0, 0x0)
    /usr/lib/go/src/net/fd_poll_runtime.go:78 +0x36
net.(*netFD).Read(0xc82010cee0, 0xc820113000, 0x1000, 0x1000, 0x0, 0x7f5a16f50050, 0xc82000e200)
    /usr/lib/go/src/net/fd_unix.go:232 +0x23a
net.(*conn).Read(0xc820030110, 0xc820113000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /usr/lib/go/src/net/net.go:172 +0xe4
bufio.(*Reader).fill(0xc82000a900)
    /usr/lib/go/src/bufio/bufio.go:97 +0x1e9
bufio.(*Reader).ReadSlice(0xc82000a900, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/lib/go/src/bufio/bufio.go:328 +0x21a
bufio.(*Reader).ReadBytes(0xc82000a900, 0xc820013e0a, 0x0, 0x0, 0x0, 0x0, 0x0)
    /usr/lib/go/src/bufio/bufio.go:406 +0xa9
bufio.(*Reader).ReadString(0xc82000a900, 0x7d8e0a, 0x0, 0x0, 0x0, 0x0)
    /usr/lib/go/src/bufio/bufio.go:446 +0x4d
github.com/sorcix/irc.(*Decoder).Decode(0xc820013e00, 0x0, 0x0, 0x0)
    /home/afr/go/src/github.com/sorcix/irc/stream.go:80 +0x59
github.com/42wim/mm-go-irckit.(*User).Decode(0xc8200d4d00, 0x9f1b18, 0x0, 0x0)
    /home/afr/go/src/github.com/42wim/mm-go-irckit/user.go:137 +0xab
github.com/42wim/mm-go-irckit.(*server).handle(0xc8200d4c30, 0xc8200d4d00)
    /home/afr/go/src/github.com/42wim/mm-go-irckit/server.go:581 +0xb1
created by github.com/42wim/mm-go-irckit.(*server).Connect
    /home/afr/go/src/github.com/42wim/mm-go-irckit/server.go:282 +0xb5

I connected with weechat and the /msg mattermost login command worked fine. The crash happened at the following command (which contains a typo):

/msg mattermost search queryt

Users rejoin every time they say anything

01:40 < joe> hey
01:40 -!- joe [akr6t7k3ubdhmnit96cazh1xth@https://mattermost.wmflabs.org] has joined #town-square
01:40 < joe> this seems to work nice, thanks
01:41 -!- joe [akr6t7k3ubdhmnit96cazh1xth@https://mattermost.wmflabs.org] has joined #town-square
01:41 < joe> how is the mobile version of this thing?
01:42 -!- joe [akr6t7k3ubdhmnit96cazh1xth@https://mattermost.wmflabs.org] has joined #town-square
01:42 < joe> whoo it made chrome crash
01:43 -!- joe [akr6t7k3ubdhmnit96cazh1xth@https://mattermost.wmflabs.org] has joined #town-square
01:43 < joe> irc
01:43 -!- joe [akr6t7k3ubdhmnit96cazh1xth@https://mattermost.wmflabs.org] has joined #town-square
01:43 < joe> but I see you joining every time you write
01:43 -!- joe [akr6t7k3ubdhmnit96cazh1xth@https://mattermost.wmflabs.org] has joined #town-square
01:43 < joe> that _sucks_

Is what I see on IRC. They should join when they join the team and just stay there.

Allow defaulting to a mattermost instance / team

On my matterircd instance at matterirc.wmflabs.org I want to restrict people to only using mattermost.wmflabs.org and the Wikimedia team. I also want them to not care about those two pieces of info. So should have a way to set defaults, that'll allow users to do:

/msg mattermost LOGIN <login-email> <login-password>

Support for other client commands?

Hi!

I don't know if the API supports it, but changing the username/nickname with /nick would be great. I think most client have that command built-in, along with /part, /topic etc. Coming from irc, I was happy to see that "/topic" is working, it's much faster than doing it the current way in mattermost.

I'd try to do it myself, but I'm not familiar with Go at all... Anyway, unless it's my client (weechat) that's not supported, here's a list of commands that are not working with weechat atm:

/part (I can't leave the channel with /close or /part in weechat, I have to use the web client for this).
/nick

Maybe there are others, I haven't tested them all...

Thanks for the project, some of us older folks don't want to use the web interface while new users like it, this allows everybody to use their client of choice.

Apparently, matterircd has issues with NICK messages where the last argument is prefixed with :

The IRC RFCs specify that it is acceptable to prefix the last argument in a message with a :, for example, during the initialization phase, both

NICK :justjanne or NICK justjanne may be sent by the client, and shall both be accepted by the server.

A user today reported to the Quassel project (a distributed IRC client/bouncer combintation) an issue with connecting to matterircd, and believes to have traced the issue to this specific change (older versions of Quassel send the : more often than necessary, but still fully compliant with the RFCs).

This issue apparently does not occur with clients that do not send this :.

Handle attachments somehow

Right now the text of the attachment makes it through to IRC but not the attachment itself. Maybe make it be a URL appended to the message?

Own messages not synced between IRC and web interface

I joined http://mattermost.wmflabs.org/wikimedia/channels/town-square in the browser and ran /server matterirc.wmflabs.org and ran /msg mattermost LOGIN XXX XXXXX in the IRC client (and got a login OK response). After that, I could chat with the other person on the channel and he saw my messages instantly, whether I typed them on IRC or in the browser, and I saw his messages on both interfaces; but I my own messages that I typed on IRC didn't show up in the web browser, and the ones typed in the browser did not show up in the IRC client.

After a while, I got the message -!- Irssi: Join to #town-square was synced in 561 secs on IRC; after that, messages I wrote on IRC appeared on the web interface (both new ones and the previous ones retroactively), but the other direction continued not to work.

matterircd 0.7 sends privmsg that cannot be parsed

Hi,

I'm using matterircd 0.7 and it sent a message to my chat client that the client could not parse:

irc: too few arguments received from IRC server for command "privmsg" (received: 3 arguments, expected: at least 4)
irc: failed to parse command "PRIVMSG" (please report to developers):
:dwest!ysthswine3f8bgqqse38c1pg7c@https://mattermost.galois.com PRIVMSG #questions-and-feedback

I've spoken with the chat client authors (weechat) and they're claiming that this is not an RFC-compliant message. (That issue is at weechat/weechat#751.)

CC @dwest-galois

Crash on writing to channel with duplicate name

I made two teams and they both had the same private group in them. From IRC, I logged in to my first team, then when I switched my login to the second team and tried writing to the channel with that private group name, it crashed with this:

2016-02-23 23:32:19.467 CRITICAL websocket: continuation after final message frame
2016-02-23 23:32:19.467 CRITICAL websocket: continuation after final message frame
2016-02-23 23:35:02.277 CRITICAL websocket: unexpected reserved bits 7
2016-02-23 23:35:05.391 CRITICAL websocket: unexpected reserved bits 7
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x481770]
goroutine 41 [running]:
github.com/42wim/mm-go-irckit.(User).createMMUser(0xc820114000, 0x0, 0xc82038ece0)
/home/sam/work/src/github.com/42wim/mm-go-irckit/mmuser.go:113 +0x2e0
github.com/42wim/mm-go-irckit.(User).handleWsActionPost(0xc820114000, 0xc820477950)
/home/sam/work/src/github.com/42wim/mm-go-irckit/mmuser.go:280 +0x55d
github.com/42wim/mm-go-irckit.(User).WsReceiver(0xc820114000)
/home/sam/work/src/github.com/42wim/mm-go-irckit/mmuser.go:257 +0x449
created by github.com/42wim/mm-go-irckit.(User).handleMMServiceBot
/home/sam/work/src/github.com/42wim/mm-go-irckit/mmuser.go:532 +0xe97
...

Compilation error because of update in mattermost platform

When we tried to compile this code with go, we found out that it was broken because of a dependency have changed a signature in one method.

The following line was changed in mattermost/platform not long ago https://github.com/mattermost/platform/blame/master/model/client.go#L594 and with this commit mattermost/mattermost@0e7a149

The signature of this method was changed to GetChannelExtraInfo(id string, memberLimit int, etag string) and adds one new argument memberLimit. You need to update all calls to this method within your code and deps to support this new signature.

Doesn't work anymore, with JSON error

When trying to login to a MM 2.2.0.6671, with both matterircd 0.6 and 0.5 I get :

DEBU[2016-05-24T14:21:07+02:00] invalid character '<' looking for beginning of value  module=matterclient
DEBU[2016-05-24T14:21:07+02:00] LOGIN: %s, reconnecting in %sAppErrorFromJson: model.utils.decode_json.app_error, invalid character '<' looking for beginning of value 1.290908556s  module=matterclient

websocket problem

2016-01-20 10:58:43.732 CRITICAL websocket: close 1006 unexpected EOF

2016-01-20 10:58:40.905 DEBUG -> :[email protected] PRIVMSG #town-square :!lol
2016-01-20 10:58:40.905 DEBUG posting lastview "siyruf5z33yutro8xq7ctk63fe"
2016-01-20 10:58:41.642 DEBUG <- PRIVMSG #town-square :http://imgur.com/eACWcJy.gifv
2016-01-20 10:58:43.732 CRITICAL websocket: close 1006 unexpected EOF
2016-01-20 10:58:43.732 DEBUG retrying login interalia [email protected] mattermost.interalia.net
2016-01-20 10:58:53.157 DEBUG &model.ChannelMember{ChannelId:"mf3mswqoz7nxdekha7e1gk4d4w", UserId:"4mgg3r9zdjdhtkofsbcprnqy8e", Roles:"", LastViewedAt:0, MsgCount:0, MentionCount:0, NotifyProps:model.StringMap{"desktop":"default", "mark_unread":"all"}, LastUpdateAt:0}

Too many established connections

I'm using 0.6.1 version and after a very short time I get several hundred ESTABLISHED connections on my server between mattermost service nad matterircd, which causes my mattermost service to hang because of too many connections.
Has anyone seen this behaviour?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.