Posts Tagged ‘spam’

Loving trac, hating spammers

2009/08/21

I love the tool called trac which allow development teams to easily follow the life of their project, manege Bug Report and Enhancement requests, wiki, link to SVN, ….

But I hate spammers who are stupid enough to think that creating a bunch of iki pages on my trac will help them sell more.

I tried to find an easy way to avoid them doing that. In trac 0.10 it doesn’t seem so easy. So I removed wiki page creation, even for authenticated person. They will have to ask me to create the page first.

And then I wrote that smal script to remove all the pages from trac. Feel free to adapt and reuse. Fight against spammers is a good one !

#!/bin/bash
# Provided under the GPL v2
#
if [ "$1" = "-f" ]; then
        doit=true
else
        doit=false
fi

# replace with your list of trac DB
for pj in /mondo/*/trac/* ; do
        for p in `trac-admin $pj wiki list | 
            awk '{print $1}' | 
            grep -E '_download$|_buy_|_buy$'`; do
                echo "Deleting $p..."
                if [ $doit = "true" ]; then
                        trac-admin $pj wiki  remove $p
                fi
        done
done

Launch it first to see what it will do. Then relaunch with -f to see the spam wiki pages disappear !
I hate spammers.

But now I love my new shiny trac again ;-