Setting up IRC for the 21st century

Background

A while back I decided to start avoiding Discord as much as I reasonably could. But when faced with the alternatives, Matrix was not the most appealing to me. From an Electron client being the only really usable option, to frequent homeserver disconnects on both desktop and mobile, I could not see myself using it for any extended period of time. Most annoyingly was having to wait half a minute or more after opening the app (on mobile) to see any new messages. And the interface was clunky!

Well, enough shitting on Matrix. I’m sure at some point it will mature and become a perfectly fine ecosystem. But I like IRC, dammit! And I was going to make sure I had a comfortable experience with it!

My goal was to make IRC as accessible and modern as possible without paying too much money (like an IRC Cloud subscription). All I paid for was a domain name for TLS encryption during transit and push notifications on mobile (which don’t work on The Lounge without an associated domain name).

Setting up ZNC

Before anything else, a bouncer is essential. Without it we cannot have the experience I was looking for, regardless of any clients (except maybe Quassel or Weechat lol but whatever). I run Ubuntu since it was the only 64-bit ARM distro that worked for the RPi 4 when I first got it; not sure if that still holds true, but I’m already on it and it’s working well so no use changing. For our case, on Ubuntu, installing from the PPA is ideal to always be on the latest version.

A good thing to know is that the systemd service for this build runs ZNC as the _znc user. Yeah, with the underscore. Weird, but whatever, not a big deal. Just remember to run the setup as that user and in the _znc-owned /var/lib/znc directory.

This is where we then divert from the usual process. We need one external module that will be essential to having a good cross-platform experience. I’m talking about the clientbuffer module. Compiling is simple, just make sure you have znc-dev installed and run

znc-buildmod clientbuffer.cpp

after cloning the repository with

git clone https://github.com/CyberShadow/znc-clientbuffer.git

and move the resulting file (clientbuffer.so) to /var/lib/znc/modules. That’s it! I expect you can figure out how to configure the rest yourself, just make sure you enable clientbuffer and savebuff for every network you add to your bouncer, and like the wiki page for clientbuffer says:

It is very important that you disable “Auto Clear Chan Buffer” and “Auto Clear Query Buffer” on the Your Settings page, or this module will not work correctly.

Setting up The Lounge

The Lounge is going to be our mobile client. Yes, it’s a web client, but this is actually a positive for mobile IRC. First, running IRC on the background is very battery-consuming (I tried it), and having a web client that is always running on a computer somewhere you can just attach to whenever needed completely negates this issue. Secondly the app can be “installed” as a progressive webapp through Chrome for Android (with push notifications!) or Safari for iOS (no push notifications w/o an external ZNC module, push, sadly, and not native to any client then).

Installing is simple enough, just follow the official guide. Once installed visit the address where you’re hosting it and add your networks through your bouncer as usual, using the clientbuffer notation (username@identifier/network) for the username.

But wait! While I do recommend using an identifier for The Lounge, I don’t recommend setting a buffer for it, because it will always be running in the background so it would just take up processing power and space.

HexChat

Same as The Lounge, but you should get the plug-ins/scripts designed for use with ZNC for the best experience. You can honestly choose any one of the many good native IRC clients on the desktop, HexChat is just my personal preference.

For this one, we will set a buffer according to its identifier. Once you’ve added a network and connected to it through ZNC (and again using username@identifier/network for the username), simply run

/msg *clientbuffer AddClient <identifier>

and it will be added. You now have a separate buffer for your desktop client, so no matter how often you check messages on your phone, you will still be able to see them on your computer!

Conclusion

It took work, but in the end I’m happy with my final setup. It really is more comfortable than any experience I could get on Matrix or even Discord; every channel is just a click or tap away and there’s no clutter or wasted space with icons or user avatars etc. Just good old text. Although, The Lounge can be configured to embed images/videos and to have an uploader, but I really don’t need these features. Sometimes less is better.