ubuntu-bots/Bantracker
Terence Simpson ad7a493262 Update copyright/license/author/contributors information
Make sure all files have encoding set to utf-8 unless they already have an encoding
Added COPYING with contense of GPL-2
Added plugin name prefix to all log output. This should take the form of self.log.severity("Plugin: message"),
when not logging from plugin.py use: "Plugin/file_without_dot_py: message"
Bantracker: Made the confgure() function do something, it also creates an initial database if it doesn't exist
Encyclopedia: Made the configure() function do something, it also creates an initial database if it doesn't exist
PackageInfo: Improve the configure() function, it also now creates some initial .list files and prompts to run update_apt and update_apt_file
This goes some way to getting an "ubottu" package together, all we need to do is patch supybot-wizard to download the plugins
from bzr and put them somewhere supybot will see them, then the wizard will do all the initial setup
2010-05-24 14:38:06 +01:00
..
README.txt And now for something completely different... more fixes 2008-11-02 00:47:25 +00:00
__init__.py Update copyright/license/author/contributors information 2010-05-24 14:38:06 +01:00
bans.cgi use /usr/bin/env for #! lines 2010-05-19 14:11:16 +01:00
bans.tmpl Update web interface 2008-09-28 03:11:49 +01:00
config.py Update copyright/license/author/contributors information 2010-05-24 14:38:06 +01:00
empty.tmpl Update web interface 2008-09-28 03:11:49 +01:00
plugin.py Update copyright/license/author/contributors information 2010-05-24 14:38:06 +01:00
test.py Update copyright/license/author/contributors information 2010-05-24 14:38:06 +01: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