]> sipb.mit.edu Git - ikiwiki.git/commitdiff
Merge branch 'master' into autoconfig
authorJoey Hess <joey@kodama.kitenet.net>
Fri, 25 Jul 2008 23:41:20 +0000 (19:41 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Fri, 25 Jul 2008 23:41:20 +0000 (19:41 -0400)
13 files changed:
IkiWiki/Plugin/aggregate.pm
IkiWiki/Plugin/amazon_s3.pm
IkiWiki/Plugin/anonok.pm
IkiWiki/Plugin/attachment.pm
IkiWiki/Plugin/calendar.pm
IkiWiki/Plugin/inline.pm
IkiWiki/Plugin/mdwn.pm
IkiWiki/Plugin/mirrorlist.pm
IkiWiki/Plugin/openid.pm
IkiWiki/Plugin/passwordauth.pm
IkiWiki/Plugin/pinger.pm
IkiWiki/Plugin/prettydate.pm
ikiwiki.in

index e000bc8648a39f33cea5aef932286255f343f4a2..be62d8a1aeb31add542cfb39dcf90556aeb5ee73 100644 (file)
@@ -16,6 +16,7 @@ my %guids;
 
 sub import { #{{{
        hook(type => "getopt", id => "aggregate", call => \&getopt);
+       hook(type => "getsetup", id => "aggregate", call => \&getsetup);
        hook(type => "checkconfig", id => "aggregate", call => \&checkconfig);
        hook(type => "needsbuild", id => "aggregate", call => \&needsbuild);
        hook(type => "preprocess", id => "aggregate", call => \&preprocess);
@@ -37,6 +38,24 @@ sub getopt () { #{{{
        );
 } #}}}
 
+sub getsetup () { #{{{
+       return
+               aggregateinternal => {
+                       type => "boolean",
+                       default => 0,
+                       description => "enable aggregation to internal pages",
+                       safe => 0, # enabling needs manual transition
+                       rebuild => 0,
+               },
+               aggregate_webtrigger => {
+                       type => "boolean",
+                       default => 0,
+                       description => "allow aggregation to be triggered via the web",
+                       safe => 1,
+                       rebuild => 0,
+               },
+} #}}}
+
 sub checkconfig () { #{{{
        if ($config{aggregate} && ! ($config{post_commit} && 
                                     IkiWiki::commit_hook_enabled())) {
index 187700f30d911dee95009a7d2515ef3aca61e176..b7470ca7950da421c91cd0d98b7300b82e86b7b4 100644 (file)
@@ -18,6 +18,7 @@ BEGIN {
 
 sub import { #{{{
        hook(type => "getopt", id => "amazon_s3", call => \&getopt);
+       hook(type => "getsetup", id => "amazon_s3", call => \&getsetup);
        hook(type => "checkconfig", id => "amazon_s3", call => \&checkconfig);
 } # }}}
 
@@ -39,6 +40,54 @@ sub getopt () { #{{{
        });
 } #}}}
 
+sub getsetup () { #{{{
+       return
+                amazon_s3_key_id => {
+                       type => "boolean",
+                       default => "",
+                       description => "public access key id",
+                       safe => 1,
+                       rebuild => 0,
+               },
+               amazon_s3_key_id => {
+                       type => "string",
+                       default => "",
+                       description => "file holding secret key",
+                       safe => 0, # ikiwiki reads this file
+                       rebuild => 0,
+               },
+               amazon_s3_bucket => {
+                       type => "string",
+                       default => "",
+                       example => "mywiki",
+                       description => "globally unique name of bucket to store wiki in",
+                       safe => 1,
+                       rebuild => 1,
+               },
+               amazon_s3_prefix => {
+                       type => "string",
+                       default => "wiki/",
+                       description => "a prefix to prepend to each page name",
+                       safe => 1,
+                       rebuild => 1,
+               },
+               amazon_s3_location => {
+                       type => "string",
+                       default => "",
+                       example => "EU",
+                       description => "which S3 datacenter to use (leave blank for default)",
+                       safe => 1,
+                       rebuild => 1,
+               },
+               amazon_s3_dupindex => {
+                       type => "boolean",
+                       default => 0,
+                       description => "store each index file twice, to allow urls ending in \"/index.html\" and \"/\"",
+                       safe => 1,
+                       rebuild => 1,
+               },
+} #}}}
+
 sub checkconfig { #{{{
        foreach my $field (qw{amazon_s3_key_id amazon_s3_key_file
                              amazon_s3_bucket}) {
index 1880516d568b35e2b96463676d23c04c62f103f2..e615499863a7c119143f3953775d7103c0dad203 100644 (file)
@@ -6,9 +6,22 @@ use strict;
 use IkiWiki 2.00;
 
 sub import { #{{{
-       hook(type => "canedit", id => "anonok", call => \&canedit,);
+       hook(type => "getsetup", id => "anonok", call => \&getsetup);
+       hook(type => "canedit", id => "anonok", call => \&canedit);
 } # }}}
 
+sub getsetup () { #{{{
+       return
+               anonok_pagespec => {
+                       type => "string",
+                       default => "",
+                       example => "*/discussion",
+                       description => "PageSpec to limit which pages anonymouse users can edit",
+                       safe => 1,
+                       rebuild => 0,
+               },
+} #}}}
+
 sub canedit ($$$) { #{{{
        my $page=shift;
        my $cgi=shift;
index 720078be15cfcd51399f375815b4d22e1a2e8d7b..3fe33c858ae849f7314a2e33ab9a40d946f259f6 100644 (file)
@@ -6,11 +6,24 @@ use strict;
 use IkiWiki 2.00;
 
 sub import { #{{{
+       hook(type => "getsetup", id => "attachment", call => \&getsetup);
        hook(type => "checkconfig", id => "attachment", call => \&checkconfig);
        hook(type => "formbuilder_setup", id => "attachment", call => \&formbuilder_setup);
        hook(type => "formbuilder", id => "attachment", call => \&formbuilder);
 } # }}}
 
+sub getsetup () { #{{{
+       return
+                => {
+                       type => "string",
+                       default => "",
+                       example => "clamdscan -",
+                       description => "virus checker program (reads STDIN, returns nonzero if virus found)",
+                       safe => 0, # executed
+                       rebuild => 0,
+               },
+} #}}}
+
 sub check_canattach ($$;$) { #{{{
        my $session=shift;
        my $dest=shift; # where it's going to be put, under the srcdir
index aed087eed58248d5da153543dba03abba17b5ef0..b808c9d1d64bbc5adf226335e14b31d7b5c67085 100644 (file)
@@ -30,10 +30,22 @@ my $time=time;
 my @now=localtime($time);
 
 sub import { #{{{
+       hook(type => "getsetup", id => "version", call => \&getsetup);
        hook(type => "needsbuild", id => "version", call => \&needsbuild);
        hook(type => "preprocess", id => "calendar", call => \&preprocess);
 } #}}}
 
+sub getsetup () { #{{{
+       return
+               archivebase => {
+                       type => "string",
+                       default => "archives",
+                       description => "base of the archives hierarchy",
+                       safe => 1,
+                       rebuild => 1,
+               },
+} #}}}
+
 sub is_leap_year (@) { #{{{
        my %params=@_;
        return ($params{year} % 4 == 0 && (($params{year} % 100 != 0) || $params{year} % 400 == 0));
index 2f09019431b44fd4c5ab458f44fe90026367d996..3ca4fccdf51307be98b635348e6cb21074250298 100644 (file)
@@ -15,6 +15,7 @@ my $nested=0;
 
 sub import { #{{{
        hook(type => "getopt", id => "inline", call => \&getopt);
+       hook(type => "getsetup", id => "inline", call => \&getsetup);
        hook(type => "checkconfig", id => "inline", call => \&checkconfig);
        hook(type => "sessioncgi", id => "inline", call => \&sessioncgi);
        hook(type => "preprocess", id => "inline", 
@@ -39,8 +40,51 @@ sub getopt () { #{{{
                "atom!" => \$config{atom},
                "allowrss!" => \$config{allowrss},
                "allowatom!" => \$config{allowatom},
+               "pingurl=s" => sub {
+                       push @{$config{pingurl}}, $_[1];
+               },      
        );
-}
+} #}}}
+
+sub getsetup () { #{{{
+       return
+               rss => {
+                       type => "boolean",
+                       default => 0,
+                       description => "enable rss feeds by default",
+                       safe => 1,
+                       rebuild => 1,
+               },
+               atom => {
+                       type => "boolean",
+                       default => 0,
+                       description => "enable atom feeds by default",
+                       safe => 1,
+                       rebuild => 1,
+               },
+               allowrss => {
+                       type => "boolean",
+                       default => 0,
+                       description => "allow rss feeds to be used",
+                       safe => 1,
+                       rebuild => 1,
+               },
+               allowatom => {
+                       type => "boolean",
+                       default => 0,
+                       description => "allow atom feeds to be used",
+                       safe => 1,
+                       rebuild => 1,
+               },
+               pingurl => {
+                       type => "string",
+                       default => "",
+                       example => "http://rpc.technorati.com/rpc/ping",
+                       description => "urls to ping (using XMP-RPC) on feed update",
+                       safe => 1,
+                       rebuild => 0,
+               },
+} #}}}
 
 sub checkconfig () { #{{{
        if (($config{rss} || $config{atom}) && ! length $config{url}) {
index 11f3f0137627643fe285e0464b59b2e0086b3f88..920d90e5e5eb8f81abf8560f402cd8d849e4c72b 100644 (file)
@@ -7,9 +7,21 @@ use strict;
 use IkiWiki 2.00;
 
 sub import { #{{{
+       hook(type => "getsetup", id => "mdwn", call => \&getsetup);
        hook(type => "htmlize", id => "mdwn", call => \&htmlize);
 } # }}}
 
+sub getsetup () { #{{{
+       return
+               multimarkdown => {
+                       type => "boolean",
+                       default => 0,
+                       description => "enable use of multimarkdown features",
+                       safe => 1,
+                       rebuild => 1,
+               },
+} #}}}
+
 my $markdown_sub;
 sub htmlize (@) { #{{{
        my %params=@_;
@@ -25,13 +37,13 @@ sub htmlize (@) { #{{{
                if (exists $config{multimarkdown} && $config{multimarkdown}) {
                        eval q{use Text::MultiMarkdown};
                        if ($@) {
-                               error(gettext("multimarkdown is enabled, but Text::MultiMarkdown is not installed"));
+                               debug(gettext("multimarkdown is enabled, but Text::MultiMarkdown is not installed"));
                        }
                        $markdown_sub=sub {
                                Text::MultiMarkdown::markdown(shift, {use_metadata => 0});
                        }
                }
-               else {
+               if (! defined $markdown_sub) {
                        eval q{use Text::Markdown};
                        if (! $@) {
                                if (Text::Markdown->can('markdown')) {
index 3997e6fefcd31c15a8fa6df7e559a6ffdf84e863..c7630d81f0b60911fed26b32baba015e3ea9757c 100644 (file)
@@ -6,9 +6,21 @@ use strict;
 use IkiWiki 2.00;
 
 sub import { #{{{
+       hook(type => "getsetup", id => "mirrorlist", call => \&getsetup);
        hook(type => "pagetemplate", id => "mirrorlist", call => \&pagetemplate);
 } # }}}
 
+sub getsetup () { #{{{
+       return
+               mirrorlist => {
+                       type => "string",
+                       default => "",
+                       description => "list of mirrors",
+                       safe => 1,
+                       rebuild => 1,
+               },
+} #}}}
+
 sub pagetemplate (@) { #{{{
        my %params=@_;
         my $template=$params{template};
index 10a8fa22f46aa8116f10e13a48ac01678b8ba997..bc9311d9c04aec49b1db6f269663bc52b379391b 100644 (file)
@@ -8,6 +8,7 @@ use IkiWiki 2.00;
 
 sub import { #{{{
        hook(type => "getopt", id => "openid", call => \&getopt);
+       hook(type => "getsetup", id => "openid", call => \&getsetup);
        hook(type => "auth", id => "openid", call => \&auth);
        hook(type => "formbuilder_setup", id => "openid",
                call => \&formbuilder_setup, last => 1);
@@ -20,6 +21,18 @@ sub getopt () { #{{{
        GetOptions("openidsignup=s" => \$config{openidsignup});
 } #}}}
 
+sub getsetup () { #{{{
+       return
+               openidsignup => {
+                       type => "string",
+                       default => "",
+                       example => "http://myopenid.com/",
+                       description => "an url where users can signup for an OpenID",
+                       safe => 1,
+                       rebuild => 0,
+               },
+} #}}}
+
 sub formbuilder_setup (@) { #{{{
        my %params=@_;
 
index f3f1aa4bf2b7b5f761859d7a75a2c0d68f8b4eb7..a3fd2d4ede3ce5e446b68dba28b13f7f4965471e 100644 (file)
@@ -7,13 +7,30 @@ use strict;
 use IkiWiki 2.00;
 
 sub import { #{{{
-        hook(type => "formbuilder_setup", id => "passwordauth",
-               call => \&formbuilder_setup);
-        hook(type => "formbuilder", id => "passwordauth",
-               call => \&formbuilder);
+       hook(type => "getsetup", id => "passwordauth", "call" => \&getsetup);
+        hook(type => "formbuilder_setup", id => "passwordauth", call => \&formbuilder_setup);
+        hook(type => "formbuilder", id => "passwordauth", call => \&formbuilder);
        hook(type => "sessioncgi", id => "passwordauth", call => \&sessioncgi);
 } # }}}
 
+sub getsetup () { #{{{
+       return
+               account_creation_password => {
+                       type => "string",
+                       default => "",
+                       description => "a password that must be entered when signing up for an account",
+                       safe => 1,
+                       rebuild => 0,
+               },
+               password_cost => {
+                       type => "integer",
+                       default => 8,
+                       description => "cost of generating a password using Authen::Passphrase::BlowfishCrypt",
+                       safe => 1,
+                       rebuild => 0,
+               },
+} #}}}
+
 # Checks if a string matches a user's password, and returns true or false.
 sub checkpassword ($$;$) { #{{{
        my $user=shift;
index 614d428853c7d0d2efbaa74987edc97e6643a452..89b4365abf1c1393d24d254748b387f247efb554 100644 (file)
@@ -9,12 +9,24 @@ my %pages;
 my $pinged=0;
 
 sub import { #{{{
+       hook(type => "getsetup", id => "pinger", call => \&getsetup);
        hook(type => "needsbuild", id => "pinger", call => \&needsbuild);
        hook(type => "preprocess", id => "ping", call => \&preprocess);
        hook(type => "delete", id => "pinger", call => \&ping);
        hook(type => "change", id => "pinger", call => \&ping);
 } # }}}
 
+sub getsetup () { #{{{
+       return
+               pinger_timeout => {
+                       type => "int",
+                       default => 15,
+                       description => "how many seconds to try pinging before timing out",
+                       safe => 1,
+                       rebuild => 0,
+               },
+} #}}}
+
 sub needsbuild (@) { #{{{
        my $needsbuild=shift;
        foreach my $page (keys %pagestate) {
index 745e6a1de436e2db15b97ebe897858f891de2a51..be7e2c761d122019e9e1d4b5562e3c1e6c2b39a0 100644 (file)
@@ -40,9 +40,28 @@ sub default_timetable {
 }
 
 sub import { #{{{
+       hook(type => "getsetup", id => "getsetup", call => \&getsetup);
        hook(type => "checkconfig", id => "prettydate", call => \&checkconfig);
 } # }}}
 
+sub getsetup () { #{{{
+       return
+               prettydateformat => {
+                       type => "string",
+                       default => '%X, %B %o, %Y',
+                       description => "format to use to display date",
+                       safe => 1,
+                       rebuild => 1,
+               },
+               timetable => {
+                       type => undef, # don't try to show in interface
+                       default => '%X, %B %o, %Y',
+                       description => "array of time descriptions",
+                       safe => 1,
+                       rebuild => 1,
+               },
+} #}}}
+
 sub checkconfig () { #{{{
        if (! defined $config{prettydateformat} ||
            $config{prettydateformat} eq '%c') {
index 3bb881c4320f246b1edd4f9af80014149036d9e4..f48f2cfebcc32c8d6647d1d208ae7b3ad3f24dc0 100755 (executable)
@@ -73,9 +73,6 @@ sub getconfig () { #{{{
                        "disable-plugin=s@" => sub {
                                push @{$config{disable_plugins}}, $_[1];
                        },
-                       "pingurl=s" => sub {
-                               push @{$config{pingurl}}, $_[1];
-                       },
                        "set=s" => sub {
                                my ($var, $val)=split('=', $_[1], 2);
                                if (! defined $var || ! defined $val) {