(no commit message)
[ikiwiki.git] / doc / todo / enable-htaccess-files.mdwn
1     Index: IkiWiki.pm
2     ===================================================================
3     --- IkiWiki.pm  (revision 2981)
4     +++ IkiWiki.pm  (working copy)
5     @@ -26,7 +26,7 @@
6      memoize("file_pruned");
7      
8      sub defaultconfig () {
9     -       wiki_file_prune_regexps => [qr/\.\./, qr/^\./, qr/\/\./,
10     +       wiki_file_prune_regexps => [qr/\.\./, qr/^\.(?!htaccess)/, qr/\/\.(?!htaccess)/,
11                     qr/\.x?html?$/, qr/\.ikiwiki-new$/,
12                     qr/(^|\/).svn\//, qr/.arch-ids\//, qr/{arch}\//],
13            wiki_link_regexp => qr/\[\[(?:([^\]\|]+)\|)?([^\s\]#]+)(?:#([^\s\]]+))?\]\]/,
14
15 > Note that the above patch is **completely broken**. 
16 > It removes the crucial excludes of all files starting with a dot.
17 > The negative regexps for htaccess have no effect, so the whole
18 > thing only "works" because it allows *any* file starting with a dot.
19 > If you applied this patch to your ikiwiki, you opened a huge security
20 > hole. --[[Joey]] 
21
22 [[!tag patch patch/core]]
23
24 This lets the site administrator have a `.htaccess` file in their underlay
25 directory, say, then get it copied over when the wiki is built. Without
26 this, installations that are located at the root of a domain don't get the
27 benefit of `.htaccess` such as improved directory listings, IP blocking,
28 URL rewriting, authorisation, etc. 
29
30 > I'm concerned about security ramifications of this patch. While ikiwiki
31 > won't allow editing such a .htaccess file in the web interface, it would
32 > be possible for a user who has svn commit access to the wiki to use it to
33 > add a .htaccess file that does $EVIL.
34
35 > Perhaps this should be something that is configurable via the setup file
36 > instead. --[[Joey]]
37
38 > See 
39
40 ---
41
42 Hi, I would like to have my htaccess files in svn repository so ikiwiki would export that file to my webspace with every commit.
43
44 That way I have revision control on that file too. That may be a security concern, but I trust everybody that has svn commit
45 access and such .htaccess files should not be accessible through wiki cgi. Of course, it could default to 'off'.
46
47 > See [[!debbug 447267]] for a patch for this.
48
49 >> It looks to me as though this functionality won't be included in ikiwiki
50 >> unless someone who wants it takes responsibility for updating the patch
51 >> from that Debian bug to be applicable to current versions, so that there's a
52 >> setup file parameter for extra filenames to allow, defaulting to none
53 >> (i.e. a less simplistic patch than the one at the top of this page).
54 >> Joey, is this an accurate summary? --[[smcv]]
55
56 ---
57
58 bump! I would like to see some form of this functionality included in ikiwiki. I use a patched version, but
59 its a bit of a PITA to constantly apply it (and to forget sometimes!). I know that security concern is important to consider,
60 but I use ikiwiki with a very small group of people collaborating so svn/web access is under control
61 and htaccess is for limiting access to some areas of wiki.   
62 It should be off by default of course. --Max
63
64 ---
65 +1 I want `.htaccess` so I can rewrite some old Wordpress URLs to make feeds work again. --[[hendry]]
66
67 > Unless you cannot modify apache's configuration, you do not need htaccess
68 > to do that. Apache's documentation recommends against using htaccess
69 > unless you're a user who cannot modify the main server configuration.
70 > --[[Joey]] 
71
72 ---
73 +1 for various purposes (but sometimes the filename isn't `.htaccess`, so please make it configurable) --[[schmonz]]
74
75 > I've described a workaround for one use case at the [[plugins/rsync]] [[plugins/rsync/discussion]] page. --[[schmonz]]
76
77 ---
78
79 [[done]], you can use the `include` setting to override the default
80 excludes now. Please use extreme caution when doing so. --[[Joey]]