From b25c93c862c729605bdfd77d91f44a0e30b92351 Mon Sep 17 00:00:00 2001 From: www-data Date: Sat, 11 Mar 2006 05:51:44 +0000 Subject: [PATCH 01/16] web commit from 66.118.98.137: --- doc/sandbox.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/sandbox.mdwn b/doc/sandbox.mdwn index a212bb452..2e7fb8a23 100644 --- a/doc/sandbox.mdwn +++ b/doc/sandbox.mdwn @@ -6,7 +6,7 @@ See [[MarkDown]] for documentation of the markup syntax used on this page. Here's a paragraph. -Here's another one. +Here's another one with _emphasied_ and *bold* text. # Header -- 2.39.5 From 07959b57ca3c2b50f62e4db8da207168968286a2 Mon Sep 17 00:00:00 2001 From: www-data Date: Sat, 11 Mar 2006 05:52:00 +0000 Subject: [PATCH 02/16] web commit from 66.118.98.137: --- doc/sandbox.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/sandbox.mdwn b/doc/sandbox.mdwn index 2e7fb8a23..03ae1f1c0 100644 --- a/doc/sandbox.mdwn +++ b/doc/sandbox.mdwn @@ -6,7 +6,7 @@ See [[MarkDown]] for documentation of the markup syntax used on this page. Here's a paragraph. -Here's another one with _emphasied_ and *bold* text. +Here's another one with _emphasized_ and *bold* text. # Header -- 2.39.5 From b292bec36c9e129097bc6e66192fd24a69a1c66d Mon Sep 17 00:00:00 2001 From: www-data Date: Sat, 11 Mar 2006 05:52:13 +0000 Subject: [PATCH 03/16] web commit from 66.118.98.137: --- doc/sandbox.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/sandbox.mdwn b/doc/sandbox.mdwn index 03ae1f1c0..a4e2fb6c8 100644 --- a/doc/sandbox.mdwn +++ b/doc/sandbox.mdwn @@ -6,7 +6,7 @@ See [[MarkDown]] for documentation of the markup syntax used on this page. Here's a paragraph. -Here's another one with _emphasized_ and *bold* text. +Here's another one with *bold* text. # Header -- 2.39.5 From dba676550c3eb3c03fd8f3f78ef07ede7aff9c91 Mon Sep 17 00:00:00 2001 From: www-data Date: Sat, 11 Mar 2006 05:52:38 +0000 Subject: [PATCH 04/16] web commit from 66.118.98.137: --- doc/sandbox.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/sandbox.mdwn b/doc/sandbox.mdwn index a4e2fb6c8..d827a5457 100644 --- a/doc/sandbox.mdwn +++ b/doc/sandbox.mdwn @@ -6,7 +6,7 @@ See [[MarkDown]] for documentation of the markup syntax used on this page. Here's a paragraph. -Here's another one with *bold* text. +Here's another one with *emphasised* text. # Header -- 2.39.5 From e7d50f7f73644bdcf2f7ea8aa77d9a6dcf475039 Mon Sep 17 00:00:00 2001 From: www-data Date: Sat, 11 Mar 2006 05:55:12 +0000 Subject: [PATCH 05/16] web commit from 66.118.98.137: --- doc/todo.mdwn | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/todo.mdwn b/doc/todo.mdwn index c3b26ef7b..837d8d7f7 100644 --- a/doc/todo.mdwn +++ b/doc/todo.mdwn @@ -4,7 +4,8 @@ * Missing conflict detection. * Missing commit message box. * No support for web user tracking/login yet. -* Doesn't svn commit yet. +* Eventually, might want page deletion. +* Eventually, might want file upload. ## recentchanges @@ -13,7 +14,7 @@ Should support RSS for notification of new and changed pages. ## page history To see past versions of a page, we can either implement a browser for that, -or just provide a way to link to the page in viewcvs. +or just provide a way to link to the page in viewcvs. viewcvs seems fine to me. ## pluggable renderers -- 2.39.5 From 8440a771c10c20c4be0a65a50c8bf05754e3fd4d Mon Sep 17 00:00:00 2001 From: www-data Date: Sat, 11 Mar 2006 06:00:48 +0000 Subject: [PATCH 06/16] web commit from 66.118.98.137: --- doc/security.mdwn | 57 +++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/doc/security.mdwn b/doc/security.mdwn index b72621111..a3e387218 100644 --- a/doc/security.mdwn +++ b/doc/security.mdwn @@ -6,10 +6,12 @@ security issues with this program than with cat(1). If, however, you let others edit pages in your wiki, then some possible security issues do need to be kept in mind. +# Probable holes + ## html attacks ikiwiki does not attempt to do any santization of the html on the wiki. -MarkDown allows embedding of arbitrary html into a markdown document. If +[[MarkDown]] allows embedding of arbitrary html into a markdown document. If you let anyone else edit files on the wiki, then anyone can have fun exploiting the web browser bug of the day. This type of attack is typically referred to as an XSS attack ([google](http://www.google.com/search?q=xss+attack)). @@ -18,22 +20,9 @@ to as an XSS attack ([google](http://www.google.com/search?q=xss+attack)). If it enounters a file type it does not understand, ikiwiki just copies it into place. So if you let users add any kind of file they like, they can -upload images, movies, windows executables, etc. If these files exploit -security holes in the browser of someone who's viewing the wiki, that can -be a security problem. - -## exploting ikiwiki with bad content - -Someone could add bad content to the wiki and hope to exploit ikiwiki. -Note that ikiwiki runs with perl taint checks on, so this is unlikely; -the only data that is not subject to full taint checking is the names of -files, and filenames are sanitised. +upload images, movies, windows executables, css files, etc. If these files exploit security holes in the browser of someone who's viewing the wiki, that can be a security problem. -## cgi scripts - -ikiwiki does not allow cgi scripts to be published as part of the wiki. Or -rather, the script is published, but it's not marked executable, so -hopefully your web server will not run it. +Of course nobody else seems to worry about this in other wikis, so should we? ## web server attacks @@ -41,17 +30,6 @@ If your web server does any parsing of special sorts of files (for example, server parsed html files), then if you let anyone else add files to the wiki, they can try to use this to exploit your web server. -## --gen-wrapper might generate insecure wrappers - -ikiwiki --gen-wrapper is intended to generate a wrapper program that -runs ikiwiki to update a given wiki. The wrapper can in turn be made suid, -for example to be used in a [[post-commit]] hook by people who cannot write -to the html pages, etc. - -If the wrapper script is made suid, then any bugs in this wrapper would be -security holes. The wrapper is written as securely as I know how and -there's been no problem yet. - ## symlink attacks Could a committer trick ikiwiki into following a symlink and operating on @@ -89,3 +67,28 @@ such as subversion dotfiles. This is done by sanitising the filename removing unallowed characters, then making sure it doesn't start with "/" or contain ".." or "/.svn/". Annoyingly ad-hoc, this kind of code is where security holes breed. It needs a test suite at the very least. + +---- + +# Probable non-holes + +## exploting ikiwiki with bad content + +Someone could add bad content to the wiki and hope to exploit ikiwiki. +Note that ikiwiki runs with perl taint checks on, so this is unlikely. + +## publishing cgi scripts + +ikiwiki does not allow cgi scripts to be published as part of the wiki. Or +rather, the script is published, but it's not marked executable, so +hopefully your web server will not run it. + +## --gen-wrapper might generate insecure wrappers + +ikiwiki --gen-wrapper is intended to generate a wrapper program that +runs ikiwiki to update a given wiki. The wrapper can in turn be made suid, +for example to be used in a [[post-commit]] hook by people who cannot write +to the html pages, etc. + +If the wrapper script is made suid, then any bugs in this wrapper would be +security holes. The wrapper is written as securely as I know how, is based on code that has a history of security use long before ikiwiki, and there's been no problem yet. -- 2.39.5 From dce2ce40e828e46613926025768f38e47993c61e Mon Sep 17 00:00:00 2001 From: www-data Date: Sat, 11 Mar 2006 06:02:51 +0000 Subject: [PATCH 07/16] web commit from 66.118.98.137: --- doc/security.mdwn | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/security.mdwn b/doc/security.mdwn index a3e387218..e25cc9ce9 100644 --- a/doc/security.mdwn +++ b/doc/security.mdwn @@ -92,3 +92,7 @@ to the html pages, etc. If the wrapper script is made suid, then any bugs in this wrapper would be security holes. The wrapper is written as securely as I know how, is based on code that has a history of security use long before ikiwiki, and there's been no problem yet. + +## shell exploits + +ikiwiki does not expose untrusted data to the shell. In fact it doesn't use system() at all, and the only use of backticks is on data supplied by the wiki admin. And it runs with taint checks on of course.. \ No newline at end of file -- 2.39.5 From fd69e837b662d2d92d9fbce086e11d3e7bb4f2b1 Mon Sep 17 00:00:00 2001 From: www-data Date: Sat, 11 Mar 2006 06:03:30 +0000 Subject: [PATCH 08/16] web commit from 66.118.98.137: --- doc/security.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/security.mdwn b/doc/security.mdwn index e25cc9ce9..7d7753bca 100644 --- a/doc/security.mdwn +++ b/doc/security.mdwn @@ -83,7 +83,7 @@ ikiwiki does not allow cgi scripts to be published as part of the wiki. Or rather, the script is published, but it's not marked executable, so hopefully your web server will not run it. -## --gen-wrapper might generate insecure wrappers +## suid wrappers ikiwiki --gen-wrapper is intended to generate a wrapper program that runs ikiwiki to update a given wiki. The wrapper can in turn be made suid, -- 2.39.5 From b35fee6c6d55ae47352c506129d3b9099163f5c4 Mon Sep 17 00:00:00 2001 From: www-data Date: Sat, 11 Mar 2006 06:03:44 +0000 Subject: [PATCH 09/16] web commit from 66.118.98.137: --- doc/security.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/security.mdwn b/doc/security.mdwn index 7d7753bca..42795b63e 100644 --- a/doc/security.mdwn +++ b/doc/security.mdwn @@ -85,7 +85,7 @@ hopefully your web server will not run it. ## suid wrappers -ikiwiki --gen-wrapper is intended to generate a wrapper program that +ikiwiki --wrapper is intended to generate a wrapper program that runs ikiwiki to update a given wiki. The wrapper can in turn be made suid, for example to be used in a [[post-commit]] hook by people who cannot write to the html pages, etc. -- 2.39.5 From 3065ec79ad7e90c3febd686ce372f1045f88b098 Mon Sep 17 00:00:00 2001 From: www-data Date: Sat, 11 Mar 2006 06:05:29 +0000 Subject: [PATCH 10/16] web commit from 66.118.98.137: --- doc/index.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/index.mdwn b/doc/index.mdwn index 418971caf..a60cdf76a 100644 --- a/doc/index.mdwn +++ b/doc/index.mdwn @@ -9,7 +9,7 @@ markup language. Instead it uses [[Subversion]] and [[MarkDown]]. * [[Setup]] has a tutorial for setting up ikiwki. -* [[TODO]] and bugs lists things that need to be added to ikiwiki before most people would consider it a full-fledged wiki. +* [[TODO]] and [[bugs]] lists things that need to be added to ikiwiki before most people would consider it a full-fledged wiki. * [[Security]] lists potential security problems. ikiwiki is still being developed, and is being written with security as a priority, don't expect things to stay in this list for long. -- 2.39.5 From 89d8b736e8dbe6bfff132a4135e020f24f8c9f1d Mon Sep 17 00:00:00 2001 From: www-data Date: Sat, 11 Mar 2006 06:06:37 +0000 Subject: [PATCH 11/16] web commit from 66.118.98.137: --- doc/bugs.mdwn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/bugs.mdwn b/doc/bugs.mdwn index e89c493a6..13bdc34e9 100644 --- a/doc/bugs.mdwn +++ b/doc/bugs.mdwn @@ -13,4 +13,6 @@ * Can't put the source in a directory named .source; the page finder skips that due to too broad exclusion of any dotfile in a path. * RecentChanges is a regular page, perhaps it should be automatically replaced with a link to the [[CGI]]? -* [[ikiwiki]] should go to the same place as [[index]] (on this wiki). \ No newline at end of file +* [[ikiwiki]] should go to the same place as [[index]] (on this wiki). +* There's no way to escape a [[WikiLink]] when discussing one on a wiki. +* Wikilinks are even expanded in the middle of [[MarkDown]] code blocks, and probably shouldn't be (nor in blockquotes?) \ No newline at end of file -- 2.39.5 From 4e87ea7ed1f495db1b323ed8075b48cf74253155 Mon Sep 17 00:00:00 2001 From: www-data Date: Sat, 11 Mar 2006 06:09:10 +0000 Subject: [PATCH 12/16] web commit from 66.118.98.137: --- doc/features.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/features.mdwn b/doc/features.mdwn index 8ba65fc55..0f2c57761 100644 --- a/doc/features.mdwn +++ b/doc/features.mdwn @@ -27,6 +27,14 @@ Currently implemented: Arbitrarily deep hierarchies of pages with fairly simple and useful [[SubPage/LinkingRUles]] +* Fast compiler + + ikiwiki is fast and smart about updating a wiki, it only builds pages that have changed (and tracks things like creation of new pages and links that can indirectly cause a page to need a rebuild) + +* [[BackLinks]] + + Automatically included on pages. Rather faster than eg [[MoinMoin]] and always there to help with navigation. + * [[RecentChanges]], editng pages in a web browser Nearly the definition of a wiki, although perhaps ikiwiki challenges how much of that web gunk a wiki really needs. These features are optional and can be enabled by enabling [[CGI]]. -- 2.39.5 From d430b23ba39338a15784ef98f1666369c66842cd Mon Sep 17 00:00:00 2001 From: www-data Date: Sat, 11 Mar 2006 06:09:52 +0000 Subject: [PATCH 13/16] web commit from 66.118.98.137: --- doc/wikilink.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/wikilink.mdwn b/doc/wikilink.mdwn index 7891add7c..03cb2b3c3 100644 --- a/doc/wikilink.mdwn +++ b/doc/wikilink.mdwn @@ -7,3 +7,5 @@ play when linking between [[SubPage]]s. WikiLinks can be entered in any case you like, the page they link to is always lowercased. + +Note that if the file linked to by a WikiLink looks like an image, it will be displayed inline on the page. \ No newline at end of file -- 2.39.5 From 113887b1571b5d716c5e1b31c13b448f5c1429d6 Mon Sep 17 00:00:00 2001 From: www-data Date: Sat, 11 Mar 2006 06:14:13 +0000 Subject: [PATCH 14/16] web commit from 66.118.98.137: --- doc/setup.mdwn | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/setup.mdwn b/doc/setup.mdwn index 3494fd016..d6cd7d8c4 100644 --- a/doc/setup.mdwn +++ b/doc/setup.mdwn @@ -58,8 +58,7 @@ optional support for commits from the web. ikiwiki $(/svn/wikirepo/hooks/post-commit --params) --rebuild ikiwiki $(/svn/wikirepo/hooks/post-commit --params) \ - --cgiurl=http://host/~you/wiki/ikiwiki.cgi \ - --wrapper + --cgiurl=http://host/~you/wiki/ikiwiki.cgi --wrapper mv ikiwiki-wrap /svn/wikirepo/hooks/post-commit Be sure to change the cgiurl to the actual url to the wiki.cgi you -- 2.39.5 From de0f43fa344252585c647c39ee990f7cef8b838a Mon Sep 17 00:00:00 2001 From: joey Date: Sat, 11 Mar 2006 06:27:09 +0000 Subject: [PATCH 15/16] history and folding --- ikiwiki | 137 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 73 insertions(+), 64 deletions(-) diff --git a/ikiwiki b/ikiwiki index 61fa4a713..4b50cb620 100755 --- a/ikiwiki +++ b/ikiwiki @@ -6,13 +6,12 @@ use File::Find; use Memoize; use File::Spec; -$ENV{PATH}="/usr/local/bin:/usr/bin:/bin"; - BEGIN { $blosxom::version="is a proper perl module too much to ask?"; do "/usr/bin/markdown"; } +$ENV{PATH}="/usr/local/bin:/usr/bin:/bin"; my ($srcdir, $destdir, %links, %oldlinks, %oldpagemtime, %renderedfiles, %pagesources); my $wiki_link_regexp=qr/\[\[([^\s]+)\]\]/; @@ -24,13 +23,14 @@ my $default_pagetype=".mdwn"; my $cgi=0; my $url=""; my $cgiurl=""; +my $historyurl=""; my $svn=1; -sub usage { +sub usage { #{{{ die "usage: ikiwiki [options] source dest\n"; -} +} #}}} -sub error ($) { +sub error ($) { #{{{ if ($cgi) { print "Content-type: text/html\n\n"; print "Error: @_\n"; @@ -39,39 +39,39 @@ sub error ($) { else { die @_; } -} +} #}}} -sub debug ($) { +sub debug ($) { #{{{ print "@_\n" if $verbose; -} +} #}}} -sub mtime ($) { +sub mtime ($) { #{{{ my $page=shift; return (stat($page))[9]; -} +} #}}} -sub possibly_foolish_untaint ($) { +sub possibly_foolish_untaint ($) { #{{{ my $tainted=shift; my ($untainted)=$tainted=~/(.*)/; return $untainted; -} +} #}}} -sub basename { +sub basename ($) { #{{{ my $file=shift; $file=~s!.*/!!; return $file; -} +} #}}} -sub dirname { +sub dirname ($) { #{{{ my $file=shift; $file=~s!/?[^/]+$!!; return $file; -} +} #}}} -sub pagetype ($) { +sub pagetype ($) { #{{{ my $page=shift; if ($page =~ /\.mdwn$/) { @@ -80,24 +80,24 @@ sub pagetype ($) { else { return "unknown"; } -} +} #}}} -sub pagename ($) { +sub pagename ($) { #{{{ my $file=shift; my $type=pagetype($file); my $page=$file; $page=~s/\Q$type\E*$// unless $type eq 'unknown'; return $page; -} +} #}}} -sub htmlpage ($) { +sub htmlpage ($) { #{{{ my $page=shift; return $page.".html"; -} +} #}}} -sub readfile ($) { +sub readfile ($) { #{{{ my $file=shift; local $/=undef; @@ -105,9 +105,9 @@ sub readfile ($) { my $ret=; close IN; return $ret; -} +} #}}} -sub writefile ($$) { +sub writefile ($$) { #{{{ my $file=shift; my $content=shift; @@ -125,9 +125,9 @@ sub writefile ($$) { open (OUT, ">$file") || error("failed to write $file: $!"); print OUT $content; close OUT; -} +} #}}} -sub findlinks { +sub findlinks { #{{{ my $content=shift; my @links; @@ -135,13 +135,13 @@ sub findlinks { push @links, lc($1); } return @links; -} +} #}}} # Given a page and the text of a link on the page, determine which existing # page that link best points to. Prefers pages under a subdirectory with # the same name as the source page, failing that goes down the directory tree # to the base looking for matching pages. -sub bestlink ($$) { +sub bestlink ($$) { #{{{ my $page=shift; my $link=lc(shift); @@ -159,15 +159,15 @@ sub bestlink ($$) { #print STDERR "warning: page $page, broken link: $link\n"; return ""; -} +} #}}} -sub isinlinableimage ($) { +sub isinlinableimage ($) { #{{{ my $file=shift; $file=~/\.(png|gif|jpg|jpeg)$/; -} +} #}}} -sub htmllink { +sub htmllink { #{{{ my $page=shift; my $link=shift; my $noimagelink=shift; @@ -193,18 +193,18 @@ sub htmllink { return ""; } return "$link"; -} +} #}}} -sub linkify ($$) { +sub linkify ($$) { #{{{ my $content=shift; my $file=shift; $content =~ s/$wiki_link_regexp/htmllink(pagename($file), $1)/eg; return $content; -} +} #}}} -sub htmlize ($$) { +sub htmlize ($$) { #{{{ my $type=shift; my $content=shift; @@ -214,9 +214,9 @@ sub htmlize ($$) { else { error("htmlization of $type not supported"); } -} +} #}}} -sub linkbacks ($$) { +sub linkbacks ($$) { #{{{ my $content=shift; my $page=shift; @@ -241,9 +241,9 @@ sub linkbacks ($$) { $content.="

