From 4601b5b6f9cd674f82e1b6ab50630d1e717fe116 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 02:25:48 -0400 Subject: 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." -- cgit v1.2.3 From 43176472636b3bc4c01fe159befaa03ecf5d9c73 Mon Sep 17 00:00:00 2001 From: "alicia.warner" Date: Tue, 8 Sep 2009 14:12:35 -0400 Subject: --- 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. -- cgit v1.2.3 From f2e438c095adb9a53a6126f405011a3f67517343 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 14:16:19 -0400 Subject: 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. -- cgit v1.2.3 From c1c933ca658d3babc50da4ade20eb083f1a9c122 Mon Sep 17 00:00:00 2001 From: WikiJeanHawkins Date: Tue, 8 Sep 2009 14:21:49 -0400 Subject: --- 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. -- cgit v1.2.3 From 6d170066e987137e5f6ff49849c452822df86cf4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 14:27:51 -0400 Subject: 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. -- cgit v1.2.3 From 1f828d280a5085f2d9b0c69cbc0d6b4b1a40a105 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 14:38:57 -0400 Subject: 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 ------------- -- cgit v1.2.3 From 629ff41d919c1427f99fe95c5a02cbeea1243b26 Mon Sep 17 00:00:00 2001 From: "alicia.warner" Date: Tue, 8 Sep 2009 14:58:37 -0400 Subject: --- 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. -- cgit v1.2.3 From 064b507c534e8ed29f3ac4201300f76e32163697 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 15:02:06 -0400 Subject: 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. -- cgit v1.2.3 From 9c144163ea7f9fca3497becfaf50e4a1f2a8e242 Mon Sep 17 00:00:00 2001 From: "nicole.adams" Date: Tue, 8 Sep 2009 15:10:06 -0400 Subject: --- 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. -- cgit v1.2.3 From 55474f44d93ffb35f650ab8ba8b32f4478eba1c3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 15:17:39 -0400 Subject: 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) -- cgit v1.2.3 From c2ae7966cac1bf691fcf76afafdee4a03239a231 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 15:19:16 -0400 Subject: 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. -- cgit v1.2.3 From 93ab004cc23e183199d760f9ecd5afee260c47e9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 17:20:04 -0400 Subject: 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 => { -- cgit v1.2.3 From 2a99ebf2766a08f8d68a82255d1518ecac73ec84 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Sep 2009 17:27:37 -0400 Subject: 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`. -- cgit v1.2.3