diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ikiwiki.setup | 4 | ||||
-rw-r--r-- | doc/ikiwiki/pagespec/attachment.mdwn | 10 | ||||
-rw-r--r-- | doc/plugins/attachment.mdwn | 6 | ||||
-rw-r--r-- | doc/todo/attachments.mdwn | 6 |
4 files changed, 17 insertions, 9 deletions
diff --git a/doc/ikiwiki.setup b/doc/ikiwiki.setup index 03d04176d..6d327fd98 100644 --- a/doc/ikiwiki.setup +++ b/doc/ikiwiki.setup @@ -195,4 +195,8 @@ use IkiWiki::Setup::Standard { #amazon_s3_location => "EU", # Uncomment if you need to store each index file twice. #amazon_s3_dupindex => 1, + + # For use with the attachment plugin, a program that returns + # nonzero if its standard input contains an virus. + #virus_checker => "clamdscan -", } diff --git a/doc/ikiwiki/pagespec/attachment.mdwn b/doc/ikiwiki/pagespec/attachment.mdwn index 40de91765..c6166d013 100644 --- a/doc/ikiwiki/pagespec/attachment.mdwn +++ b/doc/ikiwiki/pagespec/attachment.mdwn @@ -8,10 +8,10 @@ attachments will be accepted, by entering a [[ikiwiki/PageSpec]] in the "Allowed Attachments" field of their preferences page. For example, to limit arbitrary files to 50 kilobytes, but allow -larger mp3 files to be uploaded by joey, a something like this could be -used: +larger mp3 files to be uploaded by joey, and check all attachments for +virii, something like this could be used: - (user(joey) and *.mp3 and mimetype(audio/mpeg) and maxsize(15mb)) or (!ispage() and maxsize(50kb)) + virusfree() and ((user(joey) and *.mp3 and mimetype(audio/mpeg) and maxsize(15mb)) or (!ispage() and maxsize(50kb))) The regular [[ikiwiki/PageSpec]] syntax is expanded with thw following additional tests: @@ -50,3 +50,7 @@ additional tests: This checks the MIME type of the attachment. You can include a glob in the type, for example `mimetype(image/*)`. + +* virusfree() + + Checks the attachment with an antiviral program. diff --git a/doc/plugins/attachment.mdwn b/doc/plugins/attachment.mdwn index 2b8343042..dedc4162e 100644 --- a/doc/plugins/attachment.mdwn +++ b/doc/plugins/attachment.mdwn @@ -26,3 +26,9 @@ Attachments" field of the wiki admin's preferences page. 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 -". diff --git a/doc/todo/attachments.mdwn b/doc/todo/attachments.mdwn index 8c5c28615..d1d275291 100644 --- a/doc/todo/attachments.mdwn +++ b/doc/todo/attachments.mdwn @@ -1,15 +1,9 @@ Stuff the [[plugins/attachment]] plugin is currently missing, that might be nice to add: -* Virus scanning. * Add a progress bar for attachment uploads (needs AJAX stuff..) * Maybe optimise the "Insert Links" button with javascript, so, if javascript is available, the link is inserted at the current cursor position in the page edit form, without actually reposting the form. (Falling back to the current reposting of the form if javascript is not available of course.) -* Set `$CGI::POST_MAX` to some sane value (ie, larger than the largest - configured `maxsize()` in the pagespec, or if none is configured, - something reasonable. Just as a belt-and-suspenders DOS prevention. -* Only allow attachments to be added to a given list of pages. - Maybe a pagespec like `parent(patches/*)` |