--- /dev/null
+#!/usr/bin/perl
+# Standard ikiwiki setup module.
+# Parameters to import should be all the standard ikiwiki config stuff,
+# plus hashes for cgiwrapper and svnwrapper, which specify any differing
+# config stuff for them and cause the wrappers to be made.
+
+package IkiWiki::Setup::Standard;
+
+use warnings;
+use strict;
+
+sub import {
+ my %setup=%{$_[1]};
+
+
+ ::debug("generating wrappers..");
+ foreach my $wrapper (@{$setup{wrapper}}) {
+ ::gen_wrapper(%::config, %setup, %{$wrapper});
+ }
+
+ ::debug("rebuilding wiki..");
+ foreach my $c (keys %setup) {
+ $::config{$c}=::possibly_foolish_untaint($setup{$c})
+ if defined $setup{$c} && ! ref $setup{$c};
+ }
+ $::config{rebuild}=1;
+ ::refresh();
+
+ ::debug("done");
+ ::saveindex();
+}
+
+1
+++ /dev/null
-all:
- ./ikiwiki doc templates html --wikiname="ikiwiki" --verbose \
- --nosvn --exclude=/discussion
-
-clean:
- rm -rf html
- rm -rf doc/.ikiwiki
--- /dev/null
+#!/usr/bin/perl
+use warnings;
+use strict;
+use ExtUtils::MakeMaker;
+
+# Add a few more targets.
+sub MY::postamble {
+q{
+all:: extra_build
+clean:: extra_clean
+install:: extra_install
+pure_install:: extra_install
+
+extra_build:
+ ./ikiwiki doc templates html --wikiname="ikiwiki" --verbose \
+ --nosvn --exclude=/discussion
+
+extra_clean:
+ rm -rf html
+ rm -rf doc/.ikiwiki
+
+extra_install:
+}
+}
+
+WriteMakefile(
+ 'NAME' => 'IkiWiki',
+ 'EXE_FILES' => ['ikiwiki'],
+);
to point to it, but will forget to update the linkbacks in Foo/Baz.
And if Foo/Bar/Baz is then removed, it forgets to update Foo/Bar to link
back to Foo/Baz.
-* Foo/Bar/Baz shows up as Bar/Baz in the linkbacks on page Foo/Bar. Should
- show as just Baz there.
* If I try to do a web commit, to a svn+ssh repo, it fails with
"Host key verification failed."
I think that the setuid isn't fully taking; it should be running as me,
#
# Remember to re-run ikiwiki --setup any time you edit this file.
-%setup=(
+use IkiWiki::Setup::Standard {
wikiname => "MyWiki",
# Be sure to customise these..
svn => 1,
svnrepo => "/svn/wiki",
- # 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,
- },
+ wrappers => [
+ {
+ # The svn wrapper.
+ # Note that this will overwrite any exsting
+ # post-commit hook 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,
+ #},
+ },
+ ],
- # The cgi wrapper.
- #cgiwrapper => {
- # cgi => 1,
- # wrapper => "/var/www/wiki/ikiwiki.cgi",
- # wrappermode => 06755,
- #},
-
# Can anonymous web users edit pages?
#anonok => 1,
-);
+}
directories, and read through and configure the rest of the file to your
liking.
- Note that the default file has a block to configure a svnwraper. This
+ Note that the default file has a block to configure a svn wrapper. This
sets up a [[post-commit]] hook to update the wiki.
When you're satisfied, run `ikiwiki --setup ikiwiki.setup`, and it
8. Set up [[CGI]] to allow editing the wiki from the web.
- Just edit ikiwiki.setup, uncomment the block for the cgiwrapper, make
+ Just edit ikiwiki.setup, uncomment the block for the cgi wrapper, make
sure the filename for the cgi wrapper is ok, run
`ikiwiki --setup ikiwiki.setup`, and you're done!
Possibly add "next 100" link to it, but OTOH, you can just use svn log if
you need that data..
-## setup classes
-
-The setup files should "use WikiWiki::Setup" and the like at the top, and
-indeed could just be one big use that passes all params to the module's
-importer. The module then handles running ikiwiki functions. This would
-allow for different types of setup files for more than just the one
-hardcoded thing there is now, and would probably be good for upgrades,
-incompatible changes, etc, too.
-
## base wiki
Need a toned down version of this wiki with a basic frontpage, sandbox and
my (%links, %oldlinks, %oldpagemtime, %renderedfiles, %pagesources);
-my %config=( #{{{
+# Holds global config settings, also used by some modules.
+our %config=( #{{{
wiki_file_prune_regexp => qr{((^|/).svn/|\.\.|^\.|\/\.|\.html?$)},
wiki_link_regexp => qr/\[\[([^\s]+)\]\]/,
wiki_file_regexp => qr/(^[-A-Za-z0-9_.:\/+]+$)/,
($code)=$code=~/(.*)/s;
close IN;
- my (%setup);
eval $code;
error($@) if $@;
-
- 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;
} #}}}