Created 2021-09-05
- Hacking
mastodon.radio has an XMPP server, which is mostly there because I wanted to see if I could. WIth some help from Mike it even authenticates using the user's mastodon account (mastodon xmpp config file) but none of that is relevant to this!
Matrix is interesting in that it bridges to lots of other networks. So we have a #hamradio-za IRC channel at Libera.Chat, but it can be fully and easily accessed from Matrix by just joining the room from there. IRC Libera.Chat does already have a global #hamradio channel going too.
And I wondered if we could do XMPP to IRC and things looked hopeful because mod_irc exists. But I couldn't find any documentation on it, and Харпер in the XMPP Service Operators MUC said it was depreciated and the modern option was biboumi.
I patched together some bits from the biboumi documentation and this post by copyninja to get it working, and here follows an idiot's guide to remind me what to do next time (if there is one.)
A quick note on why
There isn't really any obvious advantage to doing this rather than just directly connecting via IRC, but some benefits to me are:
- Extra privacy, as the connection goes via the mastodon.radio server rather than showing my home connection IP to the IRC server
- Persistance, as long as I'm connected to XMPP somehow the IRC connection stays alive
- Persistent authentication, identify with nickserv once on my laptop and I'm identified on my phone too (because the IRC server only sees one connection)
- Seamless multiple devices, I can jump between laptop and mobile and miss nothing
- Battery, blabber uses very little power on my phone (3% over 20 hours)
- I can just keep using the same clients
Configure ejabberd
We need to tell ejabberd about our "external component", which we add to the listen
section
listen:
-
port: 5347
ip: "127.0.0.1"
module: ejabberd_service
access: all
hosts:
"biboumi.mastodon.radio"
password: yourpasswordgoeshere
This password is for biboumi to talk to ejabberd and is needed in the biboumi configuration file.
You can restart ejabberd now and hopefully it will start up happy.
Database configuration
I already have postgres as mastodon uses it, so it was easy to just add a new user and database for this.
First get a root prompt on postgres:
sudo -u postgres psql
Then create our user, give it a password, and create a database:
CREATE USER biboumi CREATEDB;
ALTER USER biboumi WITH PASSWORD 'yourDBpasswordHere';
CREATE DATABASE biboumi OWNER biboumi;
\q
Configure biboumi
Mine is very mich like the example...
hostname=biboumi.mastodon.radio
password=yourpasswordgoeshere
xmpp_server_ip=127.0.0.1
port=5347
admin=[email protected]
db_name=postgresql://biboumi:yourDBpasswordHere@localhost/biboumi
realname_customization=true
realname_from_jid=false
At this point I would run biboumi manually to see if it works and look for any issues and errors (I had a few and this is the final working version.)
sudo biboumi /etc/biboumi/biboumi.cfg
Assuming everything is ok, we can enable and start the service
sudo systemctl enable biboumi.service
sudo systemctl start biboumi.service
Connecting to an IRC channel
From the XMPP side of things we are joining a Multi User Channel (MUC) but the format is slightly verbose, for example to join the hamradio
channel use this magic string:
#hamradio%[email protected]
#hamradio <- is the channel name
%irc.libera.chat <- is the IRC server
@biboumi.mastodon.radio <- is the local transport we set in the configuration
From there everything just sort of worked for me, I'm even able to send and receive messages on my laptop (using dino) and mobile phone (using blabber.im) and a terminal (using profanity.)
In order to speak in the #hamradio room on libera.chat you need to have registered your nickname. Which is fairly easy.
You can't do the usual /msg NickServ
so you need to start a chat with NickServ directly. Their "address" is basically the same as we used to join the channel:
nickserv%[email protected]
(note the lack of a #, 'cos it's not a channel.)
Then you can just message them directly with the usual commands
REGISTER <password> <email>
which will hopefully send you an email with instructions to confirm the registration. Then you need to identify the next time you connect - directly messaging NickServ like you did to register.
IDENTIFY <nick> <password>
If you have any questions, and think I might be able to help, feel free to ping my via XMPP [email protected] or mastodon