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.

Modules and Irssi: Difference between pages

From ZNC
(Difference between pages)
Jump to navigation Jump to search
>Paccer
No edit summary
 
m Reverted edits by MetaNova (talk) to last revision by Johncs
Tag: Rollback
 
Line 1: Line 1:
{{Languages}}
== Connecting to ZNC ==
=== SSL ===


== Overview ==
/network add freenode
Modules are most commonly interfaced with by messaging a special user on irc. For example, to view the highlight keywords in your watch list, you'd send ''/msg *watch list''. When znc sees that the nick you're msging starts with an asterisk, it doesn't forward the message to the ircd but instead sends it to the proper module for processingIn this case, the watch module will get the message and reply to you with a listing of your keywords.  This makes for a very convenient and standard way of configuring or otherwise communicating with your loaded modules as well as a common and standard way for your loaded modules to display status or other information back to you.  Notice that we said "loaded modules" which brings up the point that you first have to ''/znc loadmod watch'' before you can interface with the watch module. Most modules will reply to ''/msg *module help'' with a listing of commands.
  /server add -net freenode -auto -ssl my.bouncer.net 6697 username/freenode:password
  /save
  /connect freenode


ZNC modules are loaded either globally, per-network or on a per-user basis.  Each module itself defines whether it is global, network or user specific.  User level and network modules can do things ranging from [[crypt|manipulating the incoming/outgoing messages]] to implementing a full blown [[twitter]] client.  They can also do more traditional irc tasks such as [[autoop|challenge based auto-op]], [[simple_away|setting you away]], or [[log|logging to disk]].  Each user gets to load and configure their own set of modules to customize their experience to suit their preference.
=== Non SSL ===


Global modules are loadable by admins and provide functionality or change behavior for all users. For example, the [[partyline]] module has to be global since it provides functionality for all users on a given znc instance to be able to communicate with each other from within znc itselfGlobal modules can do everything that user level modules can do as well as a few extras. They can replace ZNC's [[imapauth|authentication system]], modify the config writing process, deal with CAP, etc.
/network add freenode
/server add -net freenode -auto my.bouncer.net 6667 username/freenode:password
  /save
  /connect freenode


The modules can also hook into znc's [[WebMods|web interface]] and provide web content.  The most common web module is [[webadmin]] which allows admins to add/remove users and allows users to configure their settings from a browser. 
=== Timestamps ===


== Developers ==
irssi does not support the server-time capability yet, so buffer playback may look ugly. There's a script you can run to get basic server-time support in irssi however, see [[Timestamps#irssi]].
ZNC modules are written in C++ natively. There are also a couple of modules that embed an interpreter to allow you to load perl, python or tcl modules. To learn more about creation of modules you should read [[modperl|Perl Modules]], [[modpython|Python Modules]], [[modtcl|TCL Modules]], or [[Writing modules|C++ Modules]].  Feel free to create wikipages about modules you created, but don't forget to add a download link, contact information and use the same layout as the rest of the modules. Contributions are always much appreciated.


== Module List ==
== Notes ==
=== Global Modules ===
; [[adminlog]] : Log user connects and disconnects and failed logins to file or syslog.
; [[blockuser]] : Blocks certain users from using ZNC saying their account was disabled.
; [[certauth]] : This module let's users to log in via SSL client keys.
; [[connect_throttle]] : Limit the number of login attempts a user can make per time
; [[fail2ban]] : Block IPs for some time after a failed login.
; [[imapauth]] : Allow users to authenticate via IMAP.
; [[lastseen]] : Logs when a user last logged in to ZNC.
; [[modperl]] : Loads perl scripts as ZNC modules.
; [[modpython]] : Modpython allows you to use modules written on python 3.
; [[modtcl]] : Allows you to run tcl scripts in ZNC, including some eggdrop.
; [[partyline]] : Allows ZNC users to join internal channels and query other ZNC users on the same ZNC.
; [[saslauth]] : Allow users to authenticate via SASL.
; [[webadmin]] : Allows you to add/remove/edit users and settings on the fly via a web browser.
; [[notify_connect]] : Sends a notice to all admins when a user logs in or out.