Links: ".join(" ", sort @links)."

\n" if @links; return $content; -} +} #}}} -sub finalize ($$) { +sub finalize ($$) { #{{{ my $content=shift; my $page=shift; @@ -269,6 +269,11 @@ sub finalize ($$) { push @actions, "Edit"; push @actions, "RecentChanges"; } + if (length $historyurl) { + my $url=$historyurl; + $url=~s/\[\[\]\]/$page/g; + push @actions, "History"; + } $content="\n$title\n\n". "

$pagelink

\n". @@ -277,9 +282,9 @@ sub finalize ($$) { "\n\n"; return $content; -} +} #}}} -sub render ($) { +sub render ($) { #{{{ my $file=shift; my $type=pagetype($file); @@ -304,9 +309,9 @@ sub render ($) { $oldpagemtime{$file}=time; $renderedfiles{$file}=$file; } -} +} #}}} -sub loadindex () { +sub loadindex () { #{{{ open (IN, "$srcdir/.index") || return; while () { $_=possibly_foolish_untaint($_); @@ -320,9 +325,9 @@ sub loadindex () { $renderedfiles{$page}=$rendered; } close IN; -} +} #}}} -sub saveindex () { +sub saveindex () { #{{{ open (OUT, ">$srcdir/.index") || error("cannot write to .index: $!"); foreach my $page (keys %oldpagemtime) { print OUT "$oldpagemtime{$page} $pagesources{$page} $renderedfiles{$page} ". @@ -330,17 +335,17 @@ sub saveindex () { if $oldpagemtime{$page}; } close OUT; -} +} #}}} -sub rcs_update () { +sub rcs_update () { #{{{ if (-d "$srcdir/.svn") { if (system("svn", "update", "--quiet", $srcdir) != 0) { warn("svn update failed\n"); } } -} +} #}}} -sub rcs_commit ($) { +sub rcs_commit ($) { #{{{ my $message=shift; if (-d "$srcdir/.svn") { @@ -349,9 +354,9 @@ sub rcs_commit ($) { warn("svn commit failed\n"); } } -} +} #}}} -sub rcs_add ($) { +sub rcs_add ($) { #{{{ my $file=shift; if (-d "$srcdir/.svn") { @@ -365,9 +370,9 @@ sub rcs_add ($) { warn("svn add failed\n"); } } -} +} #}}} -sub rcs_recentchanges ($) { +sub rcs_recentchanges ($) { #{{{ my $num=shift; my @ret; @@ -419,9 +424,9 @@ sub rcs_recentchanges ($) { } return @ret; -} +} #}}} -sub prune ($) { +sub prune ($) { #{{{ my $file=shift; unlink($file); @@ -429,9 +434,9 @@ sub prune ($) { while (rmdir($dir)) { $dir=dirname($dir); } -} +} #}}} -sub refresh () { +sub refresh () { #{{{ # Find existing pages. my %exists; my @files; @@ -552,11 +557,11 @@ FILE: foreach my $file (@files) { } } } -} +} #}}} # Generates a C wrapper program for running ikiwiki in a specific way. # The wrapper may be safely made suid. -sub gen_wrapper ($$) { +sub gen_wrapper ($$) { #{{{ my ($svn, $rebuild)=@_; eval q{use Cwd 'abs_path'}; @@ -574,6 +579,7 @@ sub gen_wrapper ($$) { push @params, "--cgi" if $cgi; push @params, "--url=$url" if $url; push @params, "--cgiurl=$cgiurl" if $cgiurl; + push @params, "--historyurl=$historyurl" if $historyurl; my $params=join(" ", @params); my $call=''; foreach my $p ($this, $this, @params) { @@ -630,9 +636,9 @@ EOF unlink("ikiwiki-wrap.c"); print "successfully generated ikiwiki-wrap\n"; exit 0; -} +} #}}} -sub cgi () { +sub cgi () { #{{{ eval q{use CGI}; my $q=CGI->new; @@ -779,8 +785,9 @@ sub cgi () { else { error("unknown do parameter"); } -} +} #}}} +# main {{{ my $rebuild=0; my $wrapper=0; if (grep /^-/, @ARGV) { @@ -794,6 +801,7 @@ if (grep /^-/, @ARGV) { "cgi" => \$cgi, "url=s" => \$url, "cgiurl=s" => \$cgiurl, + "historyurl=s" => \$historyurl, ) || usage(); } usage() unless @ARGV == 2; @@ -816,3 +824,4 @@ else { refresh(); saveindex(); } +#}}} -- 2.39.5 From 7459d69d478aa4686245da5c59fce034317307ce Mon Sep 17 00:00:00 2001 From: joey Date: Sat, 11 Mar 2006 06:30:54 +0000 Subject: [PATCH 16/16] foo --- ikiwiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ikiwiki b/ikiwiki index 4b50cb620..daf9c6d90 100755 --- a/ikiwiki +++ b/ikiwiki @@ -271,7 +271,7 @@ sub finalize ($$) { #{{{ } if (length $historyurl) { my $url=$historyurl; - $url=~s/\[\[\]\]/$page/g; + $url=~s/\[\[\]\]/$pagesources{$page}/g; push @actions, "History"; } -- 2.39.5