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)
Restore WeeChat from archive.org - 2016/01/13
Line 3: Line 3:
==== Connecting ====
==== Connecting ====
Connections to ZNC using SSL:
Connections to ZNC using SSL:
First get the fingerprint of the self-signed cert
  $ openssl s_client -connect my.bouncer.net:6697 </dev/null 2>/dev/null | openssl x509 -in /dev/stdin -noout -fingerprint -sha256  | sed s/://g | cut -c 20-


   /server add BNC my.bouncer.net/6697 -ssl -username=username/network -password=password -autoconnect
   /server add BNC my.bouncer.net/6697 -ssl -username=username/network -password=password -autoconnect
   /set irc.server.BNC.ssl_fingerprint PutFingerPrintHere
   /set irc.server.BNC.ssl_fingerprint MD5_or_SHA256_or_SHA512_fingerprint_here
   /connect BNC
   /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>.
cat ~/.znc/znc.pem | openssl x509 -sha512 -fingerprint -noout | tr -d ':' | tr 'A-Z' 'a-z' | cut -d = -f 2


==== Troubleshooting ====
==== Troubleshooting ====
Line 38: Line 40:
   /set irc.server.bnc.password password
   /set irc.server.bnc.password password


== Disabling automatic switching of buffer ==
== 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:
When you connect WeeChat to ZNC, your channels change a lot until you are joined everywhere. This can be disabled with the following commands:
Line 44: Line 67:
   /set irc.look.buffer_switch_autojoin off
   /set irc.look.buffer_switch_autojoin off
   /set irc.look.buffer_switch_join 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]]

Revision as of 02:16, 7 June 2017

Connecting to ZNC

SSL

Connecting

Connections to ZNC using SSL:

 /server add BNC my.bouncer.net/6697 -ssl -username=username/network -password=password -autoconnect
 /set irc.server.BNC.ssl_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.

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.ssl on

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

  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