mirror of https://github.com/dirtbags/moth.git
Kevin now joins +kevin, not #kevin
This commit is contained in:
parent
6b2c413239
commit
4b176a363a
3
Makefile
3
Makefile
|
@ -11,8 +11,7 @@ PYC = __init__.pyc
|
||||||
PYC += config.pyc points.pyc teams.pyc
|
PYC += config.pyc points.pyc teams.pyc
|
||||||
PYC += register.pyc scoreboard.pyc puzzler.pyc
|
PYC += register.pyc scoreboard.pyc puzzler.pyc
|
||||||
PYC += flagd.pyc pointsd.pyc pointscli.pyc
|
PYC += flagd.pyc pointsd.pyc pointscli.pyc
|
||||||
PYC += histogram.pyc
|
PYC += histogram.pyc irc.pyc
|
||||||
#PYC += roshambo.pyc game.pyc
|
|
||||||
|
|
||||||
all: ctf.tce
|
all: ctf.tce
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,8 @@ import sys
|
||||||
import traceback
|
import traceback
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
channel_prefixes = '+#&'
|
||||||
|
|
||||||
class IRCHandler(asynchat.async_chat):
|
class IRCHandler(asynchat.async_chat):
|
||||||
"""IRC Server connection.
|
"""IRC Server connection.
|
||||||
|
|
||||||
|
@ -256,7 +258,7 @@ class User(Recipient):
|
||||||
return 'User(%s, %s, %s)' % (self.name(), self.user, self.host)
|
return 'User(%s, %s, %s)' % (self.name(), self.user, self.host)
|
||||||
|
|
||||||
def recipient(interface, name):
|
def recipient(interface, name):
|
||||||
if name[0] in ['&', '#', '+']:
|
if name[0] in channel_prefixes:
|
||||||
return Channel(interface, name)
|
return Channel(interface, name)
|
||||||
else:
|
else:
|
||||||
return User(interface, name, None, None)
|
return User(interface, name, None, None)
|
||||||
|
@ -327,9 +329,8 @@ class SmartIRCHandler(IRCHandler):
|
||||||
# PRIVMSG ['neale!~user@127.0.0.1', 'PRIVMSG', '#hydra'] firebot, foo
|
# PRIVMSG ['neale!~user@127.0.0.1', 'PRIVMSG', '#hydra'] firebot, foo
|
||||||
# PRIVMSG ['neale!~user@127.0.0.1', 'PRIVMSG', 'firebot'] firebot, foo
|
# PRIVMSG ['neale!~user@127.0.0.1', 'PRIVMSG', 'firebot'] firebot, foo
|
||||||
try:
|
try:
|
||||||
if args[2][0] in '#&':
|
|
||||||
forum = self.recipient(args[2])
|
forum = self.recipient(args[2])
|
||||||
else:
|
if not forum.is_channel():
|
||||||
forum = sender
|
forum = sender
|
||||||
addl = (text,)
|
addl = (text,)
|
||||||
except IndexError:
|
except IndexError:
|
||||||
|
|
|
@ -7,9 +7,8 @@ kevin.tce: target
|
||||||
$(FAKE) sh -c 'cd target && tar -czf - --exclude=placeholder --exclude=*~ .' > $@
|
$(FAKE) sh -c 'cd target && tar -czf - --exclude=placeholder --exclude=*~ .' > $@
|
||||||
|
|
||||||
|
|
||||||
target: kevin.py irc.pyc run log.run
|
target: kevin.py run log.run
|
||||||
$(INSTALL) -d target/usr/lib/ctf/kevin
|
$(INSTALL) -D kevin.py target/usr/bin/kevin.py
|
||||||
$(INSTALL) kevin.py irc.py target/usr/lib/ctf/kevin
|
|
||||||
|
|
||||||
$(INSTALL) --owner=100 -d target/var/lib/ctf/kevin/tokens
|
$(INSTALL) --owner=100 -d target/var/lib/ctf/kevin/tokens
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,8 @@ from ctf.flagd import Flagger
|
||||||
nobody = '\002[nobody]\002'
|
nobody = '\002[nobody]\002'
|
||||||
|
|
||||||
class Kevin(irc.Bot):
|
class Kevin(irc.Bot):
|
||||||
|
debug = True
|
||||||
|
|
||||||
def __init__(self, host, flagger, tokens, victims):
|
def __init__(self, host, flagger, tokens, victims):
|
||||||
irc.Bot.__init__(self, host,
|
irc.Bot.__init__(self, host,
|
||||||
['kevin', 'kev', 'kevin_', 'kev_', 'kevinm', 'kevinm_'],
|
['kevin', 'kev', 'kevin_', 'kev_', 'kevinm', 'kevinm_'],
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
[ -f /var/lib/ctf/disabled/kevin ] && exit 0
|
[ -f /var/lib/ctf/disabled/kevin ] && exit 0
|
||||||
|
|
||||||
exec envuidgid ctf /usr/lib/ctf/kevin/kevin.py --victims=/var/lib/ctf/kevin/victims.txt --tokens=/var/lib/ctf/kevin/tokens
|
exec envuidgid ctf /usr/bin/kevin.py --victims=/var/lib/ctf/kevin/victims.txt --tokens=/var/lib/ctf/kevin/tokens
|
||||||
|
|
Loading…
Reference in New Issue