=== User Modules ===
Irssi does not send unknown commands to irc server or znc so you will get an unknown command error when you try to use the <code>/znc</code> alias. If you want <code>/znc</code> to work you need to enter <code>/alias znc msg *status</code>.
; [[admin]] : Allows you to add/remove/edit users and settings on the fly via IRC messages.
; [[autoattach]] : Autoattach watches your detached channels and reattaches you automatically when there is activity in a channel you added to your autoattach list. Read the page about detaching to learn about detached channels.  
; [[autocycle]] : Cycles a channel when you are the only one in there and you don't have op.
; [[autoop]] : Auto op the good guys.
; [[autoreply]] : Gives a automatic reply if someone messages you if you are away.
; [[autovoice]]: Autovoices everyone who joins some channel.
; [[awaynick]] : Change your nick while you are away.
; [[awaystore]] : When you are set away or detached, this module will save all private messages for you. The messages can be read until you delete them. Messages are stored in an encrypted file on your shell (based on the <password> you set, if set). That way everyone who has access to this shell still cannot read your messages. This module will also set you away when you are idle some time (see timer/settimer).
; [[block_motd]] : This module blocks the server's Message of the Day.
; [[bouncedcc]] : The bouncedcc module bounces dcc transfers through the znc server instead of sending them directly to the user. 
; [[buffextras]] : Add nick changes, joins, parts, topic changes etc. to your playback buffer.
; [[cert]] : This module lets users use their own SSL certificate to connect to a server
; [[chansaver]] : Keeping config up to date when user joins and parts.
; [[charset]] : Normalizes (i.e. converts) character encodings.
; [[clearbufferonmsg]] : This module attempts to bridge the gap between being inundated with old buffer if you have KeepBuffer=true; and possibly missing messages when you ping out, if you have KeepBuffer=false.
; [[clientnotify]] : Notify about new incoming connections to your user.
; [[controlpanel]] : This module allows you to add/remove/edit users and settings on the fly via IRC messages.
; [[crypt]] : Encryption for channel/private messages.
; [[ctcpflood]] : This module tries to block ctcp floods.
; [[cyrusauth]] : This module is intended for admins who run a shell/web/email/etc server and want to provide ZNC access to their existing users.
; [[dcc]] : This module allows you to transfer files to and from ZNC
; [[disconkick]] : This module will kick your client from all channels where you are, in case if ZNC disconnects from server.
; [[flooddetach]] : This module detaches you from channels which are flooded.
; [[identfile]] : The identfile module places the ident of a user to a file when they are trying to connect.
; [[keepnick]] : Tries to get you your primary nick.
; [[kickrejoin]] : Implements auto-rejoin-on-kick.
; [[listsockets]] : This module displays a list of all open sockets in ZNC.
; [[log]] : Log conversations to file.
; [[missingmotd]] : This user module will send 422 to clients when they login.
; [[nickserv]] : Auths you with NickServ.
; [[perform]] : Performs commands on connect.
; [[q]] : Auths you with Q (and a little more).
; [[raw]] : View all of the raw traffic.
; [[route_replies]] : Routes back answers to the right client when connected with multiple clients.
; [[sample]] : This is an example for [[writing modules]] to do whatever you want.
; [[sasl]] : Allows you to authenticate to an IRC network via SASL
; [[savebuff]] : Saves your channel buffers into an encrypted file so they can survive restarts and reboots.
; [[schat]] : SSL (encrypted) DCC chats.
; [[send_raw]] : Allows you to send raw traffic to IRC from other users.
; [[shell]] : Have your unix shell in a query window right inside of your IRC client.
; [[simple_away]]: Automatically set you away on IRC when disconnected from the bouncer.
; [[stickychan]] : Keeps you sticked to specific channels.
; [[watch]] : Monitor activity for specific text patterns from specific users and have the text sent to a special query window.


