]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/Zoned_ikiwiki.mdwn
thanks for response; follow-up; I've got something working…
[ikiwiki.git] / doc / todo / Zoned_ikiwiki.mdwn
1 The idea behind this would be to have one ikiwiki behave as a dynamic private wiki in a specified area
2 and a more static publiczone wiki. Actually private wiki page can be addressed via a *pagespec*. 
3
4 What is ready /can be done:
5
6 * We already can more or less do this for example with [[httpauth|/plugins/httpauth/]], *.htaccess* files and a proper *httpauth_pagespec*
7 yet at the cost of maintaining two different user/pass logbase (native ikiwiki signin)
8 * Furthermore we can [[lockedit|plugins/lockedit/]] some pagespecs, ie in the public zone.
9
10 What is problematic is when you link a public page in a private page : 
11 a backlink will be generated from the public page to the private page.
12
13 As I noticed in [[per_page_ACLs]] in the end users through backlink 
14 navigation will frequently hit HTTP/401 deterring browsing as well as for the admin at false-positive logwatching.
15
16 One can radically [[disable backlinks feature|todo/allow_disabling_backlinks]] but then no more neat backlink navigation that
17 is really good to have in both area.
18
19 I think of just preventing this backlink leak in that case would be sufficient via i.e a *privatebacklinks* config and
20 a below patch.
21
22 Comments are welcome.
23
24 [[mathdesc]]
25
26
27 <pre>
28 diff --git a/IkiWiki.pm b/IkiWiki.pm
29 --- a/IkiWiki.pm
30 +++ b/IkiWiki.pm
31 @@ -294,6 +294,14 @@ sub getsetup () {
32                 safe => 1,
33                 rebuild => 1,
34         },
35 +       privatebacklinks => {
36 +               type => "pagespec",
37 +               example => "",
38 +               description => "PageSpec controlling which backlinks are private (ie users/*)",
39 +               link => "ikiwiki/PageSpec",
40 +               safe => 1,
41 +               rebuild => 1,
42 +       },
43         hardlink => {
44                 type => "boolean",
45                 default => 0,
46 diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
47 --- a/IkiWiki/Render.pm
48 +++ b/IkiWiki/Render.pm
49 @@ -52,7 +52,8 @@ sub backlinks ($) {
50                         $p_trimmed=~s/^\Q$dir\E// &&
51                         $page_trimmed=~s/^\Q$dir\E//;
52                                
53 -               push @links, { url => $href, page => pagetitle($p_trimmed) };
54 +               push @links, { url => $href, page => pagetitle($p_trimmed) }
55 +               unless defined $config{privatebacklinks} && length $config{privatebacklinks} && pagespec_match($p, $config{privatebacklinks}) && !pagespec_match($page, $config{privatebacklinks}) ;
56         }
57         return @links;
58  }
59
60 </pre>
61
62 > Have you considered all the ways that anyone with edit access to the
63 > public wiki could expose information from the public wiki? For example,
64 > you could inline all the private pages into a public page. --[[Joey]]