#4029 closed enhancement (fixed)
Patches to enhance TracPastePlugin
Reported by: | Michael Renzmann | Owned by: | Michael Renzmann |
---|---|---|---|
Priority: | normal | Component: | TracPastePlugin |
Severity: | normal | Keywords: | |
Cc: | dclark@…, Ryan J Ollos | Trac Release: | 0.11 |
Description (last modified by )
Attached is a series of patches that improve TracPastePlugin and/or implement new features.
- 01_recent_pastes_configurable.patch
-
Default number of recent pastes that get displayed on the "main" pastebin page can be configured in trac.ini, section
[pastebin]
, optiondefault_recent
(default: 10).
- 02_recent_pastes_rss_feed.patch
-
Allow to fetch list of recent pastes as RSS feed. This allows for example to let a Supybot announce new pastes in IRC channels. Similar to the timeline RSS feed, the number of items that get displayed in the feed can be adjusted using the
max
query parameter. The maximum amount of items that may be requested this way can be limited in trac.ini, section[pastebin]
, optionmax_recent
(default: 30).
- 03_other_formats_configurable.patch
-
The Download in other formats functionality can be disabled in trac.ini, section
[pastebin]
, optionenable_other_formats
(default: enabled). For example, this might help a little to prevent search engine spiders from getting HTML-ized spam pastes and using them to boost page rank of spamvertized sites.
- 04_other_formats_filter.patch
-
Allows finer-grained control over which pastes may be downloaded in other formats. Download is disabled if the MIME-type of a paste matches one of the filters defined in trac.ini, section
[pastebin]
, optionfilter_other_formats
. * may be used as wildcard.
- 05_use_same_formatter_in_reply.patch
- When replying to a paste, the formatter that was used in the paste that is replied to will be pre-selected for the reply.
- 06_show_metadata.patch
- Show additional information (Content-Type and formatter/highlighter) when viewing a paste.
- 07_rename_permission.patch
- Rename permission PASTEBIN_USE to PASTEBIN_VIEW. Introduce new permission PASTEBIN_ADMIN.
- 08_finegrained_permission.patch
- Implement fine-grained permissions for creating new pastes (PASTEBIN_CREATE) and replying to existing ones (PASTEBIN_REPLY). PASTEBIN_CREATE and PASTEBIN_REPLY both include the PASTEBIN_VIEW permission.
- 09_delete_pastes.patch
- Introduce new permission PASTEBIN_DELETE; users with this permission are allowed to delete pastes.
- 10_turing_test.patch
-
Implements a simple turing test that might help against spambots. A new field is added to the form that's used for creating pastes. Pastes will not be accepted if anything is filled into this field; the idea behind it is that many spambots will fill each field of a form, and thus can be identified this way. The field is hidden with CSS, and for cases where CSS is not supported a clear warning is displayed along with the field. This feature can be disabled in trac.ini, section
[pastebin]
, optionturing_test
. It's enabled by default.
I have some more patches in my queue which I will add to this ticket over time. Comments and suggestions welcome.
Attachments (11)
Change History (24)
Changed 16 years ago by
Attachment: | 01_recent_pastes_configurable.patch added |
---|
Changed 16 years ago by
Attachment: | 02_recent_pastes_rss_feed.patch added |
---|
Changed 16 years ago by
Attachment: | 03_other_formats_configurable.patch added |
---|
Changed 16 years ago by
Attachment: | 04_other_formats_filter.patch added |
---|
Changed 16 years ago by
Attachment: | 05_use_same_formatter_in_reply.patch added |
---|
Changed 16 years ago by
Attachment: | 06_show_metadata.patch added |
---|
Changed 16 years ago by
Attachment: | 07_rename_permission.patch added |
---|
Changed 16 years ago by
Attachment: | 08_finegrained_permissions.patch added |
---|
Changed 16 years ago by
Attachment: | 09_delete_pastes.patch added |
---|
Changed 16 years ago by
Attachment: | 10_turing_test.patch added |
---|
comment:1 follow-up: 3 Changed 16 years ago by
comment:2 Changed 16 years ago by
Oops. Missed one comment: The 02-RSS feature should really be a timeline provider - providing items to the general timeline of the project. I really don't see the point of a separate paste-only feed.
comment:3 Changed 16 years ago by
Replying to osimons:
I've quickly skimmed through the patches:
Thanks for your feedback.
- 07-09 mostly deals with permissions, but I think I'd want the core of these patches implemented using the resource system instead.
Although I have hacked some Trac plugins, I'm unexperienced when it comes to the more advanced features that Trac offers. Can you please advise where I can find more details about the changes you're suggesting here? Pointing to another plugin that implements the things the way you've described above would be enough for a start, I think.
- 10 ... That means implementing something like an
IPasteManipulator
interface to allow other plugins to hook into the paste creation
Agreed. Patch 10 is meant as a quick and dirty solution that just works, until I figure out how to implement a more general interface to the spamfilter plugin.
An
IPasteListener
would also be nice while you are at it... :-)
That would allow other plugins to react on newly posted pastes, right?
Replying to osimons:
The 02-RSS feature should really be a timeline provider - providing items to the general timeline of the project.
Ack, that's actually on my to do list already. Patch 2 was my original motivation to start working on this plugin; I've implemented it to allow pastes to be announced in a IRC support channel by a Supybot that I run.
comment:4 Changed 16 years ago by
My FullBlogPlugin I suppose already have all these features - posts as resources, fine-grained permissions, timeline feed for all details, search provider, optional spamfilter module, and both manipulator and listener interfaces to make these integrations possible ++. See its source (including the sample plugins). There should be enough hints in there to get you started :-)
comment:5 Changed 16 years ago by
Owner: | changed from mitsuhiko to Michael Renzmann |
---|
comment:6 Changed 16 years ago by
Status: | new → assigned |
---|
comment:7 Changed 16 years ago by
comment:8 Changed 15 years ago by
Cc: | dclark@… added; anonymous removed |
---|
Going to give #10 a try to see if it helps with paste spam I've been getting recently. Adding name to cc: list as I'm interested in any updates to this ticket.
Changed 15 years ago by
Attachment: | 10_turing_test_for_r6222.patch.gz added |
---|
Turning test patch updated for current svn version (gzipped to get past spam filter)
comment:9 Changed 15 years ago by
Updated 10_turing_test.patch to work against current svn - 10_turing_test_for_r6222.patch.gz - note that the css to hide the turning test works under icecat (firefox) 3.0.11, but not under 3.5.
comment:10 Changed 15 years ago by
Cc: | Ryan J Ollos added |
---|
comment:11 Changed 15 years ago by
Replying to otaku42:
07_rename_permission.patch ...
08_finegrained_permission.patch ...
09_delete_pastes.patch ...
10_turing_test.patch ...
That's the only patch of the series that's left open. I'm tending to replace it with an implementation of such a feature following osimmon's suggestion above (plugging it into the spamfilter framework). But I won't have the time for that anytime soon, it seems :(
comment:12 follow-up: 13 Changed 15 years ago by
Description: | modified (diff) |
---|
since only patch 10 is left to be implemented, perhaps we can close this ticket and move spam filtering implementation to a new ticket?
comment:13 Changed 15 years ago by
Description: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
I've quickly skimmed through the patches:
IPasteManipulator
interface to allow other plugins to hook into the paste creation and potentially veto the changes. AnIPasteListener
would also be nice while you are at it... :-)