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.

Autoop and Irssi: Difference between pages

From ZNC
(Difference between pages)
Jump to navigation Jump to search
Add link to Sopel module
 
m Reverted edits by MetaNova (talk) to last revision by Johncs
Tag: Rollback
 
Line 1: Line 1:
{{DISPLAYTITLE:autoop}}
== Connecting to ZNC ==
{{Core Module | version = 1.0}}
=== SSL ===
This module is meant to auto op users that you have added to your personal list. It attempts to do so using CRAM-MD5 to increase security, but you should always use with caution.


== Usage ==
/network add freenode
{{Module arguments
/server add -net freenode -auto -ssl my.bouncer.net 6697 username/freenode:password
| type = network}}
/save
  /connect freenode


=== Commands ===
=== Non SSL ===
First... add a user or two:
/msg *autoop ADDUSER frank *!*frank@franks.vhost.com pr0z&fr4nkp4ss #mychan


The hostmask format is of the form <code>nick!ident@host</code>, so for the above the nick = <code>*</code>, ident = <code>*frank</code> and host = <code>franks.vhost.com</code>. The supported wildcards are * and ?
/network add freenode
/server add -net freenode -auto my.bouncer.net 6667 username/freenode:password
/save
/connect freenode


<prozac> AddUser frank *!*frank@franks.vhost.com pr0z&fr4nkp4ss #znc
=== Timestamps ===
<*autoop> User [frank] added with hostmask [*!*frank@franks.vhost.com]
<prozac> listusers
<*autoop> +-------+---------------------------+----------------+----------+
<*autoop> | User  | Hostmask                  | Key            | Channels |
<*autoop> +-------+---------------------------+----------------+----------+
<*autoop> | frank | *!*frank@franks.vhost.com | pr0z&fr4nkp4ss | #znc    |
<*autoop> +-------+---------------------------+----------------+----------+


Note: You and Frank '''MUST''' add eachother with the '''SAME''' password as eachother.<br />
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]].
If you want to get ZNC to op a-non ZNC user, set the password as <code>__NOKEY__</code> (in caps, with two underscores each side); then ZNC will just op based on hostmask and whatnot.


Allowed commands to *autoop: ListUsers, AddUser, DelUser, AddChans, DelChans
== Notes ==


=== How it works ===
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>.
Here are the steps:


# Frank_ joins #znc and our znc sees that his host matches the "frank" user
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.
# Our znc sends Frank_ a challenge (random string with 32 characters)
## /notice Frank_ !ZNCAO CHALLENGE <challenge>
# Frank_'s znc appends the challenge to his password and creates an md5 of the two together (MD5(KEY + "::" + CHALLENGE))
# Frank_ sends us the result
## /notice us !ZNCAO RESPONSE <response>
# We verify that it matches using his password on file (you supplied his pass when calling AddUser)
# If he had the correct response our znc will op him in any and all channels that are associated with his user. In this case the only channel would be #znc


There is a queue and timer involved in this process so the auto op will not happen instantly. This is good for two reasons. First, it won't look like obvious auto ops to other people in the channel. Second, if all of the ops have eachother added to their autoop modules then they shouldn't all send the +o mode to the server.
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.


== Eggdrop script ==
[[Category:Clients]]
A script that provides a way for [http://en.wikipedia.org/wiki/Eggdrop Eggdrop] bots to give and gain ops the same way as this module exists and can be downloaded [http://code.google.com/p/pixelz-tcl/downloads/detail?name=znc-autoop-1.0.tar.gz here].
 
Usage:
* Load the script, no settings exist.
* .chattr <handle> +Zo [channel]
* .aopkey <handle> [key/none]
 
== Sopel module ==
A simple module for the [https://github.com/sopel-irc/sopel Sopel] IRC bot is available [https://pastebin.com/5TKSJkkR here].
 
The configuration is non-interactive and has to be edited into the Python file of the module.
 
 
[[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.