💾 Archived View for gemini.susa.net › weechat_znc.gmi captured on 2022-03-01 at 15:16:52. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2021-11-30)

-=-=-=-=-=-=-

Using WeeChat with my ZNC bouncer

An IRC bouncer is like an IRC client with no console or GUI. It remains connected to IRC networks, and I can use a client such as WeeChat or HexChat to connect to my bouncer rather than directly to the IRC servers. This means that I remain on the IRC network when I switch off my computer, and I have the past messages available when I come back online. It's kind of like a proxy, but also a bit like tmux/screen, but also not really!

I have a bouncer that I use with HexChat. It's connected to three IRC networks; tilde, freenode, and espernet. My username on all three is registered as kevinsan, and I also set my bouncer's username to kevinsan.

I want to use this bouncer with WeeChat too.

Install package weechat on Debian with 'sudo apt-get install weechat'

We need to set up a server definition in WeeChat that relates to a server configuration in ZNC.

We can find our ZNC server definitions in znc.conf (e.g. in ~/.znc/configs). I have a user kevinsan on ZNC with a password (that's stored in the config as a salted hash). Within my user configuration, I have a section for each IRC network that I connect to (e.g. one for espernet, one for freenode, and one for tilde).

Therefore, I might want three WeeChat servers configured, one for kevinsan/espernet, one for kevinsan/freenode, and one for kevinsan/tilde). For now, I only want to connect to my ZNC for kevinsan/tilde.

Remember, my bouncer is already connected to each of these networks. What I need to do is to tell WeeChat to connect to my bouncer's version of the IRC network, rather than connect directly to the IRC network.

Since I use SSL with ZNC, I will need my certificate's fingerprint when setting up WeeChat to tell it to trust my server. The command below can be run on the ZNC server to extract fingerprint in a format suitable for weeChat.

# ZNC's certificate fingerprint can be extracted with the following command:
cat ~/.znc/znc.pem | openssl x509 -sha512 -fingerprint -noout | tr -d ':' | tr 'A-Z' 'a-z' | cut -d = -f 2
439cb5ec6cb0576ef42a02784b99719597c4cd734af283d964e2a27014abf0b8f3a620b552d6eb654ad3e6d4efbe232d85c71f2936dfcdbe8387a4159f9db
# In weechat, add the server, naming it 'tilde_znc'. The username refers to my ZNC user/server config
/server add tilde_znc kakapo.susa.net/32767 -ssl -username=kevinsan/tilde -password=********** -autoconnect

# Tell weechat the ZNC server's certificate fingerprint:
/set irc.server.tilde_znc.ssl_fingerprint 439cb5ec6cb0576ef42a02784b99719597c4cd734af283d964e2a27014abf0b8f3a620b552d6eb654ad3e6d4efbe232d85c71f2936dfcdbe8387a4159f9db

# Tell weechat to filter join/part messages (optional)
/filter add joinquit * irc_join,irc_part,irc_quit *

/save

Then when I issue a '/connect', I am brought into my IRC channels on tilde, which for reference is defined in my ZNC config as:

<User kevinsan>
    ... lots of stuff ...
    <Network tilde>
        FloodBurst = 4
        FloodRate = 1.00
        IRCConnectEnabled = true
        JoinDelay = 0
        Server = irc.tilde.chat +6697

        <Chan #gemini>
        </Chan>
    </Network>
</User>

Links

Wiki entry for WeeChat on znc.in

WeeChat quick start guide

Some notes on HexChat with ZNC also apply to WeeChat