#!/usr/bin/perl
# Configuration file for ikiwiki.
-# Passing this to ikiwiki --setup will make ikiwiki generate tw
+# Passing this to ikiwiki --setup will make ikiwiki generate two
# wrapper programs, one for cgi and one for a subversion post-commit hook.
#
# Remember to re-run ikiwiki --setup any time you edit this file.
-%config=(%config,
-
+%setup=(
wikiname => "MyWiki",
# Be sure to customise these..
svn => 1,
svnrepo => "/svn/wiki",
- # Whether to enable a cgi wrapper.
- cgiwrapper => 0,
- # Can anonymous web users edit pages?
- #anonok => 1,
-
-);
-
-gen_wrapper(%config,
+ # The svn wrapper.
+ svnwrapper => {
+ # Note that this will overwrite any exsting post-commit hoo
+ # script, which may not be what you want.
+ wrapper => "$config{svnrepo}/hooks/post-commit",
+ wrappermode => 04755,
+ },
- cgi => 1,
- wrapper => "$config{destdir}/ikiwiki.cgi",
- wrappermode => 06755,
-
-) if $config{cgiwrapper};
-
-gen_wrapper(%config,
-
- # Note that this will overwrite any exsting post-commit hoo
- # script, which may not be what you want.
- wrapper => "$config{svnrepo}/hooks/post-commit",
- wrappermode => 04755,
+ # The cgi wrapper.
+ #cgiwrapper => {
+ # cgi => 1,
+ # wrapper => "/var/www/wiki/ikiwiki.cgi",
+ # wrappermode => 06755,
+ #},
-) if $config{svn};
+ # Can anonymous web users edit pages?
+ #anonok => 1,
+);
directories, and read through and configure the rest of the file to your
liking.
- Note that the default file will enable a [[post-commit]] hook to
- update the wiki, but has cgi support turned off.
+ Note that the default file has a block to configure a svnwraper. This
+ sets up a [[post-commit]] hook to update the wiki.
- When you're satisfied, run `ikiwiki --setup ikiwiki.setup`, and it will
- generate the subversion [[post-commit]] hook and update your wiki.
+ When you're satisfied, run `ikiwiki --setup ikiwiki.setup`, and it
+ will set everything up and update your wiki.
8. Set up [[CGI]] to allow editing the wiki from the web.
- Just edit ikiwiki.setup, change cgiwrapper to 1, and optioanlly anonok
- to 1, run `ikiwiki --setup ikiwiki.setup`, and you're done!
+ Just edit ikiwiki.setup, uncomment the block for the cgiwrapper, make
+ sure the filename for the cgi wrapper is ok, run
+ `ikiwiki --setup ikiwiki.setup`, and you're done!
9. Add [[PageHistory]] links to the top of pages. This requires you to have
setup [[ViewCVS]] or something similar to access your [[Subversion]]
my $code=<IN>;
($code)=$code=~/(.*)/s;
close IN;
+
+ my (%setup);
eval $code;
error($@) if $@;
- print "$config{wikiname} setup complete, now forcing a rebuild.\n";
- $config{cgi}=0;
- $config{rebuild}=1;
- foreach my $c (keys %config) {
- $config{$c}=possibly_foolish_untaint($config{$c})
- if defined $config{$c};
+
+ gen_wrapper(%config, %setup, %{$setup{cgiwrapper}}) if $setup{cgiwrapper};
+ gen_wrapper(%config, %setup, %{$setup{svnwrapper}}) if $setup{svnwrapper};
+
+ print "$setup{wikiname} setup complete, now forcing a rebuild\n";
+ foreach my $c (keys %setup) {
+ $config{$c}=possibly_foolish_untaint($setup{$c})
+ if defined $setup{$c} && ! ref $setup{$c};
}
+ $config{rebuild}=1;
refresh();
saveindex();
exit;