Bantracker redesign

Lorenzo J. Lucchini ljlbox at
Mon Apr 7 23:02:45 UTC 2008

On Monday 07 April 2008 23:24:41 Dennis Kaarsemaker wrote:
> 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

That's probably better than doing it by last-n-minutes.

> * 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

Sounds reasonable.

> 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")

What is "Active ops" exactly? Is it different from "the op who did the 

> 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.

I'm not a big fan of the one-year-backlog thing.
Sometimes very old bans *do* become relevant again.
Besides, I think that by using the "one minute timer" trick, stored log sizes 
will dramatically shrink; also, Python offers string compression, and I 
really suspect that keeping logs compressed (whether in or out of the 
database) would have a huge positive impact on space, and a negligible 
negative impact on performance (at least unless you're going to provide 
searching inside the logs).

> 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.

As Tony says, I think removals should be tracked by periodically looking at 
the current ban list and check what bans are still relevant.

> 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

OK, although I'd leave it as an option for channel contacts to request 

On a related topic, I think the bantracker should be publicly accessible 
again, but with two important limitations for anonymous users: comments 
should not be visible (or perhaps some specific comments could be tagged 
as "sensitive"), and banmasks should be scrambled.

I'd also still like a way to link actions together; the "one minute timer" 
partially achieves that, I think, but still it would be nice to link ban 
evaders or simply people who have a habit of changing nicknames.

A similar effect could be achieved also by having the search function look at 
comments, too, so one would simply have to mention the relevant 
nicknames/mask in a comment to make the action show up in a related search.

by LjL
ljl at
-------------- 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: <>

More information about the Ubuntu-irc mailing list