cgiurl => {
type => "string",
default => '',
- examples => "http://example.com/wiki/ikiwiki.cgi",
+ example => "http://example.com/wiki/ikiwiki.cgi",
description => "url to the ikiwiki.cgi",
safe => 1,
rebuild => 1,
},
+ cgi_wrapper => {
+ type => "string",
+ default => '',
+ example => "/var/www/wiki/ikiwiki.cgi",
+ description => "cgi executable to generate",
+ safe => 0, # file
+ rebuild => 0,
+ },
+ cgi_wrappermode => {
+ type => "string",
+ default => '06755',
+ description => "mode for cgi_wrapper (can safely be made suid)",
+ safe => 0,
+ rebuild => 0,
+ },
rcs => {
type => "string",
default => '',
safe => 1,
rebuild => 1,
},
- wrappers => {
- type => "string",
- example => [
- {
- cgi => 1,
- wrapper => "/var/www/wiki/ikiwiki.cgi",
- wrappermode => "06755",
- },
- ],
- description => "definitions of wrappers to generate",
- safe => 0,
- rebuild => 0,
- },
- wrapper => {
- type => "internal",
- default => undef,
- description => "wrapper filename",
- safe => 0,
- rebuild => 0,
- },
- wrappermode => {
- type => "internal",
- default => undef,
- description => "mode of wrapper file",
- safe => 0,
- rebuild => 0,
- },
templatedir => {
type => "string",
default => "$installdir/share/ikiwiki/templates",
safe => 0, # path
rebuild => 0,
},
+ wrappers => {
+ type => "internal",
+ default => [],
+ description => "wrappers to generate",
+ safe => 0,
+ rebuild => 0,
+ },
underlaydirs => {
type => "internal",
default => [],
use Encode;
use open qw{:utf8 :std};
+hook(type => "checkconfig", id => "bzr", call => sub { #{{{
+ if (! defined $config{diffurl}) {
+ $config{diffurl}="";
+ }
+ if (exists $config{bzr_wrapper}) {
+ push @{$config{wrappers}}, {
+ wrapper => $config{bzr_wrapper},
+ wrappermode => (defined $config{bzr_wrappermode} ? $config{bzr_wrappermode} : "06755"),
+ };
+ }
+}); #}}}
+
hook(type => "getsetup", id => "bzr", call => sub { #{{{
return
+ bzr_wrapper => {
+ type => "string",
+ #example => "", # FIXME add example
+ description => "bzr post-commit executable to generate",
+ safe => 0, # file
+ rebuild => 0,
+ },
+ bzr_wrappermode => {
+ type => "string",
+ example => '06755',
+ description => "mode for bzr_wrapper (can safely be made suid)",
+ safe => 0,
+ rebuild => 0,
+ },
historyurl => {
type => "string",
- default => "",
#example => "", # FIXME add example
description => "url to show file history, using loggerhead ([[file]] substituted)",
safe => 1,
},
diffurl => {
type => "string",
- default => "",
example => "http://example.com/revision?start_revid=[[r2]]#[[file]]-s",
description => "url to view a diff, using loggerhead ([[file]] and [[r2]] substituted)",
safe => 1,
my $dummy_commit_msg = 'dummy commit'; # message to skip in recent changes
hook(type => "checkconfig", id => "git", call => sub { #{{{
+ if (! defined $config{diffurl}) {
+ $config{diffurl}="";
+ }
if (! defined $config{gitorigin_branch}) {
$config{gitorigin_branch}="origin";
}
if (! defined $config{gitmaster_branch}) {
$config{gitmaster_branch}="master";
}
+ if (exists $config{git_wrapper}) {
+ push @{$config{wrappers}}, {
+ wrapper => $config{git_wrapper},
+ wrappermode => (defined $config{git_wrappermode} ? $config{git_wrappermode} : "06755"),
+ };
+ }
}); #}}}
hook(type => "getsetup", id => "git", call => sub { #{{{
return
+ git_wrapper => {
+ type => "string",
+ example => "/git/wiki.git/hooks/post-update",
+ description => "git post-update executable to generate",
+ safe => 0, # file
+ rebuild => 0,
+ },
+ git_wrappermode => {
+ type => "string",
+ example => '06755',
+ description => "mode for git_wrapper (can safely be made suid)",
+ safe => 0,
+ rebuild => 0,
+ },
historyurl => {
type => "string",
- default => "",
example => "http://git.example.com/gitweb.cgi?p=wiki.git;a=history;f=[[file]]",
description => "gitweb url to show file history ([[file]] substituted)",
safe => 1,
},
diffurl => {
type => "string",
- default => "",
example => "http://git.example.com/gitweb.cgi?p=wiki.git;a=blobdiff;h=[[sha1_to]];hp=[[sha1_from]];hb=[[sha1_parent]];f=[[file]]",
description => "gitweb url to show a diff ([[sha1_to]], [[sha1_from]], [[sha1_parent]], and [[file]] substituted)",
safe => 1,
},
gitorigin_branch => {
type => "string",
- default => "origin",
+ example => "origin",
description => "where to pull and push changes (set to empty string to disable)",
safe => 0, # paranoia
rebuild => 0,
},
gitmaster_branch => {
type => "string",
- default => "master",
+ example => "master",
description => "branch that the wiki is stored in",
safe => 0, # paranoia
rebuild => 0,
use Encode;
use open qw{:utf8 :std};
+hook(type => "checkconfig", id => "mercurial", call => sub { #{{{
+ if (! defined $config{diffurl}) {
+ $config{diffurl}="";
+ }
+ if (exists $config{mercurial_wrapper}) {
+ push @{$config{wrappers}}, {
+ wrapper => $config{mercurial_wrapper},
+ wrappermode => (defined $config{mercurial_wrappermode} ? $config{mercurial_wrappermode} : "06755"),
+ };
+ }
+}); #}}}
+
hook(type => "getsetup", id => "mercurial", call => sub { #{{{
return
+ mercurial_wrapper => {
+ type => "string",
+ #example => # FIXME add example
+ description => "mercurial post-commit executable to generate",
+ safe => 0, # file
+ rebuild => 0,
+ },
+ mercurial_wrappermode => {
+ type => "string",
+ example => '06755',
+ description => "mode for mercurial_wrapper (can safely be made suid)",
+ safe => 0,
+ rebuild => 0,
+ },
historyurl => {
type => "string",
- default => "",
example => "http://example.com:8000/log/tip/[[file]]",
description => "url to hg serve'd repository, to show file history ([[file]] substituted)",
safe => 1,
},
diffurl => {
type => "string",
- default => "",
example => "http://localhost:8000/?fd=[[r2]];file=[[file]]",
description => "url to hg serve'd repository, to show diff ([[file]] and [[r2]] substituted)",
safe => 1,
if ($version < 0.38) {
error("Monotone version too old, is $version but required 0.38");
}
+
+ if (exists $config{mtn_wrapper}) {
+ push @{$config{wrappers}}, {
+ wrapper => $config{mtn_wrapper},
+ wrappermode => (defined $config{mtn_wrappermode} ? $config{mtn_wrappermode} : "06755"),
+ };
+ }
}); #}}}
hook(type => "getsetup", id => "monotone", call => sub { #{{{
return
+ mtn_wrapper => {
+ type => "string",
+ example => "/srv/mtn/wiki/_MTN/ikiwiki-netsync-hook",
+ description => "monotone netsync hook executable to generate",
+ safe => 0, # file
+ rebuild => 0,
+ },
+ mtn_wrappermode => {
+ type => "string",
+ example => '06755',
+ description => "mode for mtn_wrapper (can safely be made suid)",
+ safe => 0,
+ rebuild => 0,
+ },
mtnkey => {
type => "string",
- default => "",
example => 'web@example.com',
description => "your monotone key",
safe => 1,
},
historyurl => {
type => "string",
- default => "",
example => "http://viewmtn.example.com/branch/head/filechanges/com.example.branch/[[file]]",
description => "viewmtn url to show file history ([[file]] substituted)",
safe => 1,
},
diffurl => {
type => "string",
- default => "",
example => "http://viewmtn.example.com/revision/diff/[[r1]]/with/[[r2]]/[[file]]",
description => "viewmtn url to show a diff ([[r1]], [[r2]], and [[file]] substituted)",
safe => 1,
},
mtnsync => {
type => "boolean",
- default => 0,
+ example => 0,
description => "sync on update and commit?",
safe => 0, # paranoia
rebuild => 0,
},
mtnrootdir => {
type => "string",
- default => "",
description => "path to your workspace (defaults to the srcdir; specify if the srcdir is a subdirectory of the workspace)",
safe => 0, # path
rebuild => 0,
use POSIX qw(setlocale LC_CTYPE);
hook(type => "checkconfig", id => "svn", call => sub { #{{{
+ if (! defined $config{diffurl}) {
+ $config{diffurl}="";
+ }
if (! defined $config{svnpath}) {
$config{svnpath}="trunk";
}
$config{svnpath}=~s/\/$//;
$config{svnpath}=~s/^\///;
}
+ if (exists $config{svn_wrapper}) {
+ push @{$config{wrappers}}, {
+ wrapper => $config{svn_wrapper},
+ wrappermode => (defined $config{svn_wrappermode} ? $config{svn_wrappermode} : "04755"),
+ };
+ }
}); #}}}
hook(type => "getsetup", id => "svn", call => sub { #{{{
return
svnrepo => {
type => "string",
- default => "",
example => "/svn/wiki",
description => "subversion repository location",
safe => 0, # path
},
svnpath => {
type => "string",
- default => "trunk",
+ example => "trunk",
description => "path inside repository where the wiki is located",
safe => 0, # paranoia
rebuild => 0,
},
+ svn_wrapper => {
+ type => "string",
+ example => "/svn/wikirepo/hooks/post-commit",
+ description => "svn post-commit executable to generate",
+ safe => 0, # file
+ rebuild => 0,
+ },
+ svn_wrappermode => {
+ type => "string",
+ example => '04755',
+ description => "mode for svn_wrapper (can safely be made suid)",
+ safe => 0,
+ rebuild => 0,
+ },
historyurl => {
type => "string",
- default => "",
example => "http://svn.example.org/trunk/[[file]]",
description => "viewvc url to show file history ([[file]] substituted)",
safe => 1,
},
diffurl => {
type => "string",
- default => "",
example => "http://svn.example.org/trunk/[[file]]?root=wiki&r1=[[r1]]&r2=[[r2]]",
description => "viewvc url to show a diff ([[file]], [[r1]], and [[r2]] substituted)",
safe => 1,
use strict;
use IkiWiki;
+hook(type => "checkconfig", id => "tla", call => sub { #{{{
+ if (! defined $config{diffurl}) {
+ $config{diffurl}="";
+ }
+ if (exists $config{tla_wrapper}) {
+ push @{$config{wrappers}}, {
+ wrapper => $config{tla_wrapper},
+ wrappermode => (defined $config{tla_wrappermode} ? $config{tla_wrappermode} : "06755"),
+ };
+ }
+}); #}}}
+
hook(type => "getsetup", id => "tla", call => sub { #{{{
return
+ tla_wrapper => {
+ type => "string",
+ #example => "", # TODO example
+ description => "tla post-commit executable to generate",
+ safe => 0, # file
+ rebuild => 0,
+ },
+ tla_wrappermode => {
+ type => "string",
+ example => '06755',
+ description => "mode for tla_wrapper (can safely be made suid)",
+ safe => 0,
+ rebuild => 0,
+ },
historyurl => {
type => "string",
- default => "",
#example => "", # TODO example
description => "url to show file history ([[file]] substituted)",
safe => 1,
},
diffurl => {
type => "string",
- default => "",
#example => "", # TODO example
description => "url to show a diff ([[file]] and [[rev]] substituted)",
safe => 1,
$config{$c}=IkiWiki::possibly_foolish_untaint($setup{$c});
}
elsif (ref $setup{$c} eq 'ARRAY') {
- $config{$c}=[map { IkiWiki::possibly_foolish_untaint($_) } @{$setup{$c}}]
+ if ($c eq 'wrappers') {
+ # backwards compatability code
+ $config{$c}=$setup{$c};
+ }
+ else {
+ $config{$c}=[map { IkiWiki::possibly_foolish_untaint($_) } @{$setup{$c}}]
+ }
}
elsif (ref $setup{$c} eq 'HASH') {
foreach my $key (keys %{$setup{$c}}) {
$config{$c}=undef;
}
}
+
+ if (exists $config{cgi_wrapper}) {
+ push @{$config{wrappers}}, {
+ cgi => 1,
+ wrapper => $config{cgi_wrapper},
+ wrappermode => (defined $config{cgi_wrappermode} ? $config{cgi_wrappermode} : "06755"),
+ };
+ }
} #}}}
sub dump ($) { #{{{
* Add getsetup hook, all plugins that add fields to %config should use it.
* ikiwiki --dumpsetup can generate a nice setup file snapshotting ikiwiki's
current configuration.
+ * The way wrappers are defined in the setup file has changed. Old setup
+ files will continue to work, for now.
-- Joey Hess <joeyh@debian.org> Mon, 21 Jul 2008 11:35:46 -0400
Let's first enable a key wiki feature and set up [[CGI]] to allow
editing the wiki from the web. Just edit ikiwiki.setup, uncomment the
-block for the cgi wrapper, make sure the filename for the cgi wrapper
+settings for the `cgi_wrapper`, make sure the filename for the cgi wrapper
is ok, run `ikiwiki --setup ikiwiki.setup`, and you're done!
There are lots of other configuration options in ikiwiki.setup that you
Once your wiki is checked in to the revision control system,
you should configure ikiwiki to use revision control. Edit your
-ikiwiki.setup, and uncomment the lines for the revision control system
+ikiwiki.setup, set `rcs` to the the revision control system
you chose to use. Be sure to set `svnrepo` to $REPOSITORY, if using
-subversion. Uncomment the block for the wrapper for your revision
-control system, and configure the wrapper path in that block
-appropriately (for Git, it should be `$REPOSITORY/hooks/post-update`).
+subversion. Uncomment the configuration for the wrapper for your revision
+control system, and configure the wrapper path appropriately
+(for Git, it should be `$REPOSITORY/hooks/post-update`).
Once it's all set up, run `ikiwiki --setup ikiwiki.setup` once more.
Now you should be able to edit files in $SRCDIR, and use your revision