=== More Modules ===
Or, you can download [http://scripts.irssi.org/scripts/dispatch.pl dispatch.pl] placing the script in <code>~/.irssi/scripts/autorun</code> and typing <code>/script load autorun/dispatch</code>. You will only need to enter the command once as irssi will automatically load the script next time irssi is started.
For more modules, see [[:Category:Modules]].


== Managing Modules ==
Irssi by default will create new channel windows each time znc reconnects to the irc network. After you join all your channels you can enter <code>/layout save</code> to have irssi reuse channel windows instead of creating new windows.
Modules can be added or removed easily. Modules can be stored in <code>~/.znc/modules</code> and <code>/usr/local/lib/znc</code> by default. ZNC installs its modules to that second directory, which in fact is <code>${prefix}/lib/znc</code>, but this can be changed with <code>./configure --module-prefix=DIR</code> before compiling.


ZNC will first look in the local sub-directory <code>modules</code> when searching for modules. Only files that end with ".so" will be seen as a module. To remove modules you can simply delete them from the folder. No other configuration changes or restarts are necessary. To remove, but also keep a module for later use you can also change the name, like: <code>mv sample.so sample.so_</code>.
[[Category:Clients]]
 
To compile a new module you must first save the source as a ".cpp" file. [[Compiling modules]] describes the process in detail.
 
=== (Un)Loading Modules ===
Both global and user modules can be (un)loaded from [[webadmin]] or via the *status query window, like:
 
/msg *status loadmod <module> <parameters>
/msg *status unloadmod <module>
 
* <code>*</code> is the StatusPrefix set in your [[configuration]]. Usually it's just an asterisk ("*").
* <code><module></code> is based on the modules file name excluding ".so".
* <code><parameters></code> are specific for each module and not required.
 
Please keep in mind, that a user is not able to load a module, if the directive "DenyLoadMod" is set to true.
Trying to load a module will fail with "Unable to load [<module>] Access Denied.".
 
If some module blocks startup of ZNC and therefore you can't unload the module using [[webadmin]], you can edit [[configuration|znc.conf]] and remove the corresponding <code>LoadModule</code> line.
 
== Using modules ==
It is recommended to read the module's wikipage if you want to find out how a module works. Alternatively the following command can be used to get a command list:
/msg *<module> help
* * is the StatusPrefix set in your config file.
 
== External modules ==
; [[amsgfilter]] : Filters amsgs from specified channels.
; [[antiidle]] : Hides your idle time.
; [[autoattach]] : Reattaches you to channels on activity.
; [[colloquy]] : Push private messages and highlights to your iPhone/iPod Touch via Colloquy Mobile.
; [[droproot]] : Allows ZNC to drop root privileges on systems that implement POSIX setuid/setgid.
; [[email]] : Monitors email activity on local disk /var/mail/user.
; [[fakeonline]] : Fakes online status of ZNC *-users, to fix some clients.
; [[fish]] : FiSH encryption for channel/private messages.
; [[fixfreenode]] : This module blocks some freenode-specific feature which results in plus (+) and minus (-) signs being displayed in front of every message from a client.
; [[motdfile]] : Reads a MOTD from a file and displays it to users when they login.
; [[notify]] : Notifies all ZNC users when a client attaches/detaches.
; [[push]] : Send private messages and highlights to your mobile devices using various push notification services.  Includes a highly configurable set of conditions to control how and when notifications get sent.
; [[twitter]] : Implements a Twitter client. It can post new tweets and monitor searches, users, timeline and @mentions.
 
See this page for a list of external modules
[[:Category:External Modules]]
 
 
 
[[Category:Modules]]

Revision as of 23:35, 30 July 2019

Connecting to ZNC

SSL

/network add freenode 
/server add -net freenode -auto -ssl my.bouncer.net 6697 username/freenode:password
/save
/connect freenode

Non SSL

/network add freenode 
/server add -net freenode -auto my.bouncer.net 6667 username/freenode:password
/save
/connect freenode

Timestamps

irssi does not support the server-time capability yet, so buffer playback may look ugly. There's a script you can run to get basic server-time support in irssi however, see Timestamps#irssi.

Notes

Irssi does not send unknown commands to irc server or znc so you will get an unknown command error when you try to use the /znc alias. If you want /znc to work you need to enter /alias znc msg *status.

Or, you can download dispatch.pl placing the script in ~/.irssi/scripts/autorun and typing /script load autorun/dispatch. You will only need to enter the command once as irssi will automatically load the script next time irssi is started.

Irssi by default will create new channel windows each time znc reconnects to the irc network. After you join all your channels you can enter /layout save to have irssi reuse channel windows instead of creating new windows.