I wanted to bridge IRC to XMPP and vice versa, here's how to do this with matterbridge.
After having set up both IRC and XMPP servers on my VPS recently I realized that it's annoying to keep multiple clients running with accounts logged into each of them. So I wanted to bridge a specific IRC channel with a XMPP/Jabber group chat channel.
After a little research I went with matterbridge and set it up like this:
- Created a dedicated IRC user to join my existing channel
#lounge - IRC runs ergo with SASL auth enabled
- Created a dedicated XMPP user to join group chat
bridging - XMPP is a prosody server with
mod_muc enabled
My matterbridge.toml looks like this:
[irc]
[irc.default]
Nick="bridge"
NickServNick="bridge"
NickServPassword="secret"
Server="irc.example.org:6697"
UseTLS=true
UseSASL=true
SkipTLSVerify=false
RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
[xmpp]
[xmpp.default]
Server="xmpp.example.org:5222"
Jid="[email protected]"
Password="secret"
Muc="muc.xmpp.example.org"
Nick="bridge"
RemoteNickFormat="[{PROTOCOL}] <{NICK}> "
[[gateway]]
name="irc2xmpp"
enable=true
[[gateway.inout]]
account="irc.default"
channel="#lounge"
[[gateway.inout]]
account="xmpp.default"
channel="bridging"
I've created a dedicated non-login user on my VPS, downloaded the latest binary release, verified the checksums and set up a systemd unit with this config (as per the docs):
[Unit]
Description=Matterbridge daemon
After=network-online.target
[Service]
Type=simple
ExecStart=/home/matterbridge/bin/matterbridge -conf /home/matterbridge/matterbridge.toml
Restart=always
RestartSec=30s
User=matterbridge
[Install]
WantedBy=multi-user.target
Then I ran reloaded systemd's config and enabled the service. Logging in to the two chat solutions I was able to verify that messages are sent across. Hooray for interoperability!
Having this infrastructure in place I may want to bring in all kinds of other chat protocols that are supported, .. <3
#SelfHosting #IRC #XMPP #bridge #matterbridge #interoperability #chat