To create new wiki account, please join us on #znc at Libera.Chat and ask admins to create a wiki account for you. You can say thanks to spambots for this inconvenience.

Weechat: Difference between revisions

From ZNC
Jump to navigation Jump to search
KindOne (talk | contribs)
Forgot include the network for the password.
KindOne (talk | contribs)
m Connecting: Missed a ssl -> tls.
 
(12 intermediate revisions by 4 users not shown)
Line 4: Line 4:
Connections to ZNC using SSL:
Connections to ZNC using SSL:


   /server add BNC my.bouncer.net/+6697 -ssl -password=username/network:password -autoconnect
Note: Weechat 4.0.0 and newer uses <code>tls</code>. Older versions use <code>ssl</code>.
   /set irc.server.BNC.ssl_verify off
 
<strong> Note that the irc.server.BNC.tls_fingerprint should only be used if you're NOT using a Signed Certificate.</strong>. If you're using a certificate generated with, let's say Let'sEncrypt, you can safely just add the network and you're done.
 
   /server add BNC my.bouncer.net/6697 -tls -username=username/network -password=password -autoconnect
   /set irc.server.BNC.tls_fingerprint MD5_or_SHA256_or_SHA512_fingerprint_here
  /connect BNC
   /save
   /save
===== Getting the SSL fingerprint =====
WeeChat 0.4.3 wants <code>md5</code> (insecure, deprecated) fingerprint (replace <code>-sha512</code> with <code>-md5</code> below or better, upgrade), WeeChat 1.2 allows <code>sha256</code> and <code>sha512</code>.
<strong>Note: This is only necessary if you are not using a Signed SSL Certificate, i.e. if you're using a self-signed certificate.</strong>
cat ~/.znc/znc.pem | openssl x509 -sha512 -fingerprint -noout | tr -d ':' | tr 'A-Z' 'a-z' | cut -d = -f 2


==== Troubleshooting ====
==== Troubleshooting ====
It does not connect.
It does not connect.


If port 6697 is the SSL port, you need to specify the "+" before the port and "-ssl"
If port 6697 is the SSL port, you need to specify that it's SSL port with ''/set irc.server.BNC.tls on''


This is a failed attempt due to not specifying the "+" and/or "-ssl"
This is a failed attempt due to not specifying the "irc.server.BNC.tls on" or "-tls"
   05:46:47    BNC =!= | irc: connection refused
   05:46:47    BNC =!= | irc: connection refused
   05:46:47    BNC  -- | irc: reconnecting to server in 10 seconds
   05:46:47    BNC  -- | irc: reconnecting to server in 10 seconds
Line 24: Line 37:
This is for plain non-ssl connections.
This is for plain non-ssl connections.


   /server add BNC my.bouncer.net/6667 -password=username/network:password -autoconnect
   /server add BNC my.bouncer.net/6667 -username=username/network -password=password -autoconnect
  /connect BNC
   /save   
   /save   


=== Specifying username/network:password later ===
  /set irc.server.bnc.username username/network
  /set irc.server.bnc.password password
