Modify

Opened 6 years ago

Closed 3 years ago

Last modified 22 months ago

#3051 closed enhancement (worksforme)

Recaptcha support for comments

Reported by: arteme Owned by: osimons
Priority: normal Component: AddCommentMacro
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

From personal experience, comments added by AddCommentMacro are not filtered by any Trac spam filter plugins. Attached is a patch for 0.10-version of the macro to integrate the recaptcha.net support.

To use, one must explicitly turn on recaptcha feature in the ini-file:

[addcomment]
recaptcha = on
recaptcha_private_key = ...
recaptcha_public_key = ...

When enabled, a recaptcha widget will appear below the comment input field and buttons. The default behavior is to require only anonymous users to solve the captcha. If logged in users are required to solve one as well, add

recaptcha_logged_in = on

to the aforementioned block in the ini-file.

In case if the captcha is solved correctly, pressing "Add comment" button will add the comment. If the captcha is solved incorrectly, "Add comment" will instead switch to "Preview" functionality, displaying a message that the captcha needs to be solved before the comment can be posted.

Attachments (2)

addcomment-0.10-r3699-repatcha.patch (9.1 KB) - added by arteme 6 years ago.
recaptcha support for Trac-0.10 version of AddCommentMacro
repatcha-screenshot.png (97.7 KB) - added by arteme 6 years ago.
Screenshot of the recaptcha-enabled AddCommentMacro in action.

Download all attachments as: .zip

Change History (12)

Changed 6 years ago by arteme

recaptcha support for Trac-0.10 version of AddCommentMacro

Changed 6 years ago by arteme

Screenshot of the recaptcha-enabled AddCommentMacro in action.

comment:1 Changed 6 years ago by thomas.moschny@…

See also #3076.

comment:2 Changed 6 years ago by cboos

  • Owner cboos deleted

(I'm not in charge of this plugin)

comment:3 Changed 6 years ago by anonymous

How do you install this onto your own trac?

comment:4 Changed 6 years ago by anonymous

  • Owner set to athomas

comment:5 follow-up: Changed 6 years ago by athomas

  • Owner changed from athomas to osimons

I think osimons is maintaining this plugin now.

comment:6 in reply to: ↑ 5 ; follow-up: Changed 6 years ago by osimons

Replying to athomas:

I think osimons is maintaining this plugin now.

Yeah, I suppose I am.

Personally I don't feel the need for an addcomment-only captcha implementation against one particular service.

However: I recently added change listener support for 0.11 version ([3723]), meaning trac:wiki:SpamFilter and similar plugins will work for comments. Would not that be a sufficient solution to the original issue raised? I propose worksforme, advicing update to 0.11 and using spamfilter plugin...

comment:7 in reply to: ↑ 6 Changed 6 years ago by arteme

Replying to osimons:

Personally I don't feel the need for an addcomment-only captcha implementation against one particular service.

However: I recently added change listener support for 0.11 version ([3723]), meaning trac:wiki:SpamFilter and similar plugins will work for comments. Would not that be a sufficient solution to the original issue raised? I propose worksforme, advicing update to 0.11 and using spamfilter plugin...

The current patch was born out of the lack of AddComment-SpamFilter integration. I think it may be useful for people still using 0.10 for one reason or another, but I see no point in maintaining it as such for 0.11 and onwards...

comment:8 follow-up: Changed 6 years ago by thomas.moschny@…

Porting my patch from [3723] to 0.10 shouldn't be that hard...

comment:9 in reply to: ↑ 8 Changed 6 years ago by osimons

Replying to thomas.moschny@...:

Porting my patch from [3723] to 0.10 shouldn't be that hard...

No it shouldn't really. Question is, do we want to? I haven't been running the 0.10 version for a long time, and pending reports of any major bugs or security implications I likely never will again... I personally consider the feature-set of 0.10 as frozen at this stage with Trac 0.11 released (and 0.10-stable frozen), but will of course happily commit useful backports if someone volunteers to maintain the old version.

Any takers?

comment:10 Changed 3 years ago by osimons

  • Resolution set to worksforme
  • Status changed from new to closed

Well, no chance of fixing this for 0.10 at this stage.... If you have 0.10.x then upgrade!

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from osimons. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.