Deploy a Glowing Bear Backend (WeeChat Relay) on AlmaLinux 9 or Rocky Linux 9
Set up WeeChat with a TLS-encrypted relay on AlmaLinux 9 or Rocky Linux 9 and use it from any browser through the Glowing Bear web frontend.
Glowing Bear is a web frontend for the WeeChat IRC client. It runs entirely in your browser and talks over a WebSocket to a relay that WeeChat itself provides, so the "backend" is simply a WeeChat instance that stays online on your server. This guide sets up that instance with a TLS-encrypted relay at irc.example.com:9001 on AlmaLinux 9 or Rocky Linux 9 (the same steps work on CentOS Stream 9). CentOS 7 reached end of life in June 2024 and should not be used for new servers.
Glowing Bear is still maintained: its GitHub repository is active, although the last tagged release (0.9.0) dates from July 2020 and the project is delivered as a hosted web app at www.glowing-bear.org. It requires WeeChat 2.9 or later; EPEL 9 ships WeeChat 4.x.
Requirements
- A server running AlmaLinux 9 or Rocky Linux 9 and a non-root user with
sudorights (deployin the examples). Never run WeeChat as root. - A host name whose A (and AAAA) record points to the server, here
irc.example.com. Browsers only accept a relay certificate that matches the name you connect to. - Port 80 free during certificate issuance.
Install WeeChat, tmux and Certbot
WeeChat and Certbot come from the EPEL repository; tmux is in the base system.
sudo dnf install -y epel-release
sudo dnf install -y weechat tmux certbotOpen the firewall
Allow the relay port permanently, and HTTP so Certbot can answer the Let's Encrypt challenge now and at each renewal. There is no need to stop firewalld.
sudo firewall-cmd --permanent --add-port=9001/tcp
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reloadGet a certificate
sudo certbot certonly --standalone -d irc.example.comWeeChat expects the certificate chain and the private key in one file. Its default location is tls/relay.pem inside the WeeChat configuration directory, which is ~/.config/weechat on current versions. Build that file for the deploy user:
sudo -u deploy mkdir -p /home/deploy/.config/weechat/tls
sudo sh -c 'cat /etc/letsencrypt/live/irc.example.com/fullchain.pem /etc/letsencrypt/live/irc.example.com/privkey.pem > /home/deploy/.config/weechat/tls/relay.pem'
sudo chown deploy:deploy /home/deploy/.config/weechat/tls/relay.pem
sudo chmod 600 /home/deploy/.config/weechat/tls/relay.pemStart WeeChat in tmux
Log in as deploy and start WeeChat inside a named tmux session so it keeps running after you disconnect:
tmux new-session -s weechat weechatDetach with Ctrl+b then d; re-attach later with tmux attach -t weechat.
Configure the relay
Type the following in the WeeChat input line. First set a passphrase that encrypts WeeChat's stored secrets, then store the relay password as secured data. Replace the values in angle brackets with your own.
/secure passphrase <your passphrase>
/secure set relay <a long random relay password>
/set relay.network.password "${sec.data.relay}"Load the certificate and add a TLS relay that speaks the weechat protocol, which is the one Glowing Bear uses:
/relay tlscertkey
/relay add tls.weechat 9001Choose a strong relay password: anyone who can log in to the relay can run commands as your user through WeeChat's /exec.
Add an IRC network
This example connects to Libera.Chat over TLS with SASL authentication:
/server add libera irc.libera.chat/6697 -tls
/set irc.server.libera.nicks "<nick1>,<nick2>"
/set irc.server.libera.username "<user name>"
/set irc.server.libera.realname "<real name>"
/set irc.server.libera.sasl_username "<account name>"
/secure set libera <account password>
/set irc.server.libera.sasl_password "${sec.data.libera}"
/set irc.server.libera.autojoin "#channel1,#channel2"
/set irc.server.libera.autoconnect on
/connect liberaOptions are saved automatically when WeeChat exits; run /save to write them immediately. Because a passphrase is set, WeeChat asks for it every time it starts.
Connect from Glowing Bear
- Open
https://www.glowing-bear.orgin your browser. - Under the connection settings enter host
irc.example.com, port9001and the relay password, and keep encryption enabled. - Click Connect. Your WeeChat buffers appear in the browser.
The page is only a client: the connection goes straight from your browser to your server, and TLS is handled by the browser. If the connection fails, check that the host name matches the certificate, that port 9001 is open, and run /relay listrelay in WeeChat to confirm the relay is listening.
Renew the certificate
Certbot renews automatically, but WeeChat reads its own combined copy. Add a deploy hook that rebuilds relay.pem after each renewal:
sudo nano /etc/letsencrypt/renewal-hooks/deploy/weechat-relay.sh#!/bin/sh
cat /etc/letsencrypt/live/irc.example.com/fullchain.pem \
/etc/letsencrypt/live/irc.example.com/privkey.pem \
> /home/deploy/.config/weechat/tls/relay.pem
chown deploy:deploy /home/deploy/.config/weechat/tls/relay.pem
chmod 600 /home/deploy/.config/weechat/tls/relay.pemsudo chmod +x /etc/letsencrypt/renewal-hooks/deploy/weechat-relay.sh
sudo systemctl enable --now certbot-renew.timerAfter a renewal, tell the running WeeChat to load the new file:
/relay tlscertkeyFrequently asked questions
Do I have to host Glowing Bear myself?
No. The hosted page at www.glowing-bear.org is a static web app that never sees your traffic. You can also serve a copy of it from your own web server; the relay setup is identical either way.
Why does the browser refuse to connect with a self-signed certificate?
Glowing Bear cannot override the browser's certificate checks, and a WebSocket connection gives you no warning page to click through. Use a certificate from a public CA such as Let's Encrypt and connect by the exact host name it was issued for.
How do I limit who can reach the relay?
Besides the password, restrict port 9001 in firewalld to the addresses you connect from with a rich rule instead of opening it to everyone. WeeChat can additionally require a time-based one-time password for relay logins.
What happens after a reboot?
The tmux session is gone, so log in and start it again with tmux new-session -s weechat weechat, then enter the passphrase. WeeChat reconnects to networks with autoconnect enabled and re-opens the relay.