ikiwiki/ todo/ fileupload

(I've written a proposal for this feature --Ben).

Support for uploading files is useful for many circumstances:

ikiwiki should have an easy to use interface for this, but the real meat of the work is in securing it. Several classes of controls seem appropriate:

It seems that for max flexability, rules should be configurable by the admin to combine these limits in different ways. If we again extend the pagespec for this, as was done for conditional text based on ikiwiki features, the rules might look something like this:

( maxsize(30kb) and type(webimage) ) or
( user(joey) and maxsize(1mb) and (type(webimage) or *.mp3) ) or
( user(joey) and maxsize(200mb) and (*.mov or *.avi) and videos/*)

With a small extension, this could even be used to limit the max sizes of normal wiki pages, which could be useful if someone was abusing an open wiki as a wikifs. Maybe.

( type(page) and maxsize(32k) )

And if that's done, it can also be used to lock users from editing a pages or the whole wiki:

!(( user(spammer) and * ) or
 ( user(42.12.*) and * ) or
 ( user(http://evilopenidserver/*) and * ) or
 ( user(annoying) and index) or
 ( immutable_page ))

That would obsolete the current simple admin prefs for banned users and locked pages. Suddenly all the access controls live in one place. Wonderbar!

(Note that pagespec_match will now return an object that stringifies to a message indicating why the pagespec matched, or failed to match, so if a pagespec lock like the above prevents an edit or upload from happening, ikiwiki could display a reasonable message to the user, indicating what they've done wrong.)