From a149d54fbf110000b3980bba87cac0e86dd03e07 Mon Sep 17 00:00:00 2001 From: "http://eric.shared.dre.am/" Date: Fri, 4 Sep 2009 19:17:14 -0400 Subject: [PATCH 01/26] --- ...k_target_search_all_paths_as_fallback.mdwn | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 doc/todo/make_link_target_search_all_paths_as_fallback.mdwn diff --git a/doc/todo/make_link_target_search_all_paths_as_fallback.mdwn b/doc/todo/make_link_target_search_all_paths_as_fallback.mdwn new file mode 100644 index 000000000..f971fd8e0 --- /dev/null +++ b/doc/todo/make_link_target_search_all_paths_as_fallback.mdwn @@ -0,0 +1,27 @@ +[[!tag wishlist]] + +## Idea + +After searching from the most local to the root for a wikilinkable page, descend into the tree of pages looking for a matching page. + +For example, if I link to \[\[Pastrami\]\] from /users/eric, the current behavior is to look for + + * /users/eric/pastrami + * /users/pastrami + * /users/eric/pastrami + +I'd like it to find /sandwiches/pastrami. + +## Issues + +I know this is a tougher problem, especially to scale efficiently. There is also not a clear ordering unless it is the recursive dictionary ordering (ie the order of a breadth-first search with natural ordering). It would probably require some sort of static lookup table keyed by pagename and yielding a path. This could be generated initially by a breadth-first search and then updated incrementally when pages are added/removed/renamed. In some ways a global might not be ideal, since one might argue that the link above should match /users/eric/sandwiches/pastrami before /sandwiches/pastrami. I guess you could put all matching paths in the lookup table and then evaluate the ordering at parse-time. + +## Motivation + +Since I often access my documents using a text editor, I find it useful to keep them ordered in a heirarchy, about 3 levels deep with a branching factor of perhaps 10. When linking though, I'd like the wiki to find the document for me, since I am lazy. + +Also, many of my wiki pages comprise the canonical local representation of some unique entity, for example I might have /software/ikiwiki. The nesting, however, is only to aid navigation, and shouldn't be considered as part of resource's name. + +## Alternatives + +If an alias could be specified in the page body (for example, /ikiwiki for /software/ikiwiki) which would then stand in for a regular page when searching, then the navigational convenience of folders could be preserved while selectively flattening the search namespace. From 507d8ace625317072bfed7925b516fe3c573a568 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 6 Sep 2009 13:26:42 -0400 Subject: [PATCH 02/26] thoughts on translating the templates files --- doc/todo/l10n.mdwn | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/doc/todo/l10n.mdwn b/doc/todo/l10n.mdwn index fed3f63b6..a539f0424 100644 --- a/doc/todo/l10n.mdwn +++ b/doc/todo/l10n.mdwn @@ -14,6 +14,8 @@ and there is a po/ikiwiki.pot in the source that can be translated. ---- +## template i18n + From [[Recai]]: > Here is my initial work on ikiwiki l10n infrastructure (I'm sending it > before finalizing, there may be errors). @@ -64,9 +66,19 @@ Birisi[1], ki muhtemelen bu sizsiniz, [2] üzerindeki bulundu. Parola: -- ikiwiki [1] Parolayı isteyen kullanıcının ait IP adresi: [2] -> Looks like, tmpl_process3 cannot preserve line breaks in template files. -> For example, it processed the following template: - This could be easily worked around in tmpl_process3, but I wouldn't like to maintain a separate utility. +---- + +Another way to approach this would be to write a small program that outputs +the current set of templates. Now i18n of that program is trivial, +and it can be run once per language to generate localized templates. + +Then it's just a matter of installing the templates somewhere, and having +them be used when a different language is enabled. + +It would make sense to make the existing `locale` setting control which +templates are used. But the [[plugins/po]] plugin would probably want to do +something more, and use the actual language the page is written in. +--[[Joey]] From 8691bc006e16f17450423ef793f1e1a2626e2fe8 Mon Sep 17 00:00:00 2001 From: "http://hendry.iki.fi/" Date: Mon, 7 Sep 2009 05:53:50 -0400 Subject: [PATCH 03/26] Can't markup [[!table Error: ]] --- doc/plugins/table.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/plugins/table.mdwn b/doc/plugins/table.mdwn index 7b080acda..eb19323e6 100644 --- a/doc/plugins/table.mdwn +++ b/doc/plugins/table.mdwn @@ -6,3 +6,5 @@ It can build HTML tables from data in CSV (comma-separated values) or DSV (delimiter-separated values) format. It needs the perl module [[!cpan Text::CSV]] for the CSV data. + +If you see `[[!table\ Error: ]]` you probably need to `sudo apt-get install libtext-csv-perl`. From e95386504500492b55b9e00937f896334b13e240 Mon Sep 17 00:00:00 2001 From: "http://schmonz.livejournal.com/" Date: Mon, 7 Sep 2009 12:51:56 -0400 Subject: [PATCH 04/26] revert previous; with pkgsrc you'd need textproc/p5-Text-CSV, but let's not proliferate that sort of thing here --- doc/plugins/table.mdwn | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/plugins/table.mdwn b/doc/plugins/table.mdwn index eb19323e6..7b080acda 100644 --- a/doc/plugins/table.mdwn +++ b/doc/plugins/table.mdwn @@ -6,5 +6,3 @@ It can build HTML tables from data in CSV (comma-separated values) or DSV (delimiter-separated values) format. It needs the perl module [[!cpan Text::CSV]] for the CSV data. - -If you see `[[!table\ Error: ]]` you probably need to `sudo apt-get install libtext-csv-perl`. From ca329047207dd17c984ee975d51bcec7d079ff26 Mon Sep 17 00:00:00 2001 From: "http://schmonz.livejournal.com/" Date: Mon, 7 Sep 2009 12:54:24 -0400 Subject: [PATCH 05/26] move apt-get comment here --- doc/plugins/table/discussion.mdwn | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/plugins/table/discussion.mdwn b/doc/plugins/table/discussion.mdwn index 16e5a5a56..99c7e059b 100644 --- a/doc/plugins/table/discussion.mdwn +++ b/doc/plugins/table/discussion.mdwn @@ -64,3 +64,7 @@ Do you like it? Can you implement the same in Ikiwiki? :) --[[Paweł|ptecza]] >> was written rather for simple usage. However cell alignment is very >> helpful feature, so I think the plugin should be able to do it. >> --[[Paweł|ptecza]] + +----- + +If you see `[[!table\ Error: ]]` you probably need to `sudo apt-get install libtext-csv-perl`. From 3813632a8fe8940622f9cb40d94dbbab7e3f4194 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 7 Sep 2009 13:47:34 -0400 Subject: [PATCH 06/26] comment --- doc/plugins/table/discussion.mdwn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/plugins/table/discussion.mdwn b/doc/plugins/table/discussion.mdwn index 99c7e059b..86572c935 100644 --- a/doc/plugins/table/discussion.mdwn +++ b/doc/plugins/table/discussion.mdwn @@ -68,3 +68,6 @@ Do you like it? Can you implement the same in Ikiwiki? :) --[[Paweł|ptecza]] ----- If you see `[[!table\ Error: ]]` you probably need to `sudo apt-get install libtext-csv-perl`. + +> Perhaps more helpfully, ikiwiki 3.1415926 fixes display of such errors to +> actualy include the error message. --[[Joey]] From 4601b5b6f9cd674f82e1b6ab50630d1e717fe116 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 02:25:48 -0400 Subject: [PATCH 07/26] Fix some typos in Czech translation (cherry picked from commit 0f2eebc5355f1fcd64e5feb92f4aa7b2c39b4cac) --- po/underlays/basewiki/shortcuts.cs.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/underlays/basewiki/shortcuts.cs.po b/po/underlays/basewiki/shortcuts.cs.po index c842e249f..7ae43e31a 100644 --- a/po/underlays/basewiki/shortcuts.cs.po +++ b/po/underlays/basewiki/shortcuts.cs.po @@ -198,7 +198,7 @@ msgid "" msgstr "" "Pro přidání nové zkratky použijte [[direktivu|ikiwiki/directive]] " "`shortcut`. Řetězec „%s“ je v adrese nahrazen textem předaným dané zkratce. " -"Tento text je automaticky zakódován ([[! wikipedia url_encoding]]) do podoby " +"Tento text je automaticky zakódován ([[!wikipedia url_encoding]]) do podoby " "vhodné pro url. Nechcete-li text kódovat, použijte „%S“. Volitelný parametr " "`desc` dovoluje změnit popis odkazu." From 43176472636b3bc4c01fe159befaa03ecf5d9c73 Mon Sep 17 00:00:00 2001 From: "alicia.warner" Date: Tue, 8 Sep 2009 14:12:35 -0400 Subject: [PATCH 08/26] --- doc/roadmap.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/roadmap.mdwn b/doc/roadmap.mdwn index 2f79f7978..62d25675e 100644 --- a/doc/roadmap.mdwn +++ b/doc/roadmap.mdwn @@ -76,3 +76,5 @@ backwards compatability. and Jamey Sharp; support for other wikis should fit into the same framework.) * [[TODO]], [[bugs]], ... + +Visit the link to get some related research papers. From f2e438c095adb9a53a6126f405011a3f67517343 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 14:16:19 -0400 Subject: [PATCH 09/26] Revert spam This reverts commit 43176472636b3bc4c01fe159befaa03ecf5d9c73. --- doc/roadmap.mdwn | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/roadmap.mdwn b/doc/roadmap.mdwn index 62d25675e..2f79f7978 100644 --- a/doc/roadmap.mdwn +++ b/doc/roadmap.mdwn @@ -76,5 +76,3 @@ backwards compatability. and Jamey Sharp; support for other wikis should fit into the same framework.) * [[TODO]], [[bugs]], ... - -Visit the link to get some related research papers. From c1c933ca658d3babc50da4ade20eb083f1a9c122 Mon Sep 17 00:00:00 2001 From: WikiJeanHawkins Date: Tue, 8 Sep 2009 14:21:49 -0400 Subject: [PATCH 10/26] --- doc/plugins/openid.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/plugins/openid.mdwn b/doc/plugins/openid.mdwn index 91fc7cddc..02b611eb0 100644 --- a/doc/plugins/openid.mdwn +++ b/doc/plugins/openid.mdwn @@ -25,3 +25,5 @@ url. This plugin is enabled by default, but can be turned off if you want to only use some other form of authentication, such as [[passwordauth]]. + +For plugin dissertation or any other related [dissertation](http://www.bestdissertation.com), you may visit this page. From 6d170066e987137e5f6ff49849c452822df86cf4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 14:27:51 -0400 Subject: [PATCH 11/26] Revert spam This reverts commit c1c933ca658d3babc50da4ade20eb083f1a9c122. --- doc/plugins/openid.mdwn | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/plugins/openid.mdwn b/doc/plugins/openid.mdwn index 02b611eb0..91fc7cddc 100644 --- a/doc/plugins/openid.mdwn +++ b/doc/plugins/openid.mdwn @@ -25,5 +25,3 @@ url. This plugin is enabled by default, but can be turned off if you want to only use some other form of authentication, such as [[passwordauth]]. - -For plugin dissertation or any other related [dissertation](http://www.bestdissertation.com), you may visit this page. From 1f828d280a5085f2d9b0c69cbc0d6b4b1a40a105 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 14:38:57 -0400 Subject: [PATCH 12/26] update --- doc/plugins/po.mdwn | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index 38b6b12cd..f3b70b5f7 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -317,27 +317,8 @@ text, or text in whatever single language ikiwiki is configured to "speak". Maybe there could be a way to switch ikiwiki to speaking another language when building a non-english page? Then the directives would get translated. -2 test suite failures --------------------- - -t/po is currently failing tests 57 and 59 (and I would like to release -soon..) --[[Joey]] - -> They are failing because of commit cdc3576c8d1e (po: do not inject -> custom bestlink function when `po_link_to` eq `default`). The test -> suite changes `$config{po_link_to}`, but the `checkconfig` hook is -> not re-run. I could manually run it when needed in the test-suite, -> but this would lead to this function being injected several times, -> and then `$origsubs{'bestlink'}` to be sometimes set to a wrong -> value, which would break other parts of the test-suite. The best -> solution I can think of (apart of reverting this commit or disabling -> these two tests) is to split the test-suite into 3 parts, depending -> on the `$config{po_link_to}` setting, either in 3 different `.t` -> files, or inside the existing one and completely reset the IkiWiki -> environment at the start of these parts... which I did not manage to -> achieve in the last 2 hours :/ --[[intrigeri]] - ->> I've reverted it. --[[Joey]] +(We also will need this in order to use translated templates, when they are +available.) Documentation ------------- From 629ff41d919c1427f99fe95c5a02cbeea1243b26 Mon Sep 17 00:00:00 2001 From: "alicia.warner" Date: Tue, 8 Sep 2009 14:58:37 -0400 Subject: [PATCH 13/26] --- doc/roadmap.mdwn | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/roadmap.mdwn b/doc/roadmap.mdwn index 2f79f7978..f924a1bc9 100644 --- a/doc/roadmap.mdwn +++ b/doc/roadmap.mdwn @@ -76,3 +76,6 @@ backwards compatability. and Jamey Sharp; support for other wikis should fit into the same framework.) * [[TODO]], [[bugs]], ... + + +Click the link to get additional information for research paper writing. From 064b507c534e8ed29f3ac4201300f76e32163697 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 15:02:06 -0400 Subject: [PATCH 14/26] Revert spam This reverts commit 629ff41d919c1427f99fe95c5a02cbeea1243b26. --- doc/roadmap.mdwn | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/roadmap.mdwn b/doc/roadmap.mdwn index f924a1bc9..2f79f7978 100644 --- a/doc/roadmap.mdwn +++ b/doc/roadmap.mdwn @@ -76,6 +76,3 @@ backwards compatability. and Jamey Sharp; support for other wikis should fit into the same framework.) * [[TODO]], [[bugs]], ... - - -Click the link to get additional information for research paper writing. From 9c144163ea7f9fca3497becfaf50e4a1f2a8e242 Mon Sep 17 00:00:00 2001 From: "nicole.adams" Date: Tue, 8 Sep 2009 15:10:06 -0400 Subject: [PATCH 15/26] --- doc/roadmap.mdwn | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/roadmap.mdwn b/doc/roadmap.mdwn index 2f79f7978..ab8a6a742 100644 --- a/doc/roadmap.mdwn +++ b/doc/roadmap.mdwn @@ -76,3 +76,4 @@ backwards compatability. and Jamey Sharp; support for other wikis should fit into the same framework.) * [[TODO]], [[bugs]], ... +* Writing research papers for documentation purposes. From 55474f44d93ffb35f650ab8ba8b32f4478eba1c3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 15:17:39 -0400 Subject: [PATCH 16/26] Expand banned_users; it can now include PageSpecs, which allows banning by IP address. --- IkiWiki/CGI.pm | 28 +++++++++++++++++++++------- debian/changelog | 2 ++ doc/banned_users.mdwn | 8 +++++++- doc/todo/blocking_ip_ranges.mdwn | 3 +++ 4 files changed, 33 insertions(+), 8 deletions(-) diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index af58d7cb5..52cafade0 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -252,16 +252,30 @@ sub check_banned ($$) { my $q=shift; my $session=shift; + my $banned=0; my $name=$session->param("name"); - if (defined $name) { - if (grep { $name eq $_ } @{$config{banned_users}}) { - $session->delete(); - cgi_savesession($session); - cgi_custom_failure( - $q->header(-status => "403 Forbidden"), - gettext("You are banned.")); + if (defined $name && + grep { $name eq $_ } @{$config{banned_users}}) { + $banned=1; + } + + foreach my $b (@{$config{banned_users}}) { + if (pagespec_match("", $b, + ip => $ENV{REMOTE_ADDR}, + name => defined $name ? $name : "", + )) { + $banned=1; + last; } } + + if ($banned) { + $session->delete(); + cgi_savesession($session); + cgi_custom_failure( + $q->header(-status => "403 Forbidden"), + gettext("You are banned.")); + } } sub cgi_getsession ($) { diff --git a/debian/changelog b/debian/changelog index 6109a7012..86e8513f7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ ikiwiki (3.14159265) UNRELEASED; urgency=low * Add French basewiki translation from the Debian French l10n team, including Philippe Batailler, Alexandre Dupas, and Steve Petruzzello. + * Expand banned_users; it can now include PageSpecs, which + allows banning by IP address. -- Joey Hess Wed, 02 Sep 2009 15:01:27 -0400 diff --git a/doc/banned_users.mdwn b/doc/banned_users.mdwn index d2bec90f0..c44f8c587 100644 --- a/doc/banned_users.mdwn +++ b/doc/banned_users.mdwn @@ -1,4 +1,10 @@ -Banned users can be configured in the setup file. +Banned users can be configured in the setup file via the `banned_users` +setting. This is a list of user names, or [[PageSpecs|ikiwiki/PageSpec]] +to ban. Using a PageSpec is useful to block an IP address. + +For example: + + banned_users => ['evilspammer', 'ip(192.168.1.1)'], If a banned user attempts to use the ikiwiki CGI, they will receive a 403 Forbidden webpage indicating they are banned. diff --git a/doc/todo/blocking_ip_ranges.mdwn b/doc/todo/blocking_ip_ranges.mdwn index 95026eef1..ac2344ece 100644 --- a/doc/todo/blocking_ip_ranges.mdwn +++ b/doc/todo/blocking_ip_ranges.mdwn @@ -2,3 +2,6 @@ Admins need the ability to block IP ranges. They can already ban users. See [[fileupload]] for a propsal that grew to encompass the potential to do this. + +[[done]] (well, there is no pagespec for IP ranges yet, but we can block +individual IPs) From c2ae7966cac1bf691fcf76afafdee4a03239a231 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 15:19:16 -0400 Subject: [PATCH 17/26] Revert spam. This spammer's IP has now been blocked. This reverts commit 9c144163ea7f9fca3497becfaf50e4a1f2a8e242. --- doc/roadmap.mdwn | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/roadmap.mdwn b/doc/roadmap.mdwn index ab8a6a742..2f79f7978 100644 --- a/doc/roadmap.mdwn +++ b/doc/roadmap.mdwn @@ -76,4 +76,3 @@ backwards compatability. and Jamey Sharp; support for other wikis should fit into the same framework.) * [[TODO]], [[bugs]], ... -* Writing research papers for documentation purposes. From 93ab004cc23e183199d760f9ecd5afee260c47e9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 17:20:04 -0400 Subject: [PATCH 18/26] memoize template_file This avoids a lot of unncessary stats, and trims about 1 second off a docwiki rebuild here. --- IkiWiki.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/IkiWiki.pm b/IkiWiki.pm index b8e89b73f..01898936f 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -33,6 +33,7 @@ use Memoize; memoize("abs2rel"); memoize("pagespec_translate"); memoize("file_pruned"); +memoize("template_file"); sub getsetup () { wikiname => { From 2a99ebf2766a08f8d68a82255d1518ecac73ec84 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 17:27:37 -0400 Subject: [PATCH 19/26] underlay: Also allow configuring additional directories to search for template files in. --- IkiWiki.pm | 10 +++++++++- IkiWiki/Plugin/underlay.pm | 11 +++++++++-- debian/changelog | 2 ++ doc/plugins/underlay.mdwn | 8 +++++++- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/IkiWiki.pm b/IkiWiki.pm index 01898936f..2f11069c6 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -150,6 +150,13 @@ sub getsetup () { safe => 0, # path rebuild => 1, }, + templatedirs => { + type => "internal", + default => [], + description => "additional directories containing template files", + safe => 0, + rebuild => 0, + }, underlaydir => { type => "string", default => "$installdir/share/ikiwiki/basewiki", @@ -1610,7 +1617,8 @@ sub saveindex () { sub template_file ($) { my $template=shift; - foreach my $dir ($config{templatedir}, "$installdir/share/ikiwiki/templates") { + foreach my $dir ($config{templatedir}, @{$config{templatedirs}}, + "$installdir/share/ikiwiki/templates") { return "$dir/$template" if -e "$dir/$template"; } return; diff --git a/IkiWiki/Plugin/underlay.pm b/IkiWiki/Plugin/underlay.pm index 380d418fb..c59935672 100644 --- a/IkiWiki/Plugin/underlay.pm +++ b/IkiWiki/Plugin/underlay.pm @@ -27,14 +27,21 @@ sub getsetup () { safe => 0, rebuild => 1, }, + add_templates => { + type => "string", + default => [], + description => "extra template directories to add", + advanced => 1, + safe => 0, + rebuild => 1, + }, } sub checkconfig () { - return unless exists $config{add_underlays}; - foreach my $dir (@{$config{add_underlays}}) { add_underlay($dir); } + push @{$config{templatedirs}}, @{$config{add_templates}}; } 1; diff --git a/debian/changelog b/debian/changelog index 86e8513f7..de165e4ff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ ikiwiki (3.14159265) UNRELEASED; urgency=low including Philippe Batailler, Alexandre Dupas, and Steve Petruzzello. * Expand banned_users; it can now include PageSpecs, which allows banning by IP address. + * underlay: Also allow configuring additional directories to search + for template files in. -- Joey Hess Wed, 02 Sep 2009 15:01:27 -0400 diff --git a/doc/plugins/underlay.mdwn b/doc/plugins/underlay.mdwn index 09d096a6e..f7eafee7c 100644 --- a/doc/plugins/underlay.mdwn +++ b/doc/plugins/underlay.mdwn @@ -1,7 +1,7 @@ [[!template id=plugin name=underlay author="[[Simon_McVittie|smcv]]"]] [[!tag type/useful]] -This plugin adds an `add_underlays` option to the `.setup` file. +This plugin adds an `add_underlays` option to the setup file. Its value is a list of underlay directories whose content is added to the wiki. Multiple underlays are normally set up automatically by other plugins (for @@ -12,3 +12,9 @@ like photos or software releases. Directories in `add_underlays` should usually be absolute. If relative, they're interpreted as relative to the parent directory of the basewiki underlay, which is probably not particularly useful in this context. + +-- + +This plugin also adds an `add_templates` option to the setup file. +Its value is a list of template directories to look for template files in, +if they are not present in the `templatedir`. From 1b4c3fb551754cc70abd7a18871a79d79ac3cb5b Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Wed, 9 Sep 2009 22:36:23 -0400 Subject: [PATCH 20/26] note refactored wrapper tweakulation --- doc/plugins/contrib/cvs/discussion.mdwn | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/plugins/contrib/cvs/discussion.mdwn b/doc/plugins/contrib/cvs/discussion.mdwn index 1f0ce0102..155a2289d 100644 --- a/doc/plugins/contrib/cvs/discussion.mdwn +++ b/doc/plugins/contrib/cvs/discussion.mdwn @@ -125,3 +125,19 @@ to pass to the command. > Thanks for reading carefully. I've tested your suggestions and > applied them on my branch. --[[schmonz]] + +---- + +I've abstracted out CVS's involvement in the wrapper, adding a new +"wrapperargcheck" hook to examine `argc/argv` and return success or +failure (failure causes the wrapper to terminate) and implementing +this hook in the plugin. In the non-CVS case, the check immediately +returns success, so the added overhead is just a function call. + +Given how rarely anything should need to reach in and modify the +wrapper -- I'd go so far as to say we shouldn't make it too easy +-- I don't think it's worth the effort to try and design a more +general-purpose way to do so. If and when some other problem thinks +it wants to be solved by a new wrapper hook, it's easy enough to add +one. Until then, I'd say it's more important to keep the wrapper as +short and clear as possible. --[[schmonz]] From b7415543c1ee1ee6ee0404cf781e89043de26fb7 Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Wed, 9 Sep 2009 22:42:47 -0400 Subject: [PATCH 21/26] describe current state of wrapper modification --- doc/plugins/contrib/cvs.mdwn | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/plugins/contrib/cvs.mdwn b/doc/plugins/contrib/cvs.mdwn index fcf5b936f..3d72255fe 100644 --- a/doc/plugins/contrib/cvs.mdwn +++ b/doc/plugins/contrib/cvs.mdwn @@ -22,9 +22,9 @@ Consider creating `$HOME/.cvsrc` if you don't have one already; the plugin doesn * `cvs.pm` started life as a copy of [[3.14159|news/version_3.14159]]'s `svn.pm`. * `IkiWiki.pm:wiki_file_prune_regexps` avoids copying CVS metadata into `$DESTDIR`. -* `IkiWiki/Wrapper.pm` avoids calling ikiwiki from post-commit if it's a -directory being `cvs add`ed (this check is only compiled into the wrapper -iff the configured VCS is "cvs"). +* `IkiWiki/Wrapper.pm` provides a new "wrapperargcheck" hook, which +the plugin implements to avoid calling ikiwiki from post-commit +(and locking against itself) if it's a directory being `cvs add`ed. * [[ikiwiki-makerepo]]: * creates a repository, * imports `$SRCDIR` into top-level module `ikiwiki` (vendor tag IKIWIKI, release tag PRE_CVS), From 689106ad3a24850543c7855b8531a1bf8dcfdb63 Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Wed, 9 Sep 2009 23:17:15 -0400 Subject: [PATCH 22/26] automated tests added (and they highlight that the plugin should probably restore the caller's working directory) --- doc/plugins/contrib/cvs.mdwn | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/plugins/contrib/cvs.mdwn b/doc/plugins/contrib/cvs.mdwn index 3d72255fe..947fa7268 100644 --- a/doc/plugins/contrib/cvs.mdwn +++ b/doc/plugins/contrib/cvs.mdwn @@ -32,6 +32,5 @@ the plugin implements to avoid calling ikiwiki from post-commit * CVS multi-directory commits happen separately; the post-commit hook sees only the first directory's changes in time for [[recentchanges|plugins/recentchanges]]. The next run of `ikiwiki --setup` will correctly re-render such a recentchanges entry. It should be possible to solve this problem with NetBSD's `commit_prep` and `log_accum` scripts (see below). ### To do -* Add automated tests. (Blindly adding svn-like tests to `t/file_pruned.t` doesn't do the trick.) * Instead of resource-intensively scraping changesets with `cvsps`, have `ikiwiki-makerepo` set up NetBSD-like `log_accum` and `commit_prep` scripts that coalesce and keep records of commits. `cvsps` can be used as a fallback for repositories without such records. * Perhaps prevent web edits from attempting to create `.../CVS/foo.mdwn` (and `.../cvs/foo.mdwn` on case-insensitive filesystems); thanks to the CVS metadata directory, the attempt will fail anyway (and much more confusingly) if we don't. From d2b57ae20fa1800d142adad5b3e43dddb97e9466 Mon Sep 17 00:00:00 2001 From: Amitai Schlair Date: Thu, 10 Sep 2009 00:59:05 -0400 Subject: [PATCH 23/26] File::chdir is needed now --- doc/plugins/contrib/cvs.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/plugins/contrib/cvs.mdwn b/doc/plugins/contrib/cvs.mdwn index 947fa7268..d45992300 100644 --- a/doc/plugins/contrib/cvs.mdwn +++ b/doc/plugins/contrib/cvs.mdwn @@ -5,8 +5,8 @@ This plugin allows ikiwiki to use [[!wikipedia desc="CVS" Concurrent Versions System]] as an [[rcs]]. ### Usage -7. Install [cvsps](http://www.cobite.com/cvsps/), [[!cpan -File::ReadBackwards]], and +7. Install [[!cpan File::chdir]], [[!cpan File::ReadBackwards]], +[cvsps](http://www.cobite.com/cvsps/), and [cvsweb](http://www.freebsd.org/projects/cvsweb.html) or the like. 7. Adjust CVS-related parameters in your setup file. From b3cceb0f615089b3a144389f4593c9941a0ed777 Mon Sep 17 00:00:00 2001 From: suxx1k Date: Thu, 10 Sep 2009 09:50:34 -0400 Subject: [PATCH 24/26] --- doc/roadmap.mdwn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/roadmap.mdwn b/doc/roadmap.mdwn index 2f79f7978..8688b856c 100644 --- a/doc/roadmap.mdwn +++ b/doc/roadmap.mdwn @@ -8,7 +8,7 @@ This is the roadmap for ikiwiki development. Released 29 April 2006. The 1.x series is no longer supported. - +d ---- # 2.0 From 22f02603246f67117471f020a882dfa822849d18 Mon Sep 17 00:00:00 2001 From: suxx1k Date: Thu, 10 Sep 2009 09:51:28 -0400 Subject: [PATCH 25/26] --- doc/roadmap.mdwn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/roadmap.mdwn b/doc/roadmap.mdwn index 8688b856c..a701a2685 100644 --- a/doc/roadmap.mdwn +++ b/doc/roadmap.mdwn @@ -7,8 +7,8 @@ This is the roadmap for ikiwiki development. Released 29 April 2006. -The 1.x series is no longer supported. -d +The 1.X series is no longer supported. + ---- # 2.0 From 98ed7cb1d7f99790821b99b3779d6685114fa662 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 10 Sep 2009 13:32:13 -0400 Subject: [PATCH 26/26] Fix parsing web commits from ipv6 addresses. I weakended the regexp, so this matches ipv6 addresses too. It does not ensure that the address is valid, but that should not matter here. Note that addresses ending in "::" are not matched, so eg, the unspecified address will not match -- but should never appear here anyway. --- IkiWiki.pm | 2 +- debian/changelog | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/IkiWiki.pm b/IkiWiki.pm index 2f11069c6..187d40a3a 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -364,7 +364,7 @@ sub getsetup () { }, web_commit_regexp => { type => "internal", - default => qr/^web commit (by (.*?(?=: |$))|from (\d+\.\d+\.\d+\.\d+)):?(.*)/, + default => qr/^web commit (by (.*?(?=: |$))|from ([0-9a-fA-F:.]+[0-9a-fA-F])):?(.*)/, description => "regexp to parse web commits from logs", safe => 0, rebuild => 0, diff --git a/debian/changelog b/debian/changelog index de165e4ff..2e1781713 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ ikiwiki (3.14159265) UNRELEASED; urgency=low allows banning by IP address. * underlay: Also allow configuring additional directories to search for template files in. + * Fix parsing web commits from ipv6 addresses. -- Joey Hess Wed, 02 Sep 2009 15:01:27 -0400