tjcsl / cslbot

An easily extensible, modular irc bot.
GNU General Public License v2.0
15 stars 16 forks source link

!admins not allowed control #669

Closed mopes closed 10 years ago

mopes commented 10 years ago

hi, i'm having some problems with being authorized to use certain !triggers with the bot. i have my config setup like:

channel = #lobby ctrlchan = #botchannel extrachans = #that, #other ctrlpass = password nickpass = password ctrlkey = ⟵ what is this? admins = mynick, anothernick

!admins mynick (U), anothernick (U)

!msg #lobby http://goo.gl/vfsLvN You are not a admin.

  1. What am I doing wrong here?
  2. What does ctrlkey do?
  3. What does ctrlchan do?
  4. How do I get (V)erfied as an admin by the bot?

Thanks

sapphire-arches commented 10 years ago
  1. Nothing, as far as I can tell
  2. For channels with +k, the bot needs to know the key to join the channel
  3. ctrlchan is a special channel that the bot watches for specially formated messages which are currently not documented anywhere (we should probably do that). The important ones are accept [issue|quote] and reject [issue|quote] The are used to prevent users from adding quotes and issues that you as an admin to approve/reject quotes and issues.
  4. We use NickServ to verify that the nick is both registered and logged in: We check the return value of /msg NickServ ACC $NICK If you don't have a logged-in NickServ account then you need to make one. If your network doesn't support NickServ, please let us know and we can add the option to disable it.
pefoley2 commented 10 years ago

The ctrlchan messages are documented, just run help in the ctrlchan. The ctrlchan should have a secret key, because otherwise anybody in the channel can send raw irc commands as the bot.

mopes commented 10 years ago

Thanks for the response.

when I type /msg nickserv acc mynick it comes back invalid command, what is the 'acc' part?

sapphire-arches commented 10 years ago

ACC provides a stable, parseable interface for querying a nick's NickServ status. What IRC network are you trying to run the bot on?

mopes commented 10 years ago

i'm on rizon, so i don't think they have that feature. it looks like an option to disable the nickserv verify, or some other means would be my only way to admin the bot.

sapphire-arches commented 10 years ago

Hmm, maybe

 auth_type = none|nickserv|whois

@pefoley2 input? @TechFilmer suggested using whois which outputs [bob_twinkles] is logged in as bob_twinkles and insists it's stable/specified by IRC RFC but I don't trust it

sapphire-arches commented 10 years ago

Yeah, RFC 1459 doesn't specify the format to be returned by /whois

We could go full-crazy and write whois parsers for a bunch of different networks I guess...

sckasturi commented 10 years ago

I'm investigating the exact format used by multiple networks. Be back in a bit with findings.

-----

On Tue, Jan 14, 2014 at 11:12 PM, bobtwinkles notifications@github.comwrote:

Yeah, RFC 1459 doesn't specify the format to be returned by /whois

We could go full-crazy and write whois parsers for a bunch of different networks I guess...

— Reply to this email directly or view it on GitHubhttps://github.com/tjcsl/cslbot/issues/669#issuecomment-32333431 .

sapphire-arches commented 10 years ago

hostmask is another valid option.

mopes commented 10 years ago

indeed, checking against the hostmask would likely work; would it work against a customvhost though?

sapphire-arches commented 10 years ago

We were discussing using vhosts and support for them is definitely possible. The current plan is to use the admins= field as a list of regular expressions describing hostmasks of allowed admins if auth_type = hostmask. If we can get that working adding support for vhost regular expressions should be trivial.

sckasturi commented 10 years ago

After careful testing vhost, cloaks, and hostmasks as a result of +x and IPs works with the current implementation plan. We should be fixing this soon.

mopes commented 10 years ago

Thanks guys, looking forward to it. :)

pefoley2 commented 10 years ago

I'd recommend having the default be NickServ auth, and adding a option to just match nick/hostmasks w/ regex.

an-empty-string commented 10 years ago

One way to do this would be another config variable:

admin_hosts = wikipedia/Fox-Wilson, this.is.a.great.example.of.a.vhost.com, sdamashek.me

then something like this in the is_admin function:

if get_host_for(nick=nick) in admin_hosts:
    return True

before the NickServ check.

pefoley2 commented 10 years ago

ok, but if nickserv doesn't work, we don't want it silently failing every time a admin speaks.

an-empty-string commented 10 years ago

Agreed. do_nickserv = 0? Or just check that admin_hosts is empty before asking NickServ about things?

Also, we should really get some better permissions than just "is an admin" and "is not an admin." I can work on this.

pefoley2 commented 10 years ago

I'd go with something like @bobtwinkles's auth_type=nick|nickserv|hostmask Create another issue to track better permissions.

sckasturi commented 10 years ago

Another option used by Supybot is to have user accounts that people sign into for admin stuff if NickServ is not available. i.e. nickname would privmsg identify uname pword to bot. Then their host mask is stored as being an admin till the bot dies.

-----

On Wed, Jan 15, 2014 at 5:53 PM, pefoley2 notifications@github.com wrote:

I'd go with something like @bobtwinkles https://github.com/bobtwinkles's auth_type=nick|nickserv|hostmask Create another issue to track better permissions.

— Reply to this email directly or view it on GitHubhttps://github.com/tjcsl/cslbot/issues/669#issuecomment-32424501 .

pefoley2 commented 10 years ago

Might work, we could store the full hostmask in sql, and only update it when the nick re-auths (DHCP change, or something).

sckasturi commented 10 years ago

Yeah, I think that is best. User accounts should work really well.

Additionally for more accounts, we can have chan op, bot admin, and owner. That about all I can see as being needed, and afaik that's all that Supybot has.

-----

On Wed, Jan 15, 2014 at 6:51 PM, pefoley2 notifications@github.com wrote:

Might work, we could store the full hostmask in sql, and only update it when the nick re-auths (DHCP change, or something).

— Reply to this email directly or view it on GitHubhttps://github.com/tjcsl/cslbot/issues/669#issuecomment-32428801 .

pefoley2 commented 10 years ago

That has to do with @fwilson42's prospective permissions work, so should really go in that bug when it gets created.

mopes commented 10 years ago

is this supybot the de facto standard or something?

pefoley2 commented 10 years ago

No, just another bot that has some useful features