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: --- ...e_link_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 (limited to 'doc/todo') 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. -- cgit v1.2.3 From 507d8ace625317072bfed7925b516fe3c573a568 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 6 Sep 2009 13:26:42 -0400 Subject: thoughts on translating the templates files --- doc/todo/l10n.mdwn | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'doc/todo') 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]] -- 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(-) (limited to 'doc/todo') 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