From 78e34fbdc255fd3f71f5b43ce1acd1fa0678e1ce Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 25 Aug 2008 19:52:34 -0400 Subject: filecheck: New plugin factoring out the PageSpec additions that were originally part of the attachment plugin. --- doc/ikiwiki/pagespec/attachment.mdwn | 2 +- doc/ikiwiki/pagespec/attachment/discussion.mdwn | 2 ++ doc/plugins/attachment.mdwn | 13 +++---------- doc/plugins/filecheck.mdwn | 16 ++++++++++++++++ 4 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 doc/plugins/filecheck.mdwn (limited to 'doc') diff --git a/doc/ikiwiki/pagespec/attachment.mdwn b/doc/ikiwiki/pagespec/attachment.mdwn index de7c7417f..6b86c510b 100644 --- a/doc/ikiwiki/pagespec/attachment.mdwn +++ b/doc/ikiwiki/pagespec/attachment.mdwn @@ -13,7 +13,7 @@ check all attachments for virii, something like this could be used: virusfree() and ((user(joey) and podcast/*.mp3 and mimetype(audio/mpeg) and maxsize(15mb)) or (!ispage() and maxsize(50kb))) -The regular [[ikiwiki/PageSpec]] syntax is expanded with thw following +The regular [[ikiwiki/PageSpec]] syntax is expanded with the following additional tests: * maxsize(size) diff --git a/doc/ikiwiki/pagespec/attachment/discussion.mdwn b/doc/ikiwiki/pagespec/attachment/discussion.mdwn index ab9cb0653..373242b3f 100644 --- a/doc/ikiwiki/pagespec/attachment/discussion.mdwn +++ b/doc/ikiwiki/pagespec/attachment/discussion.mdwn @@ -11,3 +11,5 @@ I am interested for [[todo/mbox]] --[[DavidBremner]] >> I don't think `ip()` and `user()` necessarily make sense for a mail box >> that is already on the disk, so no, I don't think I'll miss >> them. --[[DavidBremner]] + +>>> Done, [[plugins/filecheck]] --[[Joey]] diff --git a/doc/plugins/attachment.mdwn b/doc/plugins/attachment.mdwn index b04a04ad2..2aa8490ed 100644 --- a/doc/plugins/attachment.mdwn +++ b/doc/plugins/attachment.mdwn @@ -22,13 +22,6 @@ Bear in mind that if you let anyone upload a particular kind of file If you enable this plugin, be sure to lock it down, via the `allowed_attachments` setup file option. This is a special -[[enhanced_PageSpec|ikiwiki/pagespec/attachment]]. - -This plugin will use the [[!cpan File::MimeInfo::Magic]] perl module, if -available, for mimetype checking. - -The `virusfree` [[PageSpec|ikiwiki/pagespec/attachment]] requires that -ikiwiki be configured with a virus scanner program via the `virus_checker` -option in the setup file. If using `clamav`, with `clamd`, set it to -"clamdscan -". Or to use clamav without the `clamd` daemon, you -could set it to "clamscan -". +[[enhanced_PageSpec|ikiwiki/pagespec/attachment]] using tests provided by +the [[filecheck]] plugin. That plugin will be automatically enabled when +this plugin is enabled. diff --git a/doc/plugins/filecheck.mdwn b/doc/plugins/filecheck.mdwn new file mode 100644 index 000000000..f4563d58e --- /dev/null +++ b/doc/plugins/filecheck.mdwn @@ -0,0 +1,16 @@ +[[!template id=plugin name=filecheck core=0 author="[[Joey]]"]] +[[!tag type/useful]] + +This plugin enhances the regular [[ikiwiki/PageSpec]] syntax with +some additional tests, for things like file size, mime type, and virus +status. These tests are mostly useful for the [[attachment]] plugin, and +are documented [[here|ikiwiki/pagespec/attachment]]. + +This plugin will use the [[!cpan File::MimeInfo::Magic]] perl module, if +available, for mimetype checking. + +The `virusfree` [[PageSpec|ikiwiki/pagespec/attachment]] requires that +ikiwiki be configured with a virus scanner program via the `virus_checker` +option in the setup file. If using `clamav`, with `clamd`, set it to +"clamdscan -". Or to use clamav without the `clamd` daemon, you +could set it to "clamscan -". -- cgit v1.2.3