{"id":1440,"date":"2012-07-26T12:19:01","date_gmt":"2012-07-26T17:19:01","guid":{"rendered":"http:\/\/bitpost.com\/news\/?p=1440"},"modified":"2013-04-25T09:53:12","modified_gmt":"2013-04-25T14:53:12","slug":"howto-configure-tracspam-to-allow-anonymous-ticket-creation-in-trac","status":"publish","type":"post","link":"https:\/\/bitpost.com\/news\/2012\/howto-configure-tracspam-to-allow-anonymous-ticket-creation-in-trac\/","title":{"rendered":"HOWTO configure TracSpam to allow anonymous ticket creation in Trac"},"content":{"rendered":"<p>Trac is nice and simple and clean and &#8220;suits me well&#8221; for now. I was able to quickly add custom fields and use them on the front page of my <a title=\"TDA bug and feature tracker\" href=\"https:\/\/thedigitalage.org\/tracker\/thedigitalage\" target=\"_blank\">tracker<\/a>. And it supports the ability for anyone to anonymously add a new ticket, which is the Holy Grail of getting feedback. But getting feedback includes getting spammed. I was getting a few spam tickets every minute, making things unusable. How to fix?<\/p>\n<p>TracSpam to the rescue. It&#8217;s built in to trac, but it required some tweaking&#8230;<!--more--><\/p>\n<ol>\n<li>Install trac<\/li>\n<li>Add this to trac.ini to make sure TracSpam is completely enabled, and restart apache (required). I would remove any other tracspamfilter lines.\n<pre><code>[components]\r\ntracspamfilter.* = enabled<\/code><\/pre>\n<\/li>\n<li>Log in as admin.<\/li>\n<li>From the Admin -&gt; Permissions page, add the TICKET_CREATE action to the anonymous subject.\u00a0 Crazy, but I&#8217;ve gotten spam captured pretty well enough to make this work.<\/li>\n<li>Select Spam Filtering -&gt; Capture, and make sure [x] Enabled is checked, and captcha type is Recaptcha.<\/li>\n<li>Go to <a href=\"http:\/\/www.google.com\/recaptcha\">Google reCAPTCHA<\/a> and get some keys for your site.\u00a0 Add them on the Capture admin page (and save them somewhere else).<\/li>\n<li>Select Spam Filtering -&gt; Configuration, and enable &#8220;logging&#8221; purged after 1 day &#8211; this should probably be called &#8220;monitoring&#8221; &#8211; you&#8217;ll now get feedback on the Spam Filtering -&gt; Monitoring page.<\/li>\n<li>Take a look at the karma settings on Spam Filtering -&gt; Configuration.\n<p>Here&#8217;s what I found to be important:<\/p>\n<blockquote><p>No matter what I did, I could not seem to be able to get the recaptcha to display when adding tickets.<br \/>\nEventually I was able to test things out because for some reason, I discovered that the BlogSpam service was marking me as spam.<br \/>\nSo I set BlogSpam karma high enough to force my anonymous tickets to be marked as spam.<br \/>\nI set CaptchaSystem karma slightly higher than BlogSpam to get me past it on a bad score.<br \/>\nI used a clean machine with no cookies to try to create an anonymous ticket.\u00a0 No Recaptcha was displayed when entering the ticket.<br \/>\nAfter hitting Submit, the BlogSpam score marked it as spam, and THEN trac displayed the recaptcha.<br \/>\nI entered the recaptcha correctly, and the ticket was added.<\/p><\/blockquote>\n<p>So it appears that a ticket is created anonymously, then the spam score is generated, then if it&#8217;s spam, the recaptcha is displayed, then spam is recalced, then the ticket is added or rejected.\u00a0 Even if the recaptcha is done correctly, the ticket will be rejected if the karma doesn&#8217;t increase enough.<\/li>\n<li>With this information, you should now be able to tweak Spam Filtering -&gt; Configuration to get the job done.\u00a0 It may take some monitoring to see what kind of scores you are seeing.\u00a0 You also want to create some anonymous test tickets from some &#8220;good&#8221; IPs and make sure they get through.<\/li>\n<li>I would lean heavily on the Akismet score &#8211; if Akismet says it&#8217;s spam, I mark it as spam even if recaptcha succeeds.\u00a0 And why not make them fill out the recaptcha to find out?\u00a0 Ha, die spammer die.<\/li>\n<li>Don&#8217;t give too much karma to the SessionFilterStrategy.\u00a0 If you browse twice from the same site, you&#8217;re in a trac session, which means you&#8217;ll get a third of the karma from this one.\u00a0 Keep it low.<\/li>\n<li>I ended up setting the recaptcha score high enough to make up for 3 other filter failures, but not 4.<\/li>\n<li>Note that if you want to clear out the monitoring page, and you have tons of spam entries like I did, rework the url to show more tickets per page:\n<pre><code>(yourtracsite)\/admin\/spamfilter\/monitor?num=500<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>So far so good.\u00a0 It&#8217;s so nice to crush spam, isn&#8217;t it!?\u00a0 \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Trac is nice and simple and clean and &#8220;suits me well&#8221; for now. I was able to quickly add custom fields and use them on the front page of my tracker. And it supports the ability for anyone to anonymously add a new ticket, which is the Holy Grail of getting feedback. But getting feedback [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[19,10],"tags":[161,163,162,160,158,159],"class_list":["post-1440","post","type-post","status-publish","format-standard","hentry","category-opensource","category-tricks-tips-tools","tag-akismet","tag-blogspam","tag-recaptcha","tag-spam","tag-trac","tag-tracspam"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9M11L-ne","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/1440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/comments?post=1440"}],"version-history":[{"count":11,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/1440\/revisions"}],"predecessor-version":[{"id":1578,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/posts\/1440\/revisions\/1578"}],"wp:attachment":[{"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/media?parent=1440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/categories?post=1440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitpost.com\/news\/wp-json\/wp\/v2\/tags?post=1440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}