]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/fileupload.mdwn
web commit by JoshTriplett: Re-add link to article in LinuxWorld.com.
[ikiwiki.git] / doc / todo / fileupload.mdwn
1 Support for uploading files is useful for many circumstances:
2
3 * Uploading images.
4 * Uploading local.css files (admin only).
5 * Uploading mp3s for podcasts.
6 * Etc.
7
8 ikiwiki should have an easy to use interface for this, but the real meat of
9 the work is in securing it. Several classes of controls seem appropriate:
10
11 * Limits to size of files that can be uploaded. Prevent someone spamming
12   the wiki with CD isos..
13 * Limits to the type of files that can be uploaded. To prevent uploads of
14   virii, css, raw html etc, and avoid file types that are not safe.
15   Should default to excluding all files types, or at least all
16   except a very limited set, and should be able to open it up to more
17   types.
18
19   Would checking for file extensions (.gif, .jpg) etc be enough? Some
20   browsers are probably too smart for their own good and may ignore the
21   extension / mime info and process as the actual detected file type. It
22   may be necessary to use `file` to determine a file's true type.
23 * Optional ability to test a file using a virus scanner like clamav.
24 * Limits to who can upload what type of files.
25 * Limits to what files can be uploaded where.
26
27 It seems that for max flexability, rules should be configurable by the admin
28 to combine these limits in different ways. If we again extend the pagespec
29 for this, as was done for [[conditional_text_based_on_ikiwiki_features]],
30 the rules might look something like this:
31
32         ( maxsize(30kb) and type(webimage) ) or
33         ( user(joey) and maxsize(1mb) and (type(webimage) or *.mp3) ) or
34         ( user(joey) and maxsize(200mb) and (*.mov or *.avi) and videos/*)
35
36 With a small extension, this could even be used to limit the max sizes of
37 normal wiki pages, which could be useful if someone was abusing an open wiki
38 as a wikifs. Maybe.
39
40         ( type(page) and maxsize(32k) )
41
42 And if that's done, it can also be used to lock users from editing a pages
43 or the whole wiki:
44
45         !(( user(spammer) and * ) or
46          ( user(42.12.*) and * ) or
47          ( user(http://evilopenidserver/*) and * ) or
48          ( user(annoying) and index) or
49          ( immutable_page ))
50
51 That would obsolete the current simple admin prefs for banned users and
52 locked pages. Suddenly all the access controls live in one place.
53 Wonderbar!
54
55 [[tag soc]]