ubuntu-bots/Bantracker
Terence Simpson f173b65390 The "Massive Update" edition:
Mess:
 * Fixed file lookup to not depend on order in config file
Encyclopedia:
 * Lots of small fixes and a few additions
Bantracker:
 * Web-interface now has a special oper: keyword, logs can now be hidden too
 * Added new commands: 'updatebt': Syncs with the channel ban list,
   'coment': Reads or adds a comment for a ban,
   'togglemsg': Toggles /msg's from the bot,
   'banlink': Sends a direct link to the a log with a highlight
 * Updated several commands and made hostname lookup more intelligent
2008-08-04 11:11:15 +01:00
..
README.txt Update a couple README.txt files 2008-07-20 17:06:04 +01:00
__init__.py Tweaks and modifications. 2008-05-05 12:34:57 +01:00
bans.cgi The "Massive Update" edition: 2008-08-04 11:11:15 +01:00
bans.tmpl The "Massive Update" edition: 2008-08-04 11:11:15 +01:00
config.py Fix typo in Bantracker/config.py 2008-05-05 16:28:59 +01:00
empty.tmpl Initial checkin 2006-06-26 19:57:20 +02:00
plugin.py The "Massive Update" edition: 2008-08-04 11:11:15 +01:00
test.py Initial checkin 2006-06-26 19:57:20 +02:00

This plugin can store all bans/kicks etc in an sqlite database. It includes a
cgi script to view bans/kicks and comment on them. To view/user the bantracker
web interface a user must use the @btlogin command from the bot. They must also
have the 'bantracker' capability.
You can use the @mark <nick|hostmask> [<channel>] [<comment>]
command to manually add an entry to the bantracker without having to actially
kick/ban someone.

It also uses commoncgi.py which should be on your sys.path (or as you can see in
the script, sys.path is modified to include the dir of commoncgi.py)

The schema of the sqlite database:

CREATE TABLE bans (
                        id INTEGER PRIMARY KEY,
                        channel VARCHAR(30) NOT NULL,
                        mask VARCHAR(100) NOT NULL,
                        operator VARCHAR(30) NOT NULL,
                        time VARCHAR(300) NOT NULL,
                        removal DATETIME,
                        removal_op VARCHAR(30),
                        log TEXT
                   );
CREATE TABLE comments (
                        ban_id INTEGER,
                        who VARCHAR(100) NOT NULL,
                        comment MEDIUMTEXT NOT NULL,
                        time VARCHAR(300) NOT NULL
                   );
CREATE TABLE sessions (
                        session_id VARCHAR(50) PRIMARY KEY,
                        user MEDIUMTEXT NOT NULL,
                        time INT NOT NULL
);
CREATE TABLE users (
                        username VARCHAR(50) PRIMARY KEY,
                        salt VARCHAR(8),
                        password VARCHAR(50)
);

To configure the plugin, create the sqlite database with above structure and set
supybot.plugins.bantracker.database to its filename. Then enable it per channel
by setting the channel variable supybot.plugins.bantracker.enabled

The btlogin function needs the FreenodeAuth plugin