]> sipb.mit.edu Git - ikiwiki.git/blobdiff - ikiwiki.in
httpauth removed long ago
[ikiwiki.git] / ikiwiki.in
index f48f2cfebcc32c8d6647d1d208ae7b3ad3f24dc0..5dc6ca952e17b0702cd42e2f1ac57509e5248710 100755 (executable)
@@ -20,6 +20,7 @@ sub getconfig () { #{{{
                Getopt::Long::Configure('pass_through');
                GetOptions(
                        "setup|s=s" => \$config{setup},
+                       "dumpsetup|s=s" => \$config{dumpsetup},
                        "wikiname=s" => \$config{wikiname},
                        "verbose|v!" => \$config{verbose},
                        "syslog!" => \$config{syslog},
@@ -45,7 +46,6 @@ sub getconfig () { #{{{
                        "adminemail=s" => \$config{adminemail},
                        "timeformat=s" => \$config{timeformat},
                        "sslcookie!" => \$config{sslcookie},
-                       "httpauth!" => \$config{httpauth},
                        "userdir=s" => \$config{userdir},
                        "htmlext=s" => \$config{htmlext},
                        "libdir=s" => \$config{libdir},
@@ -111,7 +111,45 @@ sub main () { #{{{
        
        if ($config{setup}) {
                require IkiWiki::Setup;
-               setup();
+               IkiWiki::Setup::load($config{setup});
+               if (! $config{render} && ! $config{dumpsetup} &&
+                   (! $config{refresh} || $config{wrappers})) {
+                       debug(gettext("generating wrappers.."));
+                       require IkiWiki::Wrapper;
+                       my %origconfig=(%config);
+                       my @wrappers=@{$config{wrappers}};
+                       delete $config{wrappers};
+                       foreach my $wrapper (@wrappers) {
+                               %config=(%origconfig,
+                                       rebuild => 0,
+                                       verbose => 0,
+                                       %{$wrapper},
+                               );
+                               checkconfig();
+                               if (! $config{cgi} && ! $config{post_commit}) {
+                                       $config{post_commit}=1;
+                               }
+                               gen_wrapper();
+                       }
+                       %config=(%origconfig);
+               }
+               
+               # setup implies a wiki rebuild by default
+               if (! $config{refresh}) {
+                       $config{rebuild}=1;
+               }
+               
+               # ignore syslog setting from setup file
+               # while doing initial setup
+               $config{syslog}=0;      
+               
+               loadplugins();
+               checkconfig();
+       }
+
+       if ($config{dumpsetup}) {
+               require IkiWiki::Setup::Standard;
+               IkiWiki::Setup::Standard::dump($config{dumpsetup});
        }
        elsif ($config{wrapper}) {
                lockwiki();
@@ -133,12 +171,19 @@ sub main () { #{{{
                # do nothing
        }
        else {
+               if (! $config{refresh}) {
+                       debug(gettext("rebuilding wiki.."));
+               }
+               else {
+                       debug(gettext("refreshing wiki.."));
+               }
                lockwiki();
                loadindex();
                require IkiWiki::Render;
                rcs_update();
                refresh();
                saveindex();
+               debug(gettext("done"));
        }
 } #}}}