Bantracker redesign
Martin Meredith
mez at ubuntu.com
Mon Apr 7 21:27:10 UTC 2008
Why not keep it in a nicer database? use MySQL or similar instead of
SQLite (or use a newer version of SQLite with regular vacuums and
removes (remove old stuff) ? (I hear from one of the devs the newer
versions are a lot less intensive))
On Mon, 2008-04-07 at 23:24 +0200, 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
> * 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!
More information about the Ubuntu-irc
mailing list