• Stars
    star
    284
  • Rank 145,616 (Top 3 %)
  • Language
    Go
  • License
    MIT License
  • Created about 9 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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> <limit>
e.g. /msg mattermost scrollback #bugs 100 shows the last 100 messages of #bugs

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

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

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:

Related

More Repositories

1

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!)
Go
6,030
star
2

dt

DNS tool - display information about your domain
Go
352
star
3

caddy-gitea

Github pages (and more) for gitea using caddy
Go
105
star
4

gomphs

A tool to ping multiple hosts at once with a CLI and web-based overview
Go
71
star
5

nomadctld

ssh server with ability to exec/attach/logs/tail/stop/restart hashicorp nomad containers
Go
67
star
6

matterstuff

Various tools for mattermost
Shell
57
star
7

cssh

Tool to connect to / automate (via ssh only) Cisco switches and accesspoints
Go
39
star
8

rl

Rate limit from stdin to stdout (drop or keep messages)
Go
37
star
9

cost

bitcoin, litecoin, ethereum, altcoin address (pubkey/privkey) generator
Go
22
star
10

vault-plugin-auth-ssh

A Vault plugin to allow authentication via SSH certificates and public keys
Go
20
star
11

asallow

whitelist providers and/or countries using ipset, iptables and ripe data
Go
19
star
12

matterbridge-plus

bridge between mattermost and IRC (using mattermost API instead of webhooks)
Go
11
star
13

bm

bookmark tool inspired by saved.io
Go
11
star
14

ipsetd

ipset daemon (for fast remote ipset manipulation, runs ipset in interactive mode)
Go
10
star
15

ssh-agentx

Extended ssh-agent which supports git commit signing and yubikey signing over ssh
Go
10
star
16

scoop-bucket

Personal scoop bucket. Support for chrome and ms edge.
PowerShell
10
star
17

ulog2queue

Sends ulogd / netfilter json to elasticsearch backend (logstash replacement for your firewall)
Go
9
star
18

teamscli

control microsoft teams from cli, currently only for presence changes and status message updates (needs a working teams app installed)
Go
9
star
19

dhcprelay

simple dhcp relay in go. Ability to bind to a specific outgoing IP
Go
8
star
20

caddy-saml

saml plugin for caddy
Go
8
star
21

isc-dhcp

https://source.isc.org/git/dhcp.git mirror with own patch(es)
C
6
star
22

sshsig

Go library to create/verify armored SSH signatures (https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.sshsig)
Go
5
star
23

csm

Cisco Syslog to Mattermost - logging cisco IOS changes realtime to mattermost
Go
5
star
24

vshare

Share easily read-once and time-limited secrets, configurations or small files with your coworkers or customers.
Go
5
star
25

vim-shfmt

vim plugin for shfmt
Vim Script
5
star
26

nomadgen

Generate nomad plan (hcl) from toml config
Go
4
star
27

plugctl

Smartplug Maginon controller
Go
4
star
28

gomul

Joins multicast ipv4/ipv6 groups on specified interface (used for debugging multicast issues)
Go
3
star
29

docker-netdot_deploy

Shell
3
star
30

sagent

windows ssh agent, implements pageant and supports age ssh decryption
Go
3
star
31

regtag

Tags docker images directly on a remote docker registry without pulling/pushing them first
Go
3
star
32

dotfiles

2
star
33

chromeupdates

Shell
2
star
34

mattermost-dev-docker

Shell
2
star
35

docker-netdot

Shell
2
star
36

minidiary2memoires

1
star
37

registrator-work

Go
1
star
38

rpms

1
star
39

til

Today I learned
1
star
40

winlocked

Very simple library to check if your windows desktop is locked
Go
1
star
41

edgeupdate-provision

Finds latest Microsoft Edge releases and links to full downloads
Rust
1
star
42

snmp-info

snmp-info follows sf.net
Perl
1
star
43

registrator-netfilter

ipv6 firewall (netfilter) module for registrator (https://github.com/gliderlabs/registrator/)
Go
1
star
44

Scoop-core

PowerShell
1
star
45

wptvscraper

Perl
1
star
46

matterclient

Go
1
star
47

edgeupdates

1
star