I wrote about setting up trac for anonymous ticket creation here.

I upgraded to trac 1.0.1 and lost TracSpamFilter functionality. This post is about getting it working again. It also includes some warnings if you are using https.

Trac seems to be in motion and sometimes figuring out the latest “right” way to do something is confusing. To start, look at the default plugins in the base installation. Log in as admin and select the plugins page. Then click the arrow next to the [Trac ###] item to see available plugins.

TracSpamFilter is not there, it appears we’ll have to specifically (re-)install as a plugin. But that’s easy:

easy_install TracSpamFilter
/etc/init.d/apache2 restart  

And it looks like all my configuration was left intact, whew. Weird that the plugin went away.

Recheck all your configuration settings under the Admin page’s Spam Filtering link. You should also only enable the parts you need, by hitting the sideways dropdown arrow next to TracSpamFilter under the Admin plugins page. Read more here.

Time to test! Testing requires that you set your spam filter scoring so that you know it will trigger a capture, log out, create a new ticket, and hit submit. Only then will trac check your request to see if it is spam. When I tested things out, the need for a capture was properly identified during ticket creation, and the ticket was reloaded under the /capture url.
But the capture failed to be displayed.

So I turned on debugging by adding this to trac.ini (WARNING: trac will resave the trac.ini file stripping out any comments, boo):

[logging]
# MDM This places the log in /var/lib/trac/sites/mysite/log
log_file = trac.log
log_level = INFO
log_type = file

And here’s what I saw…

2013-04-25 14:40:39,070 Trac[env] INFO: Reloading environment due to configuration change
2013-04-25 14:40:42,478 Trac[env] INFO: -------------------------------- environment startup [Trac 1.0.1] --------------------------------
2013-04-25 14:40:42,514 Trac[env] WARNING: base_url option not set in configuration, generated links may be incorrect
2013-04-25 14:40:42,765 Trac[api] WARNING: Unable to find repository '(default)' for synchronization

Does any of that matter? I headed to irc, posted questions… and got nothing over two days of waiting. Let’s go back and analyze the what we’re seeing. Viewing the source revealed that I was getting the captcha code in the html! Good deal. Hitting F12 in google chrome gives you a nice set of tools ripped from the heart of Firefox’s Firebug. After poking around some, I realized that both the recaptcha and keycaptcha code snippets were using http, not https. Chrome is a bitch about this type of stuff. And after firing up Firefox and finding that everything worked fine, I confirmed that it was to blame. You suck, chrome! You can’t introduce new rules, even if they’re good, that break 50% of the web. Well, I can’t really argue, https should be https. But in this case, I can’t even figure out where the plugin code is to fix it. No time this time. So for now, I’m falling back to the “Expression Captcha”, which sucks but is embedded in trac and therefore works everywhere.

I’ll have to revisit this again, when I have time, to get trac to use https in its captcha code snippets. Or, with no irc response, is it time to move from trac to something else?

Here’s a one-liner to get around evil Oracle’s “click the EULA” nonsense, and download their stupid JDK from the linux shell (in this case, the rpm version):

wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk-7u17-download-1501626.html;" http://download.oracle.com/otn-pub/java/jdk/7u17-b02/jdk-7u17-linux-x64.rpm --no-check-certificate -O jdk-7u17-linux-x64.rpm

Note that you’ll have cruft at the end of the filename after downloading unless you use the -O option (thanks Byron).

For other downloads, just change the target and output.

What fun. Original magic cookie fu by this guy, thanks!

Good lord things are getting out of hand in Python land.

I recently bumped up my entire server with the typical emerge –world and –depclean and revdep-rebuild. To get trac working again, I had to jump through some hoops…

  • bump my entire machine, watch trac fail with “ImportError: No module named trac.web.main”
  • run python-updater (which didn’t seem to do enough?)
  • upgrade to unstable trac 1.0.1
  • re-emerge world to upgrade all six versions of python (either new versions were posted overnight or apparently installations were damaged by –depclean?)
  • set active version of python back from 3.2 to 2.7 with eselect
  • re-emerge mod_wsgi
  • restart apache

Of course I did a LOT MORE than that to figure out that that’s what I had to do! 🙂

Ahh the price of fame.

I am loving cross-platform development with Qt, it’s robust and logical and leads to amazing native desktop apps. Before getting started, I expected that there would be lots of platform-specific hackery required, and going cross-platform would slow down the end product by 20-30%. But Qt is so reliable, and well-laid-out, and provides so much more than just lowest-common-denominator functionality, that I’m finding it to be much faster than, e.g., developing a desktop app with C# or Java.

Another reason it is giving me leverage: [n] compilers are better than one. (continued…)

Here are quick instructions to get this done and start using TagLib in your project to manipulate tag data in your music files. I had to pull this together from about 5 different places…

NOTE: This was moved to the wiki, because persistent articles belong on wikis, not blogs! 🙂

Why is this not documented well? I don’t understand why people spend man-years creating great software and then don’t bother to document it – did I just miss it somewhere? Prolly…