]> sipb.mit.edu Git - ikiwiki.git/commitdiff
improved setup file more
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Mon, 13 Mar 2006 19:53:13 +0000 (19:53 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Mon, 13 Mar 2006 19:53:13 +0000 (19:53 +0000)
doc/ikiwiki.setup
doc/setup.mdwn
ikiwiki

index 9592d36f52ecd068e60d0cf2640a7f2fe77e0e06..e8048c3b0a3a1fcc49e8bd275a66e32e500340be 100644 (file)
@@ -1,12 +1,11 @@
 #!/usr/bin/perl
 # Configuration file for ikiwiki.
 #!/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.
 
 # 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..
        wikiname => "MyWiki",
 
        # Be sure to customise these..
        svn => 1,
        svnrepo => "/svn/wiki",
 
        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,
+);
index cc830c0b965f06063fa6d3b1702e2dcf326bb7e3..d72cac71a5c37a68c4c81acf8ffe8e404b1ea725 100644 (file)
@@ -54,16 +54,17 @@ optional support for commits from the web.
    directories, and read through and configure the rest of the file to your
    liking.
 
    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.
 
 
 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]]
 
 9. Add [[PageHistory]] links to the top of pages. This requires you to have
    setup [[ViewCVS]] or something similar to access your [[Subversion]]
diff --git a/ikiwiki b/ikiwiki
index ea3833a37d5e98f062db2d5cdc410962a29a9330..add62773966dbe048ecb6ce78b164bb732ff43a8 100755 (executable)
--- a/ikiwiki
+++ b/ikiwiki
@@ -1158,15 +1158,20 @@ sub setup () { # {{{
        my $code=<IN>;
        ($code)=$code=~/(.*)/s;
        close IN;
        my $code=<IN>;
        ($code)=$code=~/(.*)/s;
        close IN;
+
+       my (%setup);
        eval $code;
        error($@) if $@;
        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;
        refresh();
        saveindex();
        exit;