From ecf2399f4fd2a515f4f5d6f0040024097a284343 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 6 Nov 2008 16:05:10 -0500 Subject: aggregate: Try to query XML::Feed for the base url when derelevatising links. Since this needs the just released XML::Feed 0.3, as well as a not yet released XML::RSS, it will fall back to the old method if no xml:base info is available. --- debian/changelog | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index d04e5ee25..cd8ecba7c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +ikiwiki (2.69) UNRELEASED; urgency=low + + * aggregate: Try to query XML::Feed for the base url when derelevatising + links. Since this needs the just released XML::Feed 0.3, as well + as a not yet released XML::RSS, it will fall back to the old method + if no xml:base info is available. + + -- Joey Hess Thu, 06 Nov 2008 16:01:00 -0500 + ikiwiki (2.68) unstable; urgency=low * Add support for checking pushes from untrusted git committers. This can be -- cgit v1.2.3 From db5ea4d4f01d7706c5397101ec860f8a471c1c55 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 6 Nov 2008 16:08:11 -0500 Subject: meta: Plugin is now enabled by default since the basewiki uses it. --- IkiWiki.pm | 2 +- IkiWiki/Plugin/goodstuff.pm | 1 - debian/changelog | 1 + ...asewiki_uses_meta_directives_but_meta_is_not_enabled_by_default.mdwn | 2 ++ doc/plugins/goodstuff.mdwn | 1 - doc/plugins/meta.mdwn | 2 +- 6 files changed, 5 insertions(+), 4 deletions(-) (limited to 'debian') diff --git a/IkiWiki.pm b/IkiWiki.pm index bab7b707a..91d2e6082 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -120,7 +120,7 @@ sub getsetup () { #{{{ }, default_plugins => { type => "internal", - default => [qw{mdwn link inline htmlscrubber passwordauth + default => [qw{mdwn link inline meta htmlscrubber passwordauth openid signinedit lockedit conditional recentchanges parentlinks editpage}], description => "plugins to enable by default", diff --git a/IkiWiki/Plugin/goodstuff.pm b/IkiWiki/Plugin/goodstuff.pm index ed1f4ddfc..a18e626d4 100644 --- a/IkiWiki/Plugin/goodstuff.pm +++ b/IkiWiki/Plugin/goodstuff.pm @@ -10,7 +10,6 @@ my @bundle=qw{ brokenlinks img map - meta more orphans pagecount diff --git a/debian/changelog b/debian/changelog index cd8ecba7c..a197369cc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ ikiwiki (2.69) UNRELEASED; urgency=low links. Since this needs the just released XML::Feed 0.3, as well as a not yet released XML::RSS, it will fall back to the old method if no xml:base info is available. + * meta: Plugin is now enabled by default since the basewiki uses it. -- Joey Hess Thu, 06 Nov 2008 16:01:00 -0500 diff --git a/doc/bugs/basewiki_uses_meta_directives_but_meta_is_not_enabled_by_default.mdwn b/doc/bugs/basewiki_uses_meta_directives_but_meta_is_not_enabled_by_default.mdwn index a90227b7a..62931d8bc 100644 --- a/doc/bugs/basewiki_uses_meta_directives_but_meta_is_not_enabled_by_default.mdwn +++ b/doc/bugs/basewiki_uses_meta_directives_but_meta_is_not_enabled_by_default.mdwn @@ -1,3 +1,5 @@ [[plugins/meta]] is not enabled by default, yet some pages in the default basewiki include [[the_meta_directive|ikiwiki/directive/meta]], notably the [[ikiwiki]] heirarchy. This means that the default output of "ikiwiki src dest", for two empty directories src and dest, result in the meta directive being displayed inline with the page text. + +> [[done]], meta now enabled by default. diff --git a/doc/plugins/goodstuff.mdwn b/doc/plugins/goodstuff.mdwn index 83b60f4fa..ed57c0f01 100644 --- a/doc/plugins/goodstuff.mdwn +++ b/doc/plugins/goodstuff.mdwn @@ -12,7 +12,6 @@ Currently included: * [[brokenlinks]] * [[img]] * [[map]] -* [[meta]] * [[more]] * [[orphans]] * [[pagecount]] diff --git a/doc/plugins/meta.mdwn b/doc/plugins/meta.mdwn index afd554993..e49bdcc50 100644 --- a/doc/plugins/meta.mdwn +++ b/doc/plugins/meta.mdwn @@ -1,4 +1,4 @@ -[[!template id=plugin name=meta author="[[Joey]]"]] +[[!template id=plugin name=meta core=1 author="[[Joey]]"]] [[!tag type/meta]] This plugin provides the [[ikiwiki/directive/meta]] [[ikiwiki/directive]], -- cgit v1.2.3 From 11d377af816b30eba336fae2993a79362443c293 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 6 Nov 2008 20:49:18 -0500 Subject: txt: Do not encode quotes when filtering the txt, as that broke later parsing of any directives on the page. --- IkiWiki/Plugin/txt.pm | 2 +- debian/changelog | 2 ++ doc/bugs/txt_plugin_having_problems_with_meta_directives.mdwn | 2 ++ docwiki.setup | 2 +- po/ikiwiki.pot | 4 ++-- 5 files changed, 8 insertions(+), 4 deletions(-) (limited to 'debian') diff --git a/IkiWiki/Plugin/txt.pm b/IkiWiki/Plugin/txt.pm index e4c9e5d6a..e157bf07e 100644 --- a/IkiWiki/Plugin/txt.pm +++ b/IkiWiki/Plugin/txt.pm @@ -39,7 +39,7 @@ sub filter (@) { my $content = $params{content}; if (defined $pagesources{$params{page}} && $pagesources{$params{page}} =~ /\.txt$/) { - encode_entities($content); + encode_entities($content, "<>&"); if ($findurl) { my $finder = URI::Find->new(sub { my ($uri, $orig_uri) = @_; diff --git a/debian/changelog b/debian/changelog index a197369cc..424c99ac4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ ikiwiki (2.69) UNRELEASED; urgency=low as a not yet released XML::RSS, it will fall back to the old method if no xml:base info is available. * meta: Plugin is now enabled by default since the basewiki uses it. + * txt: Do not encode quotes when filtering the txt, as that broke + later parsing of any directives on the page. -- Joey Hess Thu, 06 Nov 2008 16:01:00 -0500 diff --git a/doc/bugs/txt_plugin_having_problems_with_meta_directives.mdwn b/doc/bugs/txt_plugin_having_problems_with_meta_directives.mdwn index d2d5a46ed..22224483e 100644 --- a/doc/bugs/txt_plugin_having_problems_with_meta_directives.mdwn +++ b/doc/bugs/txt_plugin_having_problems_with_meta_directives.mdwn @@ -15,3 +15,5 @@ Here is the header: [[GNU_Free_Documentation_License|/fdl]]."]]"""]] --[[tschwinge]] + +> [[done]], made it less zealous about encoding html entities. --[[Joey]] diff --git a/docwiki.setup b/docwiki.setup index 6d732fd6b..bb9616d04 100644 --- a/docwiki.setup +++ b/docwiki.setup @@ -15,5 +15,5 @@ use IkiWiki::Setup::Standard { userdir => "users", usedirs => 0, prefix_directives => 1, - add_plugins => [qw{goodstuff version haiku polygen fortune}], + add_plugins => [qw{goodstuff version haiku polygen fortune txt}], } diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index 5db0c51af..6894dd2f6 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-11-03 16:31-0500\n" +"POT-Creation-Date: 2008-11-06 20:47-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -120,7 +120,7 @@ msgstr "" msgid "feed crashed XML::Feed!" msgstr "" -#: ../IkiWiki/Plugin/aggregate.pm:590 +#: ../IkiWiki/Plugin/aggregate.pm:591 #, perl-format msgid "creating new page %s" msgstr "" -- cgit v1.2.3 From 7f80e52543891690e3136855bc29917e6b431aba Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 9 Nov 2008 15:31:57 -0500 Subject: Fix the link() pagespec to match links that are internally recorded as absolute. This fixes a problem exposed by the recent change to tags (a2839de9362187b67b0e3a564461e272e64fd9b4). That recorded tag links as absolute by including a leading slash in the link. The same could also be done with an absolute wikilink. In either case, link() would not match such links, unless the leading slash was included in the link to match. But that's not right, because pagespecs match absolute by default. So strip the leading slash. Note that to keep any existing `link(/foo)` pagespecs working after this change, the leading slash is removed from there, too. --- IkiWiki.pm | 4 ++++ debian/changelog | 2 ++ t/pagespec_match.t | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/IkiWiki.pm b/IkiWiki.pm index 1aaa4d33c..dc9b66344 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1901,6 +1901,10 @@ sub match_link ($$;@) { #{{{ else { return IkiWiki::SuccessReason->new("$page links to page $p matching $link") if match_glob($p, $link, %params); + $p=~s/^\///; + $link=~s/^\///; + return IkiWiki::SuccessReason->new("$page links to page $p matching $link") + if match_glob($p, $link, %params); } } return IkiWiki::FailReason->new("$page does not link to $link"); diff --git a/debian/changelog b/debian/changelog index 424c99ac4..6c068806c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,8 @@ ikiwiki (2.69) UNRELEASED; urgency=low * meta: Plugin is now enabled by default since the basewiki uses it. * txt: Do not encode quotes when filtering the txt, as that broke later parsing of any directives on the page. + * Fix the link() pagespec to match links that are internally recorded as + absolute. -- Joey Hess Thu, 06 Nov 2008 16:01:00 -0500 diff --git a/t/pagespec_match.t b/t/pagespec_match.t index c61d16122..7c0ac235b 100755 --- a/t/pagespec_match.t +++ b/t/pagespec_match.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use warnings; use strict; -use Test::More tests => 56; +use Test::More tests => 58; BEGIN { use_ok("IkiWiki"); } @@ -40,6 +40,7 @@ $links{"bugs/bar"}=[qw{done}]; $links{"done"}=[]; $links{"examples/softwaresite/bugs/fails_to_frobnicate"}=[qw{done}]; $links{"examples/softwaresite/bugs/done"}=[]; +$links{"ook"}=[qw{/blog/tags/foo}]; ok(pagespec_match("foo", "link(bar)"), "link"); ok(pagespec_match("foo", "link(ba?)"), "glob link"); @@ -55,6 +56,8 @@ ok(pagespec_match("bar", "backlink(foo)"), "backlink"); ok(! pagespec_match("quux", "backlink(foo)"), "failed backlink"); ok(! pagespec_match("bar", ""), "empty pagespec should match nothing"); ok(! pagespec_match("bar", " "), "blank pagespec should match nothing"); +ok(pagespec_match("ook", "link(blog/tags/foo)"), "link internal absolute success"); +ok(pagespec_match("ook", "link(/blog/tags/foo)"), "link explicit absolute success"); $IkiWiki::pagectime{foo}=1154532692; # Wed Aug 2 11:26 EDT 2006 $IkiWiki::pagectime{bar}=1154532695; # after -- cgit v1.2.3 From f0e58faefab108482e88f62db64ea6d654327d25 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 10 Nov 2008 18:05:30 -0500 Subject: Add rel=nofollow to recentchanges_links for the same (weak) reasons it was earlier added to edit links. --- IkiWiki/Plugin/recentchanges.pm | 2 +- debian/changelog | 2 ++ templates/change.tmpl | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/IkiWiki/Plugin/recentchanges.pm b/IkiWiki/Plugin/recentchanges.pm index a73ff37b9..3f70664ac 100644 --- a/IkiWiki/Plugin/recentchanges.pm +++ b/IkiWiki/Plugin/recentchanges.pm @@ -131,7 +131,7 @@ sub store ($$$) { #{{{ do => "recentchanges_link", page => $_->{page} ). - "\">". + "\" rel=\"nofollow\">". pagetitle($_->{page}). "" } diff --git a/debian/changelog b/debian/changelog index 6c068806c..566dd1954 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,8 @@ ikiwiki (2.69) UNRELEASED; urgency=low later parsing of any directives on the page. * Fix the link() pagespec to match links that are internally recorded as absolute. + * Add rel=nofollow to recentchanges_links for the same (weak) reasons it + was earlier added to edit links. -- Joey Hess Thu, 06 Nov 2008 16:01:00 -0500 diff --git a/templates/change.tmpl b/templates/change.tmpl index 61a54fded..0aebae61e 100644 --- a/templates/change.tmpl +++ b/templates/change.tmpl @@ -19,7 +19,7 @@
Changed by:
- + -- cgit v1.2.3 From f8a09ba105e0b58ec59fe4cd8d92a1577cce14d2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 10 Nov 2008 19:48:58 -0500 Subject: tag: Normalize tagbase so leading/trailing slashes in it don't break things. --- IkiWiki/Plugin/tag.pm | 1 + debian/changelog | 2 ++ 2 files changed, 3 insertions(+) (limited to 'debian') diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index c4a175677..7977bbcf5 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -44,6 +44,7 @@ sub tagpage ($) { #{{{ if ($tag !~ m{^\.?/} && defined $config{tagbase}) { $tag="/".$config{tagbase}."/".$tag; + $tag=~y#/#/#s; # squash dups } return $tag; diff --git a/debian/changelog b/debian/changelog index 566dd1954..c97647948 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,8 @@ ikiwiki (2.69) UNRELEASED; urgency=low absolute. * Add rel=nofollow to recentchanges_links for the same (weak) reasons it was earlier added to edit links. + * tag: Normalize tagbase so leading/trailing slashes in it don't break + things. -- Joey Hess Thu, 06 Nov 2008 16:01:00 -0500 -- cgit v1.2.3 From 6049fac46e65d60681366b4324660a6854fd029c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 10 Nov 2008 21:43:59 -0500 Subject: typo --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index c97647948..cc277beb3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -46,8 +46,8 @@ ikiwiki (2.68) unstable; urgency=low * inline: Only the last feed link was put on the page, fix this to include all feed links. So rss will be included along with atom, and pages with multiple feeds will get links added for all feeds. - * tag: When tagpage is set, force the links created by tagging to point at - the toplevel tagpage, and not closer subpages. The html links already went + * tag: When tagbase is set, force the links created by tagging to point at + the toplevel tagbase, and not closer subpages. The html links already went there, but internally the links were not recorded as absolute, which could cause confusing backlinks etc. * Add an inject function, that can be used by plugins that want to -- cgit v1.2.3 From 6611f3a2d9eda262a07bb506b204e8bbf0728c38 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 11 Nov 2008 13:44:39 -0500 Subject: bzr: Fix dates for recentchanges. --- IkiWiki/Plugin/bzr.pm | 2 +- debian/changelog | 1 + doc/bugs/bzr_RecentChanges_dates_start_from_1969.mdwn | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'debian') diff --git a/IkiWiki/Plugin/bzr.pm b/IkiWiki/Plugin/bzr.pm index 101e91b93..1054f5b3e 100644 --- a/IkiWiki/Plugin/bzr.pm +++ b/IkiWiki/Plugin/bzr.pm @@ -246,7 +246,7 @@ sub rcs_recentchanges ($) { #{{{ rev => $info->{"revno"}, user => $user, committype => "bzr", - when => time - str2time($info->{"timestamp"}), + when => str2time($info->{"timestamp"}), message => [@message], pages => [@pages], }; diff --git a/debian/changelog b/debian/changelog index cc277beb3..dfc5de2d4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,7 @@ ikiwiki (2.69) UNRELEASED; urgency=low was earlier added to edit links. * tag: Normalize tagbase so leading/trailing slashes in it don't break things. + * bzr: Fix dates for recentchanges. -- Joey Hess Thu, 06 Nov 2008 16:01:00 -0500 diff --git a/doc/bugs/bzr_RecentChanges_dates_start_from_1969.mdwn b/doc/bugs/bzr_RecentChanges_dates_start_from_1969.mdwn index 5c3d1bbd2..fa6e45b47 100644 --- a/doc/bugs/bzr_RecentChanges_dates_start_from_1969.mdwn +++ b/doc/bugs/bzr_RecentChanges_dates_start_from_1969.mdwn @@ -10,3 +10,7 @@ to ` when => str2time($info->{"timestamp"}),` fixed this for me. + +> Weird, I wonder why it was written to return an absolute time like that +> in the first place? Can't have ever been right. Fixed, thanks. --[[Joey]] +> [[done]] -- cgit v1.2.3 From d1b22b252481134815b1d02d564b6b9622fe7b4b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 11 Nov 2008 15:54:52 -0500 Subject: lockwiki changes * Stop busy-waiting in lockwiki, as this could delay ikiwiki from waking up for up to one second. The bailout code is no longer needed. * Remove support for unused optional wait parameter from lockwiki. --- IkiWiki.pm | 19 +++---------------- debian/changelog | 8 ++++++++ doc/todo/avoid_thrashing.mdwn | 2 ++ po/ikiwiki.pot | 10 +++++----- 4 files changed, 18 insertions(+), 21 deletions(-) (limited to 'debian') diff --git a/IkiWiki.pm b/IkiWiki.pm index dc9b66344..d949566d8 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -1280,8 +1280,7 @@ sub indexlink () { #{{{ my $wikilock; -sub lockwiki (;$) { #{{{ - my $wait=@_ ? shift : 1; +sub lockwiki () { #{{{ # Take an exclusive lock on the wiki to prevent multiple concurrent # run issues. The lock will be dropped on program exit. if (! -d $config{wikistatedir}) { @@ -1289,20 +1288,8 @@ sub lockwiki (;$) { #{{{ } open($wikilock, '>', "$config{wikistatedir}/lockfile") || error ("cannot write to $config{wikistatedir}/lockfile: $!"); - if (! flock($wikilock, 2 | 4)) { # LOCK_EX | LOCK_NB - if ($wait) { - debug("wiki seems to be locked, waiting for lock"); - my $wait=600; # arbitrary, but don't hang forever to - # prevent process pileup - for (1..$wait) { - return if flock($wikilock, 2 | 4); - sleep 1; - } - error("wiki is locked; waited $wait seconds without lock being freed (possible stuck process or stale lock?)"); - } - else { - return 0; - } + if (! flock($wikilock, 2)) { # LOCK_EX + error("failed to get lock"); } return 1; } #}}} diff --git a/debian/changelog b/debian/changelog index dfc5de2d4..2088b07ec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,14 @@ ikiwiki (2.69) UNRELEASED; urgency=low * tag: Normalize tagbase so leading/trailing slashes in it don't break things. * bzr: Fix dates for recentchanges. + * Avoid multiple ikiwiki cgi processes piling up, eating all memory, + and thrashing, by making the cgi wrapper wait on a cgilock. + If you had to set apache's MaxClients low to avoid ikiwiki thrashing your + server, you can now turn it up to a high value. + * Stop busy-waiting in lockwiki, as this could delay ikiwiki from waking up + for up to one second. The bailout code is no longer needed after above + change. + * Remove support for unused optional wait parameter from lockwiki. -- Joey Hess Thu, 06 Nov 2008 16:01:00 -0500 diff --git a/doc/todo/avoid_thrashing.mdwn b/doc/todo/avoid_thrashing.mdwn index 6c895e7c9..45b11d872 100644 --- a/doc/todo/avoid_thrashing.mdwn +++ b/doc/todo/avoid_thrashing.mdwn @@ -18,3 +18,5 @@ with no ill effects. Crank `MaxClients` up to 256? No problem.. And there's no real reason to allow more than one ikiwiki cgi to run at a time. Since almost all uses of the CGI lock the index, only one can really be doing anything at a time. --[[Joey]] + +[[done]] diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index 34fa5e65b..8cf3853e0 100644 --- a/po/ikiwiki.pot +++ b/po/ikiwiki.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2008-11-07 12:23-0500\n" +"POT-Creation-Date: 2008-11-11 15:36-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -910,19 +910,19 @@ msgstr "" #. translators: The first parameter is a filename, and the second is #. translators: a (probably not translated) error message. -#: ../IkiWiki/Wrapper.pm:79 +#: ../IkiWiki/Wrapper.pm:93 #, perl-format msgid "failed to write %s: %s" msgstr "" #. translators: The parameter is a C filename. -#: ../IkiWiki/Wrapper.pm:135 +#: ../IkiWiki/Wrapper.pm:150 #, perl-format msgid "failed to compile %s" msgstr "" #. translators: The parameter is a filename. -#: ../IkiWiki/Wrapper.pm:155 +#: ../IkiWiki/Wrapper.pm:170 #, perl-format msgid "successfully generated %s" msgstr "" @@ -969,7 +969,7 @@ msgstr "" msgid "preprocessing loop detected on %s at depth %i" msgstr "" -#: ../IkiWiki.pm:1685 +#: ../IkiWiki.pm:1672 msgid "yes" msgstr "" -- cgit v1.2.3