summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki/Plugin/aggregate.pm19
-rw-r--r--IkiWiki/Plugin/amazon_s3.pm49
-rw-r--r--IkiWiki/Plugin/anonok.pm15
-rw-r--r--IkiWiki/Plugin/attachment.pm13
-rw-r--r--IkiWiki/Plugin/calendar.pm12
-rw-r--r--IkiWiki/Plugin/inline.pm46
-rw-r--r--IkiWiki/Plugin/mdwn.pm16
-rw-r--r--IkiWiki/Plugin/mirrorlist.pm12
-rw-r--r--IkiWiki/Plugin/openid.pm13
-rw-r--r--IkiWiki/Plugin/passwordauth.pm25
-rw-r--r--IkiWiki/Plugin/pinger.pm12
-rw-r--r--IkiWiki/Plugin/prettydate.pm19
-rwxr-xr-xikiwiki.in3
13 files changed, 243 insertions, 11 deletions
diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm
index e000bc864..be62d8a1a 100644
--- a/IkiWiki/Plugin/aggregate.pm
+++ b/IkiWiki/Plugin/aggregate.pm
@@ -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())) {
diff --git a/IkiWiki/Plugin/amazon_s3.pm b/IkiWiki/Plugin/amazon_s3.pm
index 187700f30..b7470ca79 100644
--- a/IkiWiki/Plugin/amazon_s3.pm
+++ b/IkiWiki/Plugin/amazon_s3.pm
@@ -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}) {
diff --git a/IkiWiki/Plugin/anonok.pm b/IkiWiki/Plugin/anonok.pm
index 1880516d5..e61549986 100644
--- a/IkiWiki/Plugin/anonok.pm
+++ b/IkiWiki/Plugin/anonok.pm
@@ -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;
diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm
index 720078be1..3fe33c858 100644
--- a/IkiWiki/Plugin/attachment.pm
+++ b/IkiWiki/Plugin/attachment.pm
@@ -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
diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm
index aed087eed..b808c9d1d 100644
--- a/IkiWiki/Plugin/calendar.pm
+++ b/IkiWiki/Plugin/calendar.pm
@@ -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));
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index 2f0901943..3ca4fccdf 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
@@ -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}) {
diff --git a/IkiWiki/Plugin/mdwn.pm b/IkiWiki/Plugin/mdwn.pm
index 11f3f0137..920d90e5e 100644
--- a/IkiWiki/Plugin/mdwn.pm
+++ b/IkiWiki/Plugin/mdwn.pm
@@ -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')) {
diff --git a/IkiWiki/Plugin/mirrorlist.pm b/IkiWiki/Plugin/mirrorlist.pm
index 3997e6fef..c7630d81f 100644
--- a/IkiWiki/Plugin/mirrorlist.pm
+++ b/IkiWiki/Plugin/mirrorlist.pm
@@ -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};
diff --git a/IkiWiki/Plugin/openid.pm b/IkiWiki/Plugin/openid.pm
index 10a8fa22f..bc9311d9c 100644
--- a/IkiWiki/Plugin/openid.pm
+++ b/IkiWiki/Plugin/openid.pm
@@ -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=@_;
diff --git a/IkiWiki/Plugin/passwordauth.pm b/IkiWiki/Plugin/passwordauth.pm
index f3f1aa4bf..a3fd2d4ed 100644
--- a/IkiWiki/Plugin/passwordauth.pm
+++ b/IkiWiki/Plugin/passwordauth.pm
@@ -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;
diff --git a/IkiWiki/Plugin/pinger.pm b/IkiWiki/Plugin/pinger.pm
index 614d42885..89b4365ab 100644
--- a/IkiWiki/Plugin/pinger.pm
+++ b/IkiWiki/Plugin/pinger.pm
@@ -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) {
diff --git a/IkiWiki/Plugin/prettydate.pm b/IkiWiki/Plugin/prettydate.pm
index 745e6a1de..be7e2c761 100644
--- a/IkiWiki/Plugin/prettydate.pm
+++ b/IkiWiki/Plugin/prettydate.pm
@@ -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') {
diff --git a/ikiwiki.in b/ikiwiki.in
index 3bb881c43..f48f2cfeb 100755
--- a/ikiwiki.in
+++ b/ikiwiki.in
@@ -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) {