A Blast From the Past: IRC


IRC is still used by some open-source communities as a chat solution. While I used IRC back in the late 90s and early 00s for gaming, since then all my attempts to jump back into it have been futile. I just found it cumbersome.

Anyway, I have a paid sourcehut subscription and it comes with the chat.sr.ht service. So why not try again?

About IRC

The following is my superficial understanding of how everything works:

There are several separate federated chat networks where the actual channels you want to join are hosted. You probably come along a community you want to join (e.g., Arch Linux has an #archlinux channel on the IRC network ’libera.chat’) which determines which network you will connect to. You then use a client program on your computer/phone, connect to the network and join the channel.

Most text chat solutions we are used to today come with persistence. If I am a member of a slack channel, I see messages that got posted when I was offline. But if I just join an IRC channel from my laptop and then go offline, I will not be able to see messages that got posted while I am not online (though often logs are stored by third party services). In general, IRC’s nature is rather epheremal.

We can ‘solve’ this by having a server that is online 24/7 join the channels, and we connect to this server as an intermediary. That is basically what an IRC bouncer does and what chat.sr.ht offers.

Setting up chat.sr.ht

Don’t forget to a look at the official docs. The idea is that we first configure chat.sr.ht.

Go to chat.sr.ht, log in to your (paid) sourcehut account and click on ‘Add network’ in the top right corner, if you want to connect to a network other than ’libera.chat’. In the left pane, click on ’libera.chat’ or the respective network you just connected to. If you want to register your username with the network follow the network’s instructions (e.g., for libera.chat here).

Assuming you have a registerd name and that the network supports SASL authentication (libera.chat does), there should be a message by the bouncer in the ’libera.chat’ window with a ’login’ link. Click on the link and enter you user name and password.

Join channels by clicking on the ‘Join channel’ button in the top right corner of the ’libera.chat’ window, or use the /join #<channel-name> command.

Setting up a local client

You could just use the web client in your browser, but I want to use a local terminal client. My client will connect to the chat.sr.ht bouncer.

There are two pages in the docs:

  1. Setup guide for chat.sr.ht
  2. Setup guide for many clients

While the bouncer connects to “upstream” networks, we want to connect to the bouncer as a “downstream” client. The first link above shows how to create an access key that we will use to connect to the bouncer.

I chose the senpai client, because it seems to have sane defaults is simple and doesn’t make me want to pull my hair out when trying to set it up. Install senpai and create a configuration file in ~/.config/senpai/senpai.scfg:

# Connecting to a bouncer service.
address chat.sr.ht:6697
tls true
nickname <source-hut-username>
username <source-hut-username>
realname foobar
# I use the `pass` password manager and it's easy enough to pass the access token like this
password-cmd pass show sr.ht/chat.sr.ht-access-token
pane-widths {
    # Disabled list of channel members by default, toggle with F8
    members -16

Calling senpai-irc should now connect to the chat.sr.ht bouncer. Shortcuts:

  • ctrl+p, ctrl+n: previous and next buffer (“window”/“tab”).
  • F8: toggle the member list in a channel

I’m curious to see whether I’ll be using IRC more often now.