Mozbot/Documentation/Oping

From MozillaWiki
Jump to: navigation, search

This page will help you set up mozbot in a channel on an IRC server where a mozbot instance is running, so that mozbot stays in the channel to keep it op people who you want to give ops to. Note that you can do this even if you are not the bot's administrator, although currently you do have to speak to them at one point.

Preliminary Setup

This section will set you up as a channel administrator. First, invite the bot into your channel:

<kbd>/invite mozbot <var>#channel</var></kbd>
--- You're inviting mozbot to <var>#channel</var> (irc.example.org)
--> mozbot (pid-12345@user.example.net) has joined <var>#channel</var>

For this to work, you have to be an op in the channel, the bot admin has to have set the Admin module's allowInviting setting to 1 and if the channel is keyed, the key must be listed in the channelKeys hash (another Admin module variable). If it doesn't work, get the bot admin to say:

<kbd>/msg mozbot join <var>#channel</var></kbd>

Next, get a user account in the bot (if you are the admin you already have one and can skip this step and the next one):

<kbd>/msg mozbot newuser <var>username</var> <var>password</var> <var>password</var></kbd>
*mozbot* New user '<var>username</var>' added with password '<var>password</var>' and no rights.

Now get the bot admin to promote you in your channel by getting them to send the bot the promote command:

<kbd>/msg mozbot promote <var>username</var> in <var>#channel</var></kbd>
*mozbot* User '<var>username</var>' promoted to channel administrator status in channel '<var>#channel</var>'.

At this stage you should have channel admin status in your channel as far as the bot is concerned.

Adding Users

First, authenticate with the bot:

<kbd>/msg mozbot auth <var>username</var> <var>password</var></kbd>
*mozbot* Hi <var>username</var>!

Next, make sure the bot is opped, otherwise it can't op anyone itself:

<kbd>/mode <var>#channel</var> +o mozbot</kbd>
--- IRCMonkey gives channel operator status to mozbot

Now it's time to add users to your list of people to autoop. They need to send the same commands you did to create an account:

<kbd>/msg mozbot newuser <var>username</var> <var>password</var> <var>password</var></kbd>
*mozbot* New user '<var>username</var>' added with password '<var>password</var>' and no rights.

You then add them to the autoop list by saying:

<IRCMonkey> <kbd>mozbot: autoop <var>username</var> in <var>#channel</var></kbd>
<mozbot> IRCMonkey: User '<var>username</var>' added to the autoop list of channel '<var>#channel</var>'.

Now, when they authenticate with the bot, they will get opped:

<kbd>/msg mozbot auth <var>username</var> <var>password</var></kbd>
*mozbot* Hi <var>username</var>!
--- mozbot gives channel operator status to IRCMonkey2
<IRCMonkey2> <kbd>thanks</kbd>
<mozbot> IRCMonkey2: np

Adding hostmasks

NOTE: This is discouraged. The authentication method (previous section) is a lot safer. Some people prefer to get mozbot to op people based on their originating host, their username, or, even worse, their nick. Using the host is suboptimal (host names can be spoofed). Using the username or nick is just plain stupid. To add a mask, you use the add mask command. Masks can be either regular expressions matched against the user@host string or hostmasks in the traditional IRC way. Example masks are:

hostmask: *!*@*

regexp: .*

These match any nick, any username, and any hostname, you probably wouldn't want to use them because they would op everyone who comes into your channel.

hostmask: *!*@adsl-63-197-31-110.dsl.snfc21.pacbell.net

regexp: ^.*\@adsl-63-197-31-110\.dsl\.snfc21\.pacbell\.net$

Both of these match any user with a domain name of adsl-63-197-31-110.dsl.snfc21.pacbell.net. This is something that you would want to use because no matter what nick someone is using they will get oped. However, they must have a static IP address to do this.

regexp: ^.*\@adsl-63-197-31-[0-9]+\.dsl\.snfc21\.pacbell\.net$

This regexp will match a subset of Pacbell's users. It is a compromise between the odds that no-one with bad intentions will happen to have the same ISP in the same area as the user, and the convenience of autoopping.

hostmask: joeshmoe!*@*.ipt.aol.com

Matches anyone with the nick joeshmoe who uses AOL. This is a good way of opping anyone who uses AOL and has brains.

hostmask: joeshmoe!joeiscool@*

Matches anyone with the brains to change their username.

Once you have constructed a mask you pass it to mozbot like this:

<IRCMonkey> <kbd>mozbot: add mask <var>mask</var> in <var>#channel</var></kbd>
<mozbot> IRCMonkey: Mask '<var>mask</var>' added to the autoop list of channel '<var>#channel</var>'.

Now, when anyone matching that mask enters the channel, they will get opped:

--> IRCMonkey2 (luser@user2.example.net) has joined <var>#channel</var>
--- mozbot gives channel operator status to IRCMonkey2

Other Commands

To get a list of who gets opped in a channel, use the ops command. (Note. Anyone can do that, so don't rely on the masks being secret. Security by obscurity is poor security indeed.)

<IRCMonkey> <kbd>mozbot: ops in <var>#channel</var></kbd>
<mozbot> IRCMonkey: #ui admins: <var>username</var>
<mozbot> IRCMonkey: #ui ops: <var>username</var>
<mozbot> IRCMonkey: #ui autoop masks: <var>mask</var>

The other commands available can be found through the online help

of the bot.