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/pt

From ZNC
Revision as of 12:15, 11 June 2023 by KashinKoji (talk | contribs) (Created page with "{{Languages|Módulos}} == Introdução == Os '''Módulos''' são utilizados para extender a forma como o ZNC funciona. Os utilizadores interagem com os módulos mais habitualmente por envio de mensagens ao um utilizador especial no IRC. Por exemplo, para ver palavras-chave em realce o na sua lista de watch, você enviaria ''/msg *watch list''. quando o ZNC vir que o nick ao qual está a mandar mensagem começa com um asterisco, não irá encaminhar a mensagem para o ser...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introdução

Os Módulos são utilizados para extender a forma como o ZNC funciona. Os utilizadores interagem com os módulos mais habitualmente por envio de mensagens ao um utilizador especial no IRC. Por exemplo, para ver palavras-chave em realce o na sua lista de watch, você enviaria /msg *watch list. quando o ZNC vir que o nick ao qual está a mandar mensagem começa com um asterisco, não irá encaminhar a mensagem para o servidor de IRC mas em vez disso, envia-a para o módulo apropriado para processamento. Neste caso, o módulo watch irá receber a mensagem e responder para si com a listagem das suas palavras-chave. Isto torna muito conviniente e uma forma comum para configurar, isto é, comunicar com os seus módulos carregados, assim como uma forma comum para os seus módulos carregados de mostrarem o estado ou outra informação. Note que isto é para os módulos carregados. você tem de carregar um dado módulo, por exemplo /znc loadmod watch, antes de poder interagir com o módulo watch. A maioria dos módulos irão responder ao /msg *module help com uma listagem de comandos disponíveis.

Os módulos do ZNC são carregados globalmente, por-rede ou por-utilizador. Cada módulo define para ele próprio se está disponível para ser carregado como global, especifico-para-a-rede e/ou especifico-para-o-utilizador. Os módulos ao nível de utilizador e rede podem fazer coisas como manipular as mensagens de entrada/saída. Eles também podem fazer mais tarefas tradicionais do IRC como challenge based auto-op, defini-lo(a) como ausente ou registar logs para o disco. Cada utilizador pode carregar e configurar o seu conjunto de módulos para personalizar a sua experiência para satisfazer as suas preferências.

OS módulos globais são carregáveis por administradores e fornecem funcionalidade ou alteram o comportamento para todos os utilizadores. Por exemplo, o módulo partyline tem de ser global visto que ele fornece a funcionalidade para todos os utilizadores para uma dada instância do ZNC ser capaz de comunicarem ambos de dentro do próprio ZNC. Os módulos globais podem fazer tudo que os módulos do nível-de-utilizador podem fazer, tal como algumas coisas mais. Eles podem substituir o sistema de autenticação do ZNC, modificar o processo de escrita da configuração, lidar com o CAP, etc.

Os módulos podem tambem fixar-se ao interface web do ZNC e fornecer conteúdo da web. O módulo web mais comum é o webadmin que permite aos administradores adicionar/remover utilizadores e permite aos utilizadores configurarem as suas definições a partir de um navegador.

Programadores

OS módulos do ZNC estão escritos nativamente em C++. Existem também 2 módulos que se incorporam como interpretador para lhe permitir carregar módulos Perl, Python ou Tcl. Para saber mais sobre a criação, deve ler módulos Perl, módulos Python, módulos TCL ou módulos C++.

Sinta-se À vontade para criar páginas de wiki acerca de módulos que você criou mas não se esqueça de fornecer um link de transferência, informação de contacto e utilizar o mesmo layout como os restantes módulos. As contribuições serão muito bem apreciadas.

Lista de Módulos

Módulos Globais

adminlog
Log user connects, disconnects, and failed logins to a file and/or to syslog.
blockuser
Blocks certain users from using ZNC, saying their account was disabled.
certauth
This module lets users to log in via SSL client keys.
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.
fail2ban
Block IPs for some time after a failed login.
identfile
Posts the ident of a user to a file when they are trying to connect.
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
Allows you to use modules written on Python.
notify_connect
Sends a notice to all admins when a user logs in or out of ZNC.
partyline
Allows ZNC users to join internal channels and query other ZNC users on the same ZNC.
webadmin
Allows you to add/remove/edit users and settings on the fly via a web browser.

User Modules

admin
(Now controlpanel) Allows you to add/remove/edit users and settings on the fly via IRC messages.
autoattach
Watches your detached channels and reattaches you automatically when there is specified activity in a channel you added to your autoattach list.
autoreply
Gives a automatic reply if someone messages you while you are away.
block_motd
Blocks the server's Message of the Day.
bouncedcc
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.
chansaver
Saves channels to config 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
Allows you to add/remove/edit users and settings on the fly via IRC messages.
ctcpflood
This module tries to block CTCP floods.
dcc
This module allows you to transfer files to and from ZNC
disconkick
This module will kick your client from all channels if ZNC disconnects from server.
flooddetach
This module detaches you from channels which are flooded.
listsockets
This module displays a list of all open sockets in ZNC.
log
Log chat activity to file.
missingmotd
This user module will send 422 to clients when they login.
notes
Keep and replay notes. This is an example of WebMods.
sample
This is an example module to help with writing modules to do whatever you want.
send_raw
Allows you to send raw traffic to IRC from other users.
shell
Access your Unix shell via query right inside of your IRC client.

Network Modules

autocycle
Rejoin a channel when you are the only one there (to gain operator status).
autoop
Automatically give operator status to the good guys.
modtcl
Allows you to run Tcl scripts in ZNC.
autovoice
Automatically give voice status to 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. This module will also set you away when you are idle some time.
cert
This module lets users use their own SSL certificate to connect to a server.
crypt
Encryption for channel/private messages.
keepnick
Tries to get and keep your primary nick if it is taken.
kickrejoin
Implements auto-rejoin-on-kick.
modules_online
Fakes online status of ZNC modules to fix some clients.
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.
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.
simple_away
Automatically set you away on IRC when disconnected from the bouncer.
stickychan
Keeps you in specified channels.
watch
Monitor activity for specific text patterns from specific users and have the text sent to a special query window.

More Modules

For more modules, see Category:Modules.

Managing Modules

Modules can be added or removed easily. Modules can be stored in ~/.znc/modules and /usr/local/lib/znc by default. ZNC installs its modules to that second directory, which in fact is ${prefix}/lib/znc, but this can be changed with ./configure --module-prefix=DIR before compiling.

ZNC will first look in the local sub-directory modules 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: mv sample.so sample.so_.

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

Global, user, and network modules can be (un)loaded from webadmin or via the *status query window, like:

/msg *status LoadMod [--type=global|user|network] <module> <parameters>
/msg *status UnloadMod [--type=global|user|network] <module>
  • * is the StatusPrefix set in your configuration. Usually it's just an asterisk ("*").
  • [--type=global|user|network] optionally specifies whether to (un)load the module as a global, user, or network module. Not all modules can be loaded at all levels; see individual Module documentation to find out where it may be loaded.
  • <module> is based on the modules file name, excluding the ".so" extension.
  • <parameters> are specific for each module and not required: You can provide parameters when loading the module, or you can set up the module after loading it.

So, to load the log module at the global level (as opposed to user or network) and remove all color/formatting control codes with the -sanitize parameter, you would type:

/msg *status LoadMod --type=global log -sanitize

For older versions of ZNC, you won't have the option to specify [--type=global|user|network]. In that case, just use:

/msg *status LoadMod <module> <parameters>
/msg *status UnloadMod <module>

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 a module prevents ZNC from starting up and therefore you can't unload the module using webadmin, you can edit znc.conf and remove the corresponding LoadModule 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 configuration. Usually it's just an asterisk ("*").

External modules

Please see Category:External Modules for a comprehensive list.