ZNC: Difference between revisions
imported>Mth Created page with "=ZNC= [https://znc.in/ ZNC] is an [https://en.wikipedia.org/wiki/Internet_Relay_Chat IRC] bouncer: it stays connected to IRC networks so clients can disconnect without missin..." |
mNo edit summary |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
[https://znc.in/ ZNC] is an [https://en.wikipedia.org/wiki/Internet_Relay_Chat IRC] bouncer: it stays connected to IRC networks so clients can disconnect without missing messages or losing the session. | [https://znc.in/ ZNC] is an [https://en.wikipedia.org/wiki/Internet_Relay_Chat IRC] bouncer: it stays connected to IRC networks so clients can disconnect without missing messages or losing the session. | ||
Line 10: | Line 8: | ||
enable = true; | enable = true; | ||
mutable = false; # Overwrite configuration set by ZNC from the web and chat interfaces. | mutable = false; # Overwrite configuration set by ZNC from the web and chat interfaces. | ||
useLegacyConfig = false; # | useLegacyConfig = false; # Turn off services.znc.confOptions and their defaults. | ||
openFirewall = true; # ZNC uses TCP port 5000 by default. | |||
}; | }; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 18: | Line 17: | ||
==Clients== | ==Clients== | ||
Choose a password, and extract a hash with: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
$ nix-shell --packages znc --command "znc --makepass" | $ nix-shell --packages znc --command "znc --makepass" | ||
Line 25: | Line 24: | ||
Then, in <code>configuration.nix</code>: | Then, in <code>configuration.nix</code>: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
services.znc | services.znc.config = { | ||
LoadModule = [ "adminlog" ]; # Write access logs to ~znc/moddata/adminlog/znc.log. | |||
User.bob = { | |||
Admin = true; | |||
Pass.password = { | |||
Method = "sha256"; # Fill out this section | |||
Hash = "..."; # with the generated hash. | |||
Salt = "..."; | |||
}; | }; | ||
}; | }; | ||
Line 47: | Line 42: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Next, see [https://wiki.znc.in/Connecting_to_ZNC Connecting] and [https://wiki.znc.in/Category:Clients Category:Clients] on the ZNC wiki. | |||
==Networks== | ==Networks== | ||
SASL authentication is not yet supported from <code>configuration.nix</code>. Either <code>/msg *sasl</code> <ref>See [https://wiki.znc.in/Sasl Sasl] on the ZNC wiki.</ref> or use NickServ instead as shown below. | |||
{{ | <syntaxhighlight lang="nix"> | ||
service.znc.config.User.bob = { | |||
Network.freenode = { | |||
Server = "chat.freenode.net +6697"; | |||
Chan = { "#nixos" = {}; "#nixos-wiki" = {}; }; | |||
Nick = "bob"; # Supply your password as an argument | |||
LoadModule = [ "nickserv yourpassword" ]; # <- to the nickserv module here. | |||
JoinDelay = 2; # Avoid joining channels before authenticating. | |||
}; | |||
}; | |||
</syntaxhighlight> | |||
[[Category:Applications]] |