progval / matrix2051

A Matrix gateway for IRC: connect to Matrix from your favorite IRC client.
GNU Affero General Public License v3.0
77 stars 12 forks source link
chat irc ircv3 matrix

Matrix2051

Join Matrix from your favorite IRC client

Matrix2051 (or M51 for short) is an IRC server backed by Matrix. You can also see it as an IRC bouncer that connects to Matrix homeservers instead of IRC servers. In other words:

         IRC client
  (eg. weechat or hexchat)
             |
             |     IRC protocol
             v
         Matrix2051
             |
             |     Matrix protocol
             v
     Your Homeserver
     (eg. matrix.org)

Goals:

  1. Make it easy for IRC users to join Matrix seamlessly
  2. Support existing relay bots, to allows relays that behave better on IRC than existing IRC/Matrix bridges
  3. Bleeding-edge IRCv3 implementation
  4. Very easy to install. This means:
    1. as little configuration and database as possible (ideally zero)
    2. small set of depenencies.

Non-goals:

  1. Being a hosted service (it would require spam countermeasures, and that's a lot of work).
  2. TLS support (see previous point). Just run it on localhost. If you really need it to be remote, access it via a VPN or a reverse proxy.
  3. Connecting to multiple accounts per IRC connection or to other protocols (à la Bitlbee). This conflicts with goals 1 and 4.
  4. Implementing any features not natively by both protocols (ie. no need for service bots that you interract with using PRIVMSG)

Major features

Shortcomings

Screenshot

screenshot of #synapse:matrix.org with Element and IRCCloud side-by-side

Two notes on this screenshot:

Usage

See below for extra instructions to work with web clients.

See INSTALL.md for a more production-oriented guide.

Architecture

Every time irc_server.ex receives a connection, it spawns irc_conn/supervisor.ex, which supervises:

Utilities:

Questions

Why?

There are many great IRC clients, but I can't find a Matrix client I like. Yet, some communities are moving from IRC to Matrix, so I wrote this so I can join them with a comfortable client.

This is also a way to prototype the latest IRCv3 features easily, and for me to learn the Matrix protocol.

What IRC clients are supported?

In theory, any IRC client should work. In particular, I test it with Gamja, IRCCloud, The Lounge, and WeeChat.

Please open an issue if your client has any issue.

What Matrix homeservers are supported?

In theory, any, as I wrote this by reading the Matrix specs. In practice, this is only tested with Synapse.

A notable exception is registration, which uses a Synapse-specific API as Matrix itself does not specify registration.

Please open an issue if you have any issue with your homeserver (a dummy login/password I can use to connect to it would be appreciated).

Are you planning to support features X, Y, ...?

At the time of writing, if both Matrix and IRC/IRCv3 support them, Matrix2051 likely will. Take a look at the list of open 'enhancement' issues.

A notable exception is direct messages, because Matrix's model differs significantly from IRC's.

Can I connect with a web client?

To connect web clients, you need a websocket gateway. Matrix2051 was tested with KiwiIRC's webircgateway (try this patch if you need to run it on old Go versions).

Here is how you can configure it to connect to Matrix2051 with Gamja:

[fileserving]
enabled = true
webroot = "/path/to/gamja"

[upstream.1]
hostname = "localhost"
port = 2051
tls = false
# Connection timeout in seconds
timeout = 20
# Throttle the lines being written by X per second
throttle = 100
webirc = ""
serverpassword = ""

What's with the name?

This is a reference to xkcd 1782:

2004: Our team stays in touch over IRC. 2010: Our team mainly uses Skype, but some of us prefer to stick to IRC. 2017: We've got almost everyone on Slack, But three people refuse to quit IRC and connect via gateway. 2051: All consciousnesses have merged with the Galactic Singularity, Except for one guy who insists on joining through his IRC client. "I just have it set up the way I want, okay?!" *Sigh*

I still have a question, how can I contact you?

Join #matrix2051 at irc.interlinked.me. (No I am not eating my own dogfood, I still prefer "native" IRC.)