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. --- IkiWiki/Plugin/aggregate.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index 2e4c86f24..c9c2880c5 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -520,10 +520,10 @@ sub aggregate (@) { #{{{ } foreach my $entry ($f->entries) { - my $content=$content=$entry->content->body; + my $c=$entry->content; # atom feeds may have no content, only a summary - if (! defined $content && ref $entry->summary) { - $content=$entry->summary->body; + if (! defined $c && ref $entry->summary) { + $c=$entry->summary; } add_page( @@ -531,9 +531,10 @@ sub aggregate (@) { #{{{ copyright => $f->copyright, title => defined $entry->title ? decode_entities($entry->title) : "untitled", link => $entry->link, - content => defined $content ? $content : "", + content => defined $c ? $c->body : "", guid => defined $entry->id ? $entry->id : time."_".$feed->{name}, ctime => $entry->issued ? ($entry->issued->epoch || time) : time, + base => (defined $c && $c->can("base")) ? $c->base : undef, ); } } @@ -605,7 +606,8 @@ sub add_page (@) { #{{{ my $template=template($feed->{template}, blind_cache => 1); $template->param(title => $params{title}) if defined $params{title} && length($params{title}); - $template->param(content => htmlescape(htmlabs($params{content}, $feed->{feedurl}))); + $template->param(content => htmlescape(htmlabs($params{content}, + defined $params{base} ? $params{base} : $feed->{feedurl}))); $template->param(name => $feed->{name}); $template->param(url => $feed->{url}); $template->param(copyright => $params{copyright}) -- 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 'IkiWiki') 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 'IkiWiki') 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 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 'IkiWiki') 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 'IkiWiki') 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 53752bcb5d17ec51901ec926208793f9450b3243 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 10 Nov 2008 21:47:29 -0500 Subject: remove redundant link munge This is not needed now that tagpage returns a page name starting with a slash. (Also fixes a minor bug that the edit links started with double slashes due to the hack.) --- IkiWiki/Plugin/tag.pm | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index 7977bbcf5..d725ef9b3 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -56,13 +56,7 @@ sub taglink ($$$;@) { #{{{ my $tag=shift; my %opts=@_; - my $link=tagpage($tag); - - # Force tag creation links to create the tag under /tagbase, - # if there is a tagbase and this tag used it. - $link="/".$link if $tag ne $link; - - return htmllink($page, $destpage, $link, %opts); + return htmllink($page, $destpage, tagpage($tag), %opts); } #}}} sub preprocess_tag (@) { #{{{ -- 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 'IkiWiki') 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 9a48669f1e9d83422781f6f175c3be8bce80cd26 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 11 Nov 2008 15:40:04 -0500 Subject: avoid multiple ikiwiki cgi processes piling up, eating all memory, and thrashing Fixed 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. The downside to this is that a cgi call that doesn't need to call lockwiki will be serialised by this so only one can run at a time. (For example, do=search.) There are few such calls, and all of them call loadindex, so each still eats gobs of memory, so serialising them still seems ok. --- IkiWiki/Wrapper.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm index 99237d3b5..d7d7f65b8 100644 --- a/IkiWiki/Wrapper.pm +++ b/IkiWiki/Wrapper.pm @@ -44,6 +44,7 @@ EOF } my $check_commit_hook=""; + my $pre_exec=""; if ($config{post_commit}) { # Optimise checking !commit_hook_enabled() , # so that ikiwiki does not have to be started if the @@ -67,6 +68,19 @@ EOF } EOF } + elsif ($config{cgi}) { + # Avoid more than one ikiwiki cgi running at a time by + # taking a cgi lock. Since ikiwiki uses several MB of + # memory, a pile up of processes could cause thrashing + # otherwise. + $pre_exec=<<"EOF"; + { + int fd=open("$config{wikistatedir}/cgilock", O_CREAT | O_RDWR); + if (fd != -1) + flock(fd, LOCK_EX); + } +EOF + } $Data::Dumper::Indent=0; # no newlines my $configstring=Data::Dumper->Dump([\%config], ['*config']); @@ -122,6 +136,7 @@ $envsave exit(1); } +$pre_exec execl("$this", "$this", NULL); perror("exec $this"); exit(1); -- cgit v1.2.3 From eef8b966b366a11b69248d16f4f283d0dfbe3023 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 11 Nov 2008 15:53:55 -0500 Subject: O_CREATE needs mode --- IkiWiki/Wrapper.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'IkiWiki') diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm index d7d7f65b8..7a2d4381a 100644 --- a/IkiWiki/Wrapper.pm +++ b/IkiWiki/Wrapper.pm @@ -59,7 +59,7 @@ EOF # the benefit of this optimisation. $check_commit_hook=<<"EOF"; { - int fd=open("$config{wikistatedir}/commitlock", O_CREAT | O_RDWR); + int fd=open("$config{wikistatedir}/commitlock", O_CREAT | O_RDWR, 0666); if (fd != -1) { if (flock(fd, LOCK_SH | LOCK_NB) != 0) exit(0); @@ -75,7 +75,7 @@ EOF # otherwise. $pre_exec=<<"EOF"; { - int fd=open("$config{wikistatedir}/cgilock", O_CREAT | O_RDWR); + int fd=open("$config{wikistatedir}/cgilock", O_CREAT | O_RDWR, 0666); if (fd != -1) flock(fd, LOCK_EX); } -- cgit v1.2.3