Bantracker redesign

Dennis Kaarsemaker dennis at ubuntu.com
Mon Apr 7 21:24:41 UTC 2008


Now that the new ubotu is taking shape, it's time to port the bantracker
plugin over. Inspired by Pici's ideas, but modified to the new bot,
here's my proposal:

Bantracker design
-----------------

* Keep a log of 200 received events per channel
* When a kick/ban occurs:
    - Start a timer, if one isn't already running which will run for 
      one minute
    - When the timer finishes, store the log for that channel, 
      together with any actions that took place

Model:

class OperatorAction(models.Model):
    when = models.DateTimeField("Time of action", auto_now_add=True)
    channel = models.CharField("Affected channel", maxlength=30)
    masks = models.TextField("Affected masks")
    ops = models.TextField("Active ops")
    log = models.CharField("Filename of log")

class Comment(models.Model):
    action = models.ForeignKey(OperatorAction)
    when = models.DateTimeField("Time of comment", auto_now_add=True)
    who = models.ForeignKey(User)
    what = models.TextField()

I do not want to store the log in the database, this to avoid database
explosion like what has happened with the old code.  For actions older
than a year(up for debate), the log will be deleted.

Import of old data
------------------
For old data, the relevant fields will be imported. Most notably, the
'ban removed by' field will go away. It has proven to be unreliable.
Logs older than one year will not be imported, actions will.

Channels to track
-----------------
Currently bans in all channels are tracked. I'd like to limit that to
only a few core channels.

 - #ubuntu
 - #kubuntu
 - #ubuntu-offtopic
 - #kubuntu-offtopic
 - #ubuntu+1
 - #ubuntuforums

Comments welcome!
-- 
Dennis K.

The universe tends towards maximum irony. Don't push it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-irc/attachments/20080407/f707f373/attachment.pgp>


More information about the Ubuntu-irc mailing list