]> sipb.mit.edu Git - ikiwiki.git/blob - doc/todo/online_configuration.mdwn
Merge branch 'master' into tova
[ikiwiki.git] / doc / todo / online_configuration.mdwn
1 It should be possible to configure ikiwiki online, in the wiki admin's
2 preferences form. Rather than the current situation where most settings are
3 in ikiwiki.setup, and one or two (like locked pages and upload limits) in
4 the admin preferences.
5
6 In theory, every setting could be configured there. In practice, some
7 settings, like `srcdir` and `destdir` are ones you want to keep far away
8 from editing via the web.
9
10 Currently admin prefs are per-admin, and are stored in the userdb.
11 That seems like a bad choice in the context of this idea. Instead, admin
12 setup should be configured on a separate page than the regular user prefs
13 page, and should be shared amoung all admins, and the ideal storage would be
14 another ikiwiki setup file, which could be loaded in, and written back out.
15
16 If `ikiwiki-makerepo` were extended a little bit to generate the stub setup
17 file that's enough to get `ikiwiki.cgi` working, and that sets values for
18 all the dangerous options, leaving only safe ones 'undef', then users could
19 set up ikiwiki using it, and configure the rest with the web interface,
20 without ever needing to edit a setup file.
21
22 The setup page could `require` every available plugin, and then call a
23 `getsetup` function, which would look something like:
24
25         sub getsetup () {
26                 eval q{use Some::Thing};
27                 die $@ if $@;
28
29                 return option_foo => {
30                         safe => 1,
31                         rebuild => 1,
32                         type => "boolean",
33                         default => 0,
34                         description => gettext("Enable foo."),
35                 },
36                 option_bar => {
37                         safe => 0,
38                         rebuild => 0,
39                         type => "password",
40                         default => "",
41                         description => gettext("Password for bar."),
42                 };
43         }
44
45 The types would be: boolean, string, password, filename, other.
46 This would be the type of the leaf fields; if a value in `%config` is an
47 array or hash, the type specifies the type of values that go into it.
48
49 From this info, a form can be built, that has core setup values at the
50 top, followed by each plugin whose `getsetup` succeeded, with a check box
51 to enable/disable that plugin, and all of its setup options listed after
52 it.
53
54 The main setup file could control what options are read from the
55 online setup file:
56
57         online_setup_include => 'safe', # all things with safe = 1
58         online_setup_exclude => [qw{option_baz}],
59
60 Note that posting the setup form would sometimes need to cause a rebuild
61 of the whole wiki. This could be done with output streamed to the admin in
62 the web browser. The `rebuild` fields would be set to 1 for values that
63 require a wiki rebuild when changed, and to 0 for values that only need the
64 wrappers to be refreshed.
65
66 [[!tag wishlist]]