== Tips & Tricks ==
=== Enabling server-time & other IRCv3 capabilities ===
* [https://github.com/weechat/weechat/issues/320 WeeChat issue to make this automatic]
WeeChat by default requests no IRCv3 capability from the server acting as not-IRCv3 capable client. This can be fixed with the following commands on WeeChat 0.3.7+:
/set irc.server_default.capabilities account-notify,away-notify,cap-notify,multi-prefix,server-time,znc.in/server-time-iso,znc.in/self-message
/reconnect -all
You must reconnect for this to take effect. This list is "safe capabilities" (see the issue on top of this section) that are supported by WeeChat.
* ''account-notify'' (WeeChat 1.2+) makes the server inform when people login/logout or switch account. '''Requires cap-notify'''
* ''away-notify'' (WeeChat 1.1+) makes the server inform when people go away or come back eliminating the need of who-polling. '''Requires cap-notify'''
* ''cap-notify'' (WeeChat 1.4+) makes the server inform when capabilities come available or disappear. '''ZNC requires this from client for some capabilities''' as it cannot know what capabilities the server supports before it's connected and when ZNC gets disconnected from server the capabilities aren't supported anymore.
* ''multi-prefix'' (WeeChat 0.0.1+) makes the server tell you all prefixes (@+) in case users have multiple prefixes on channel. Without multi-prefix the server only tells the highest prefix and ZNC strips the other prefixes from commands.
* ''server-time'' (WeeChat 0.4.0+) (''znc.in/server-time-iso'' before [[ChangeLogs/1.7.0|1.7.0]]) makes ZNC send buffer playbacks without it's own timestamp (<code>12:00:00 <nick> [00:00:00] blah</code> becomes <code>00:00:00 <nick> blah</code>).
* ''znc.in/self-message'' (WeeChat 0.3.0+) makes ZNC show PMs you have sent in query buffer playback.
'''For all capabilities supported by WeeChat''', see <code>/help cap</code> (WeeChat 1.4+) or <code>/help irc.server_default.capabilities</code> (WeeChat 1.3 & older).
=== Disabling automatic switching of buffer ===
When you connect WeeChat to ZNC, your channels change a lot until you are joined everywhere. This can be disabled with the following commands:
  /set irc.look.buffer_switch_autojoin off
  /set irc.look.buffer_switch_join off
=== Enabling /ZNC and other raw commands ===
WeeChat doesn't send unknown commands to server by default in fear of accidentally sending passwords or other sensitive content. You can disable this with
/set irc.network.send_unknown_commands on
Alternatively you can create Alias
/alias add znc /quote znc
=== Disabling charset plugin ===
ZNC (when compiled with libicu) has the option to do charset conversions. WeeChat does this by default too, but it's easy to disable
/plugin unload charset
/set weechat.plugin.autoload *,!charset


[[Category:Clients]]
[[Category:Clients]]

Latest revision as of 05:24, 28 September 2023

Connecting to ZNC

SSL

Connecting

Connections to ZNC using SSL:

Note: Weechat 4.0.0 and newer uses tls. Older versions use ssl.

Note that the irc.server.BNC.tls_fingerprint should only be used if you're NOT using a Signed Certificate.. If you're using a certificate generated with, let's say Let'sEncrypt, you can safely just add the network and you're done.

 /server add BNC my.bouncer.net/6697 -tls -username=username/network -password=password -autoconnect
 /set irc.server.BNC.tls_fingerprint MD5_or_SHA256_or_SHA512_fingerprint_here
 /connect BNC
 /save
Getting the SSL fingerprint

WeeChat 0.4.3 wants md5 (insecure, deprecated) fingerprint (replace -sha512 with -md5 below or better, upgrade), WeeChat 1.2 allows sha256 and sha512.

Note: This is only necessary if you are not using a Signed SSL Certificate, i.e. if you're using a self-signed certificate.

cat ~/.znc/znc.pem | openssl x509 -sha512 -fingerprint -noout | tr -d ':' | tr 'A-Z' 'a-z' | cut -d = -f 2

Troubleshooting

It does not connect.

If port 6697 is the SSL port, you need to specify that it's SSL port with /set irc.server.BNC.tls on

This is a failed attempt due to not specifying the "irc.server.BNC.tls on" or "-tls"

  05:46:47     BNC =!= | irc: connection refused
  05:46:47     BNC  -- | irc: reconnecting to server in 10 seconds
  05:46:57     BNC  -- | irc: reconnecting to server...
  05:46:57     BNC  -- | irc: connecting to server my.bouncer.net/6697 (SSL)...
  05:46:58     BNC =!= | irc: connection refused

Non SSL

This is for plain non-ssl connections.

 /server add BNC my.bouncer.net/6667 -username=username/network -password=password -autoconnect
 /connect BNC
 /save  

Specifying username/network:password later

 /set irc.server.bnc.username username/network
 /set irc.server.bnc.password password

Tips & Tricks

Enabling server-time & other IRCv3 capabilities

WeeChat by default requests no IRCv3 capability from the server acting as not-IRCv3 capable client. This can be fixed with the following commands on WeeChat 0.3.7+:

/set irc.server_default.capabilities account-notify,away-notify,cap-notify,multi-prefix,server-time,znc.in/server-time-iso,znc.in/self-message
/reconnect -all

You must reconnect for this to take effect. This list is "safe capabilities" (see the issue on top of this section) that are supported by WeeChat.

  • account-notify (WeeChat 1.2+) makes the server inform when people login/logout or switch account. Requires cap-notify
  • away-notify (WeeChat 1.1+) makes the server inform when people go away or come back eliminating the need of who-polling. Requires cap-notify
  • cap-notify (WeeChat 1.4+) makes the server inform when capabilities come available or disappear. ZNC requires this from client for some capabilities as it cannot know what capabilities the server supports before it's connected and when ZNC gets disconnected from server the capabilities aren't supported anymore.
  • multi-prefix (WeeChat 0.0.1+) makes the server tell you all prefixes (@+) in case users have multiple prefixes on channel. Without multi-prefix the server only tells the highest prefix and ZNC strips the other prefixes from commands.
  • server-time (WeeChat 0.4.0+) (znc.in/server-time-iso before 1.7.0) makes ZNC send buffer playbacks without it's own timestamp (12:00:00 <nick> [00:00:00] blah becomes 00:00:00 <nick> blah).
  • znc.in/self-message (WeeChat 0.3.0+) makes ZNC show PMs you have sent in query buffer playback.

For all capabilities supported by WeeChat, see /help cap (WeeChat 1.4+) or /help irc.server_default.capabilities (WeeChat 1.3 & older).

Disabling automatic switching of buffer

When you connect WeeChat to ZNC, your channels change a lot until you are joined everywhere. This can be disabled with the following commands:

 /set irc.look.buffer_switch_autojoin off
 /set irc.look.buffer_switch_join off

Enabling /ZNC and other raw commands

WeeChat doesn't send unknown commands to server by default in fear of accidentally sending passwords or other sensitive content. You can disable this with

/set irc.network.send_unknown_commands on

Alternatively you can create Alias

/alias add znc /quote znc

Disabling charset plugin

ZNC (when compiled with libicu) has the option to do charset conversions. WeeChat does this by default too, but it's easy to disable

/plugin unload charset
/set weechat.plugin.autoload *,!charset