From: Simon McVittie Date: Thu, 28 Jul 2016 09:48:04 +0000 (+0100) Subject: Merge branch 'master' into debian-jessie-backports X-Git-Tag: debian/3.20170111_bpo8+1~8 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/7269c9af3e55dc478792d8ea010ab9b794190a66?hp=cc5cd88d3e5d0ebc5ac7601d0bfb6374a196ecb4 Merge branch 'master' into debian-jessie-backports --- diff --git a/IkiWiki/Receive.pm b/IkiWiki/Receive.pm index 5908e09f9..332ba7c2c 100644 --- a/IkiWiki/Receive.pm +++ b/IkiWiki/Receive.pm @@ -46,8 +46,8 @@ EOF while (read(0, &buf, 256) != 0) {} exit(0); } - asprintf(&s, "CALLER_UID=%i", u); - newenviron[i++]=s; + asprintf(&s, "%i", u); + addenv("CALLER_UID", s); } EOF return $ret; diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 130257f71..e8ed627a4 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -350,7 +350,7 @@ sub find_src_files (;$$$) { else { push @files, $f; if ($pages{$page}) { - debug(sprintf(gettext("%s has multiple possible source pages"), $page)); + debug(sprintf(gettext("%s has multiple possible source files; one will be chosen at random"), $page)); } $pages{$page}=1; } @@ -399,7 +399,7 @@ sub process_changed_files ($$) { } push @files, $f; if ($pages{$page}) { - debug(sprintf(gettext("%s has multiple possible source pages"), $page)); + debug(sprintf(gettext("%s has multiple possible source files; one will be chosen at random"), $page)); } $pages{$page}=1; } diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm index 69500029c..a8de39eea 100644 --- a/IkiWiki/Wrapper.pm +++ b/IkiWiki/Wrapper.pm @@ -52,7 +52,6 @@ sub gen_wrapper () { HTTP_COOKIE REMOTE_USER HTTPS REDIRECT_STATUS HTTP_HOST SERVER_PORT HTTPS HTTP_ACCEPT REDIRECT_URL} if $config{cgi}; - my $envsize=$#envsave; my $envsave=""; foreach my $var (@envsave) { $envsave.=<<"EOF"; @@ -65,7 +64,6 @@ EOF my $val=$config{ENV}{$key}; utf8::encode($val) if utf8::is_utf8($val); $val =~ s/([^A-Za-z0-9])/sprintf '""\\x%02x""', ord($1)/ge; - $envsize += 1; $envsave.=<<"EOF"; addenv("$key", "$val"); EOF @@ -184,18 +182,33 @@ EOF #include extern char **environ; -char *newenviron[$envsize+7]; -int i=0; +int newenvironlen=0; +/* Array of length newenvironlen+1 (+1 for NULL) */ +char **newenviron=NULL; void addenv(char *var, char *val) { - char *s=malloc(strlen(var)+1+strlen(val)+1); + char *s; + + if (newenviron) { + newenviron=realloc(newenviron, (newenvironlen+2) * sizeof(char *)); + } + else { + newenviron=calloc(newenvironlen+2, sizeof(char *)); + } + + if (!newenviron) { + perror("realloc"); + exit(1); + } + + s=malloc(strlen(var)+1+strlen(val)+1); if (!s) { perror("malloc"); exit(1); } else { sprintf(s, "%s=%s", var, val); - newenviron[i++]=s; + newenviron[newenvironlen++]=s; } } @@ -215,9 +228,9 @@ int main (int argc, char **argv) { $check_commit_hook @wrapper_hooks $envsave - newenviron[i++]="HOME=$ENV{HOME}"; - newenviron[i++]="PATH=$ENV{PATH}"; - newenviron[i++]="WRAPPED_OPTIONS=$configstring"; + addenv("HOME", "$ENV{HOME}"); + addenv("PATH", "$ENV{PATH}"); + addenv("WRAPPED_OPTIONS", "$configstring"); #ifdef __TINYC__ /* old tcc versions do not support modifying environ directly */ @@ -225,10 +238,10 @@ $envsave perror("clearenv"); exit(1); } - for (; i>0; i--) - putenv(newenviron[i-1]); + for (; newenvironlen>0; newenvironlen--) + putenv(newenviron[newenvironlen-1]); #else - newenviron[i]=NULL; + newenviron[newenvironlen]=NULL; environ=newenviron; #endif diff --git a/debian/changelog b/debian/changelog index ee8c3955e..3327be340 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +ikiwiki (3.20160728) unstable; urgency=medium + + * Explicitly remove current working directory from Perl's library + search path, mitigating CVE-2016-1238 (see #588017) + * wrappers: allocate new environment dynamically, so we won't overrun + the array if third-party plugins add multiple environment variables. + * Standards-Version: 3.9.8 (no changes required) + + -- Simon McVittie Thu, 28 Jul 2016 10:41:56 +0100 + ikiwiki (3.20160509~bpo8+1) jessie-backports; urgency=medium * Rebuild for jessie-backports diff --git a/debian/control b/debian/control index 60d0e82db..9f228c75b 100644 --- a/debian/control +++ b/debian/control @@ -32,7 +32,7 @@ Build-Depends-Indep: Maintainer: Simon McVittie Uploaders: Josh Triplett , -Standards-Version: 3.9.6 +Standards-Version: 3.9.8 Homepage: https://ikiwiki.info/ Vcs-Git: git://git.ikiwiki.info/ Vcs-Browser: http://source.ikiwiki.branchable.com/?p=source.git;a=summary diff --git a/doc/forum/Archive_with_sub-titles.mdwn b/doc/forum/Archive_with_sub-titles.mdwn new file mode 100644 index 000000000..f5dd02d06 --- /dev/null +++ b/doc/forum/Archive_with_sub-titles.mdwn @@ -0,0 +1,9 @@ +Hi, + +I try to make an (archive-)page of blog entries with subtitles per years, as e.g. on +[http://www.pro-bahn.de/muenchen/presse/alle.html](http://www.pro-bahn.de/muenchen/presse/alle.html) + +What would be the best way to do that? + + +Andi diff --git a/doc/forum/Attachment_file_doesn__39__t_get_attached_to_page.mdwn b/doc/forum/Attachment_file_doesn__39__t_get_attached_to_page.mdwn new file mode 100644 index 000000000..bc5c064d1 --- /dev/null +++ b/doc/forum/Attachment_file_doesn__39__t_get_attached_to_page.mdwn @@ -0,0 +1,49 @@ +I am trying to use the attachment plugin, but it isn't working the way I expect. + +I attempted to add a PDF as an attachment `dns_example.pdf` to a example_page (https://notes.example.org/wiki/MiscNotes/dns_docs_page). The upload appears to happen, I can click the insert links button and links will be inserted into the page. When I click the save-page button, the attachment does not appear to be attached. No errors are displayed. + +On the web server the attachment is at `$srcdir/.ikiwiki/attachments/MiscNotes/dns_docs_page/dns_example.pdf`, but doesn't get copied over to the `$destdir` folder at all. I would expect that it should have been moved to `$srcdir/MiscNotes/dns_docs_page/dns_example.pdf` and added to the git repo, and then copied over to `$destdir`. Am I missing some setting in my configuration or something? + +Is this expected? Is my file being rejected for some reason? It is about 100k, which is under the value required by the `allowed_attachments`. Is there some error logs somewhere that I look at to see more information about why this is failing? + + + # wiki.setup + ... + # where the source of the wiki is located + srcdir: /srv/www/notes.example.org/wiki/wiki.wc + # where to build the wiki + destdir: /srv/www/notes.example.org/wiki/www + # base url to the wiki + url: https://notes.example.org/wiki + # url to the ikiwiki.cgi + cgiurl: https://notes.example.org/wikicgi/ikiwiki.cgi + # filename of cgi wrapper to generate + cgi_wrapper: /srv/www/notes.example.org/wiki/cgi/ikiwiki.cgi + # mode for cgi_wrapper (can safely be made suid) + cgi_wrappermode: 06755 + # rcs backend to use + rcs: git + # plugins to add to the default configuration + add_plugins: + - httpauth + - pagestats + - attachment + - 404 + - table + - tag + - map + - search + - repolist + - brokenlinks + - orphans + - autoindex + - meta + - img + - txt + - template + - theme + ... + # attachment plugin + # enhanced PageSpec specifying what attachments are allowed + allowed_attachments: maxsize(15mb) + diff --git a/doc/forum/Attachment_file_doesn__39__t_get_attached_to_page/comment_1_58867ff018717ff56f362060c38b1aeb._comment b/doc/forum/Attachment_file_doesn__39__t_get_attached_to_page/comment_1_58867ff018717ff56f362060c38b1aeb._comment new file mode 100644 index 000000000..48f086bc2 --- /dev/null +++ b/doc/forum/Attachment_file_doesn__39__t_get_attached_to_page/comment_1_58867ff018717ff56f362060c38b1aeb._comment @@ -0,0 +1,15 @@ +[[!comment format=mdwn + username="smcv" + subject="more info required" + date="2016-06-11T12:17:14Z" + content=""" +If there are any error or warning messages, they'd be in your web server's +error log, for example `/var/log/apache2/error.log` in the default Apache +configuration on Debian or Ubuntu. + +What version of ikiwiki are you using? + +Which OS distribution? + +What version of CGI.pm? +"""]] diff --git a/doc/forum/Attachment_file_doesn__39__t_get_attached_to_page/comment_2_c6cd4450fea32e08474e90edf4dd99b9._comment b/doc/forum/Attachment_file_doesn__39__t_get_attached_to_page/comment_2_c6cd4450fea32e08474e90edf4dd99b9._comment new file mode 100644 index 000000000..376d3a6e0 --- /dev/null +++ b/doc/forum/Attachment_file_doesn__39__t_get_attached_to_page/comment_2_c6cd4450fea32e08474e90edf4dd99b9._comment @@ -0,0 +1,44 @@ +[[!comment format=mdwn + username="https://me.yahoo.com/zoredache#d4929" + nickname="Zoredache" + subject="comment 2" + date="2016-06-20T19:38:40Z" + content=""" +> If there are any error or warning messages, they'd be in your web server's error log + +No obvious errors in the log. When I attempt to attach something, all I see is some stuff from git, that I seem to see with every modification. + + [Mon Jun 20 12:32:29.322642 2016] [cgi:error] [pid 35431] [client 10.2.4.243:51566] AH01215: To /srv/www/notes.example.org/wiki/wiki.git, referer: https://notes.example.org/wikicgi/ikiwiki.cgi + [Mon Jun 20 12:32:29.322688 2016] [cgi:error] [pid 35431] [client 10.2.4.243:51566] AH01215: 3afefec..a6ad76c master -> master, referer: https://notes.example.org/wikicgi/ikiwiki.cgi + +> What version of ikiwiki are you using?, Which OS distribution? + +I am seeing the same results on a couple systems of various configs. The newest version is running on a Debian Jessie system with the backports ikiwiki. + + # apt-cache policy ikiwiki + ikiwiki: + Installed: 3.20160509~bpo8+1 + Candidate: 3.20160509~bpo8+1 + Package pin: 3.20160509~bpo8+1 + Version table: + *** 3.20160509~bpo8+1 600 + 100 http://httpredir.debian.org/debian/ jessie-backports/main amd64 Packages + 100 /var/lib/dpkg/status + +> What version of CGI.pm? + + # head -2 /usr/share/perl/5.20.2/CGI.pm + package CGI; + require 5.008001; + # dpkg -S /usr/share/perl/5.20.2/CGI.pm + perl-modules: /usr/share/perl/5.20.2/CGI.pm + # apt-cache policy perl-modules + perl-modules: + Installed: 5.20.2-3+deb8u5 + Candidate: 5.20.2-3+deb8u5 + Version table: + *** 5.20.2-3+deb8u5 0 + 500 http://httpredir.debian.org/debian/ jessie/main amd64 Packages + 100 /var/lib/dpkg/status + +"""]] diff --git a/doc/forum/Best_way_to_share_settings_between_repositories/comment_1_cce1312c0017224cc2814fc978c4638d._comment b/doc/forum/Best_way_to_share_settings_between_repositories/comment_1_cce1312c0017224cc2814fc978c4638d._comment new file mode 100644 index 000000000..56754214c --- /dev/null +++ b/doc/forum/Best_way_to_share_settings_between_repositories/comment_1_cce1312c0017224cc2814fc978c4638d._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="Martian" + subject="Using multiple setup files" + date="2016-06-30T10:42:45Z" + content=""" +I have found you can use multiple setup files like this: `ikiwiki --setup COMMON.setup --setup MY.setup`. The options from the later one will override options from the previous. + +You should not use ikiwiki to edit your setup then and edit it manually. Not a problem for me. +"""]] diff --git a/doc/forum/Questions_about_a_new_plugin.mdwn b/doc/forum/Questions_about_a_new_plugin.mdwn new file mode 100644 index 000000000..970c103de --- /dev/null +++ b/doc/forum/Questions_about_a_new_plugin.mdwn @@ -0,0 +1,41 @@ +Hello, +I have a plugin in mind, but before starting to write some code, I come to you to see if something similar already exists, or if there is an easier way to do it. + +# What I want + +I want to be able to have several versions of the same page. For instance (this is not my usecase, but it matches exactly), let's say I am developping a software, with several versions published, and I want: + +* the latest documentation to be available at ``http://example.com/doc``; +* the documentation for previous (or current version, with permanent URL) available at ``http://example.com/doc/v2_0``. + +What I am thinking about is: + +* my wiki has the documentation written in pages `doc/v1_0.mdwn`, `doc/v2_0.mdwn`, and so on; +* the `doc.mdwn` page contains nothing but code to copy metadata from the latest `doc/*mdwn` page, that is: [[plugins/meta]] information, [[plugins/tag]], and [[plugins/contrib/ymlfront]]. + +# What I have in mind + +What I have in mind is a plugin providing a directive ``pageversion`` such that the `doc.mdwn` page contains only: + + [[!pageversion pages="doc/* and !doc/*/*"]] + +This would grab the latest documentation page, copy its content, and copy meta information, tags and fields. + +# How to do it + +I see two ways to do it, but both have big drawbacks. + +* I could, in the ``preprocess`` function of the plugin, copy the *interesting* part of the ``%pagestate`` global variable. In pseudo-code, something like: + + $pagestate{doc}{meta} = $pagestate{doc/v2_0}{meta}; + $pagestate{doc}{fields} = $pagestate{doc/v2_0}{fields}; + $pagestate{doc}{tags} = $pagestate{doc/v2_0}{tags}; # This one definitely would not work, but it is pseudo-code + + I fear that some necessary side effects would not occur. For instance, setting date using the [[plugins/meta]] plugin [sets the page creation time at a deeper level](http://source.ikiwiki.branchable.com/?p=source.git;a=blob;f=IkiWiki/Plugin/meta.pm;h=ea099f955ac1c486cdd2baf6636e330a8eae569c;hb=HEAD#l154). Copying ``%pagestate`` would bypass this. + +* I could, in the ``preprocess`` function, call the ``preprocess`` function for those three plugins. But this would mean guessing what the original directive arguments were, which can be tricky. + +# My questions + +* Does something similar already exist? +* Do you have any better idea about how to do it? diff --git a/doc/forum/Questions_about_a_new_plugin/comment_1_52f30b2d89d9223fd367603534d06435._comment b/doc/forum/Questions_about_a_new_plugin/comment_1_52f30b2d89d9223fd367603534d06435._comment new file mode 100644 index 000000000..0a9d86166 --- /dev/null +++ b/doc/forum/Questions_about_a_new_plugin/comment_1_52f30b2d89d9223fd367603534d06435._comment @@ -0,0 +1,59 @@ +[[!comment format=mdwn + username="smcv" + subject="I'm not so sure that copying metadata is desirable" + date="2016-06-09T15:09:30Z" + content=""" +I'm not so sure that copying metadata around is the right solution to the +use case that you outlined. If you do that, then `/doc/v2.0/` and `/doc/` will +be indistinguishable anywhere that pages are listed by their metadata - it's as +though you'd copied the text content of `doc/v2.0.mdwn` into `doc.mdwn`. For +example, if it's tagged `readme`, then a list of pages matching `tagged(readme)` +will have two apparently identical entries, one of which is `/doc/` and the other +is `/doc/v2.0/`. + +Why not do this instead? + +``` +# doc/v2.0.mdwn +[[!tag readme]] +[[!meta title=\"Foobar documentation, version 2.0\"]] + +[[!if test=\"doc/* and created_after(.)\" all=\"no\" + then=\"\"\"[[!template id=\"note\" text=\"[Newer versions are available|doc]\"]]\"\"\"]] + +Here is new documentation about Foobar. + +# doc/v1.0.mdwn +[[!tag readme]] +[[!meta title=\"Foobar documentation, version 1.0\"]] + +[[!if test=\"doc/* and created_after(.)\" all=\"no\" + then=\"\"\"[[!template id=\"note\" text=\"[Newer versions are available|doc]\"]]\"\"\"]] + +Here is documentation about Foobar. + +# doc.mdwn +[[!meta title=\"Foobar documentation\"]] +[[!inline pages=\"doc/*\" limit=\"1\" sort=\"age\" feeds=\"no\" actions=\"no\" raw=\"yes\"]] + +Older versions: + +[[!inline pages=\"doc/*\" skip=\"1\" archive=\"yes\"]] +``` + +... or even (with a bit of new code) + +``` +# doc.mdwn +[[!meta redir_first_match=\"doc/*\" sort=\"age\"]] +``` + +In real life you'd probably want to use a special `[[!template]]` for the link +to the latest version, so that it's easier to make them all consistent, but +for those examples I'm just using the standard [[templates/note]] and some markup. + +> this is not my usecase, but it matches exactly + +Why not ask us about your real use-case, in case it turns out that it *doesn't* +match exactly after putting more thought into it? :-) +"""]] diff --git a/doc/forum/Questions_about_a_new_plugin/comment_2_d9787194e5b1420f2400da8e023ed228._comment b/doc/forum/Questions_about_a_new_plugin/comment_2_d9787194e5b1420f2400da8e023ed228._comment new file mode 100644 index 000000000..8fe25055e --- /dev/null +++ b/doc/forum/Questions_about_a_new_plugin/comment_2_d9787194e5b1420f2400da8e023ed228._comment @@ -0,0 +1,33 @@ +[[!comment format=mdwn + username="spalax" + subject="More information" + date="2016-06-10T18:58:08Z" + content=""" +> [[!if test=\"doc/* and created_after(.)\" all=\"no\" +> then=\"\"\"[[!template id=\"note\" text=\"[Newer versions are available|doc]\"]]\"\"\"]] + +I like that! + +> Why not ask us about your real use-case, in case it turns out that it doesn't match exactly after putting more thought into it? :-) + +Good point: I explained what I wanted; I did not explain why. + + +The reason I want the metadata, fields and tags to be copied from the last subpage to the main page is to inline them. + +On my professional website (I am a math teacher), I have [a page list](http://paternault.fr/pedago) where I list some activities I do in class. For instance, [I describe here](http://paternault.fr/pedago/sismologie/20150110) how I got my students to learn statistics by debunking a psychic's claim. However, I greatly improved this the following year, and published a [new version of the same article](http://paternault.fr/pedago/sismologie/20150819/). + +So far I have three pages: ``.../sismologie/20150110`` and ``.../sismologie/20150819`` (the *actual* articles), and ``.../sismologie/`` (which should reflect the latest article). I want: + +- both articles to be available; +- only the latest one to be visible on the [page list](http://paternault.fr/pedago) (not to highlight outdated articles). + +The [page list](http://paternault.fr/pedago) is generated using [the report directive](https://framagit.org/lpaternault/www/blob/bbe26353eda6a6c95c207fb635134765e70ac637/www/pedago.mdwn#L51-55) (from the [[report plugin|plugins/contrib/report]]). It references the relative latest page (``.../sismologie`` and not ``.../sismologie/20150819``), and needs to access the meta information, fields and tags. + +Right now, what I do is [copying \"by hand\"](https://framagit.org/lpaternault/www/blob/bbe26353eda6a6c95c207fb635134765e70ac637/www/pedago/sismologie.mdwn#L1-9) the [meta information of the latest article](https://framagit.org/lpaternault/www/blob/bbe26353eda6a6c95c207fb635134765e70ac637/www/pedago/sismologie/20150819.mdwn#L1-4), which can be error prone, and is tedious to keep up to date. I am thinking about the page version plugin I described earlier not to repeat myself. + +Sorry for the long post… I hope it is clear enough… + +[[Louis|spalax]] + +"""]] diff --git a/doc/forum/Questions_about_a_new_plugin/comment_3_4426af9c9bc164b5e0a9c60cb812a445._comment b/doc/forum/Questions_about_a_new_plugin/comment_3_4426af9c9bc164b5e0a9c60cb812a445._comment new file mode 100644 index 000000000..143ae56e2 --- /dev/null +++ b/doc/forum/Questions_about_a_new_plugin/comment_3_4426af9c9bc164b5e0a9c60cb812a445._comment @@ -0,0 +1,33 @@ +[[!comment format=mdwn + username="smcv" + subject="comment 3" + date="2016-06-11T12:14:21Z" + content=""" +> It references the relative latest page (.../sismologie and not .../sismologie/20150819), and needs to access the meta information, fields and tags. + +I think this might be the right place to \"cut the knot\": instead of indirecting +through the \"latest\" page, why not something like this? (this is pseudocode +describing a hypothetical plugin, not something you can do right now): + + # index.mdwn + [[!report pages=\"newest(sismologie/*)\" ...]] + +Or you could keep the indirection but make it explicit, without introducing +copying: + + # sismologie.mdwn + [[!inline pages=\"./*\" trail=\"yes\" sort=\"age\"]] + + # index.mdwn - assume ... is a glob that matches sismologie but not its subpages + [[!report pages=\"first-trail-member(...)\"]] + +(`first-trail-member` doesn't exist, but it could.) + +Or maybe a distinct data structure: + + # sismologie.mdwn + [[!versions pages=\"./*\"]] + + # index.mdwn - assume ... is a glob that matches sismologie but not its subpages + [[!report pages=\"version-of(...)\"]] +"""]] diff --git a/doc/forum/Questions_about_a_new_plugin/comment_4_5ca8289d6f9d22dfcc4db92e3635bb18._comment b/doc/forum/Questions_about_a_new_plugin/comment_4_5ca8289d6f9d22dfcc4db92e3635bb18._comment new file mode 100644 index 000000000..63d38dddd --- /dev/null +++ b/doc/forum/Questions_about_a_new_plugin/comment_4_5ca8289d6f9d22dfcc4db92e3635bb18._comment @@ -0,0 +1,35 @@ +[[!comment format=mdwn + username="spalax" + subject="More thought about the `pageversion` plugin" + date="2016-06-14T15:36:32Z" + content=""" +I like your idea of a pagespec: + + # index.mdwn - assume ... is a glob that matches sismologie but not its subpages + [[!report pages=\"first-trail-member(...)\"]] + +What I have in mind now, assuming that my website have the following structure: + + $ tree + ├── blog.mdwn + └── blog + ├── bar.mdwn + ├── bar + │ ├── 20151108.mdwn + │ └── 20160413.mdwn + ├── foo.mdwn + └── foo + ├── 20160103.mdwn + └── 20160605.mdwn + +I can have a plugin that implements: + +- a directive ``[[!versionof parent]]`` in every *actual* article (`bar/20151108.mdwn`, `bar/20160413`, `foo/20160103`, `foo/20160605`) which does two things: + - it registers the pages as being a version of its parent page; + - it displays a text ``Other versions of this article: ...``. +- a pagespec function ``latestversion``, so that the ``blog.mdwn`` page can list the last version of each article using something like ``[[!report pages=\"*/* and latestversion()]]``; +- a directive ``[[!redir_to_latest_version]]`` (or a nicer, shorter name) in *'meta'* articles (`foo.mdwn`, `bar.mdwn`), which redirects the page to the latest version of the article (so that ``http://example.com/blog/foo`` redirects to ``http://example.com/blog/foo/20160605`` (the latest version of ``foo``)). + +Anyway, thank you very much: it may not be the definitive form yet, but it is already much more clean than it was at the beginning. + +"""]] diff --git a/doc/forum/ikiwiki_can__39__t_find_imagemagick.mdwn b/doc/forum/ikiwiki_can__39__t_find_imagemagick.mdwn new file mode 100644 index 000000000..d3133e9bc --- /dev/null +++ b/doc/forum/ikiwiki_can__39__t_find_imagemagick.mdwn @@ -0,0 +1 @@ +I am unable to get ikiwiki to find imagemagick. I want to use homebrew to have imagemagick as well as perl in a recent version, but it seems that ikiwiki is unable to locate these installs. ikiwiki itself has been installed via pkgsrc. I'm on OSx 10.11.4. diff --git a/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_10_600daf7b0498f4fccd06b8852c4ac776._comment b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_10_600daf7b0498f4fccd06b8852c4ac776._comment new file mode 100644 index 000000000..1cbf36df2 --- /dev/null +++ b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_10_600daf7b0498f4fccd06b8852c4ac776._comment @@ -0,0 +1,7 @@ +[[!comment format=mdwn + username="http://schmonz.livejournal.com/" + subject="cool!" + date="2016-06-07T15:14:00Z" + content=""" +Glad it's fixed. Enjoy :-) +"""]] diff --git a/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_1_e48ac42dac04a00c42faa5766410f92b._comment b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_1_e48ac42dac04a00c42faa5766410f92b._comment new file mode 100644 index 000000000..faa78b9f7 --- /dev/null +++ b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_1_e48ac42dac04a00c42faa5766410f92b._comment @@ -0,0 +1,7 @@ +[[!comment format=mdwn + username="openmedi" + subject="comment 1" + date="2016-06-02T18:18:40Z" + content=""" +[This issue I created with the homebrew people might be helpful.](https://github.com/Homebrew/homebrew-core/issues/1620) +"""]] diff --git a/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_2_de1a9589776de198ded1d437ebe0b09c._comment b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_2_de1a9589776de198ded1d437ebe0b09c._comment new file mode 100644 index 000000000..f40dcccb1 --- /dev/null +++ b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_2_de1a9589776de198ded1d437ebe0b09c._comment @@ -0,0 +1,7 @@ +[[!comment format=mdwn + username="http://schmonz.livejournal.com/" + subject="why not keep using pkgsrc?" + date="2016-06-03T01:53:22Z" + content=""" +Wouldn't it be simpler, if you're already getting ikiwiki from pkgsrc, to also get ImageMagick and Perl from pkgsrc? If for some reason you don't want that, could you explain why not? --[[schmonz]] +"""]] diff --git a/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_3_f52851a5b40c2d50aba95796a9b053a8._comment b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_3_f52851a5b40c2d50aba95796a9b053a8._comment new file mode 100644 index 000000000..52c8d5e3b --- /dev/null +++ b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_3_f52851a5b40c2d50aba95796a9b053a8._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="smcv" + subject="comment 3" + date="2016-06-03T06:26:02Z" + content=""" +Either that, or get all the layers of this stack from Homebrew. Mixing two sources +of non-OS-provided add-ons seems unlikely to work without specially configuring +one of them to look in the other's installation directory. +"""]] diff --git a/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_4_0d978e28ad3ec9708e3bd108eb9b3e34._comment b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_4_0d978e28ad3ec9708e3bd108eb9b3e34._comment new file mode 100644 index 000000000..101d7e992 --- /dev/null +++ b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_4_0d978e28ad3ec9708e3bd108eb9b3e34._comment @@ -0,0 +1,7 @@ +[[!comment format=mdwn + username="openmedi" + subject="comment 4" + date="2016-06-06T11:08:43Z" + content=""" +Since ikiwiki is not part of homebrew, getting everything from homebrew is not an option. And the other way around - installing all from pkgsrc - didn't work either. Any other suggestions? +"""]] diff --git a/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_5_d2abd6f58de45faa3cdee6059a319c2d._comment b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_5_d2abd6f58de45faa3cdee6059a319c2d._comment new file mode 100644 index 000000000..fc2e9af97 --- /dev/null +++ b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_5_d2abd6f58de45faa3cdee6059a319c2d._comment @@ -0,0 +1,15 @@ +[[!comment format=mdwn + username="http://schmonz.livejournal.com/" + subject="what didn't work with pkgsrc?" + date="2016-06-06T12:17:22Z" + content=""" +I use the `img` plugin on my site. ikiwiki, perl, and imagemagick are all installed from pkgsrc on my laptop (OS X 10.11.5) and server (NetBSD 7.0.1). As the pkgsrc package maintainer for ikiwiki, if something's broken for you, I'd like to fix it. + +`cd www/ikiwiki && make install` automatically brings in Perl as one of many runtime dependencies. (Usually it's the most recent stable perl, though at the moment it's still 5.22.2. I'm a little surprised we're not already on 5.24.0.) + +If you define `PKG_OPTIONS.ikiwiki+=imagemagick` in `/etc/mk.conf`, then installing ikiwiki will also automatically bring in ImageMagick and its Perl bindings. + +If you don't define that option, you can install them yourself with `cd graphics/p5-PerlMagick && make install`. + +What have you tried? What happened when you tried? +"""]] diff --git a/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_6_1ed093f9dde0f785c07d73d25413d6ee._comment b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_6_1ed093f9dde0f785c07d73d25413d6ee._comment new file mode 100644 index 000000000..fd9ed11e6 --- /dev/null +++ b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_6_1ed093f9dde0f785c07d73d25413d6ee._comment @@ -0,0 +1,17 @@ +[[!comment format=mdwn + username="openmedi" + subject="comment 6" + date="2016-06-07T11:19:47Z" + content=""" +Hm. Maybe the problem is more that I don't understand what needs to happen to make imagemagick available for ikiwiki. I though it would be enough to install imagemagick and have my prefered perl in the path, but that seems not to be the case? I'm, also not sure what \"`cd www/ikiwiki && make install` automatically brings in Perl\" means. Aren't we installing ikiwiki etc. through pkgsrc with `sudo pkgin -y install ikiwiki`? Am I mistaken that you suggesting building ikiwiki myself? Sorry, if I'm getting things wrong. + +What I though would need to happen: + +1. [update to the latest branch of joyent pkgsrc](http://pkgsrc.joyent.com/install-on-osx/) +1. sudo pkgin -y update +1. sudo pkgin -y full-upgrade +1. sudo pkgin -y install p5-PerlMagick (this installs all the dependencies, including a useable perl, I thought) +1. sudo pkgin -y install ikiwiki + +This is wrong/not enough? +"""]] diff --git a/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_7_2ebb00a20c9b2f664fd133568f8af281._comment b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_7_2ebb00a20c9b2f664fd133568f8af281._comment new file mode 100644 index 000000000..164bb3a14 --- /dev/null +++ b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_7_2ebb00a20c9b2f664fd133568f8af281._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="openmedi" + subject="comment 7" + date="2016-06-07T11:23:41Z" + content=""" +Oh and as regards to the part that fails: If I try to use the img directive, [this is the inline error I see when browsing to the page where the picture should be.](http://imgur.com/oCe0NyM) + +\[\[!img Error: Image::Magick is not installed]] +"""]] diff --git a/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_8_2829ff122d902050c512cdead7a1aabd._comment b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_8_2829ff122d902050c512cdead7a1aabd._comment new file mode 100644 index 000000000..6b3745ca4 --- /dev/null +++ b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_8_2829ff122d902050c512cdead7a1aabd._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="http://schmonz.livejournal.com/" + subject="ok" + date="2016-06-07T12:39:41Z" + content=""" +I see. Yeah, `pkgin` should work fine too. (Since ikiwiki also depends on perl, if you installed ikiwiki first, you'd get perl that way just as well.) + +What's in your `$PATH`? When you get that in-page error, how are you running ikiwiki? +"""]] diff --git a/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_9_4e6a50817e6df952001407b84a3ccc9b._comment b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_9_4e6a50817e6df952001407b84a3ccc9b._comment new file mode 100644 index 000000000..1967f8de7 --- /dev/null +++ b/doc/forum/ikiwiki_can__39__t_find_imagemagick/comment_9_4e6a50817e6df952001407b84a3ccc9b._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="openmedi" + subject="comment 9" + date="2016-06-07T13:55:27Z" + content=""" +>\"What's in your $PATH?\" + +This question helped me to solve the problem! I had the order wrong. First came brew, then the os, then pkgsrc. Now the right perl is found and with it imagemagick. +"""]] diff --git a/doc/forum/table_plugin_and_Markdown_side_effects_on_data.mdwn b/doc/forum/table_plugin_and_Markdown_side_effects_on_data.mdwn new file mode 100644 index 000000000..1b09b8edf --- /dev/null +++ b/doc/forum/table_plugin_and_Markdown_side_effects_on_data.mdwn @@ -0,0 +1 @@ +I'm running 3.20130904.1ubuntu1 on Ubuntu 14.04 and have a slight problem with the [[plugins/table]] plugin because my TSV file contains cells that start with a "#" (IRC channel names) and the "#" is replaced with an `

` tag. For now I decided to [hack my local installation of ikiwiki](https://github.com/pdurbin/wiki/commit/6addbf7) to replace "#" with the equivalent HTML entity, but I'd be curious to hear some discussion on this problem. I like having my TSV go through the Markdown rendering so that the URLs in the TSV are turned into clickable links. is where you can see me using the table plugin. The hack is in place so that the cells that start with "#" are not turned into `

` tags. I don't particularly want to change my TSV data itself since I want to treat it as data and not introduce HTML entities or some other hacks in the data itself. I guess I just want some more flexibility from the table plugin on how the data is processed as Markdown. Any thoughts on all of this? -- [[users/pdurbin]] diff --git a/doc/forum/table_plugin_and_Markdown_side_effects_on_data/comment_1_eb64f21d919b6d40a5f158683779e03f._comment b/doc/forum/table_plugin_and_Markdown_side_effects_on_data/comment_1_eb64f21d919b6d40a5f158683779e03f._comment new file mode 100644 index 000000000..ace732b87 --- /dev/null +++ b/doc/forum/table_plugin_and_Markdown_side_effects_on_data/comment_1_eb64f21d919b6d40a5f158683779e03f._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2016-05-29T19:32:58Z" + content=""" +It'd be fine to add a parameter like raw=yes to the table directive to turn +off htmlization and preprocessing of cell contents. +"""]] diff --git a/doc/forum/table_plugin_and_Markdown_side_effects_on_data/comment_2_81648e1ac2dbe2bc72c9d216f3add6bd._comment b/doc/forum/table_plugin_and_Markdown_side_effects_on_data/comment_2_81648e1ac2dbe2bc72c9d216f3add6bd._comment new file mode 100644 index 000000000..13bf2d647 --- /dev/null +++ b/doc/forum/table_plugin_and_Markdown_side_effects_on_data/comment_2_81648e1ac2dbe2bc72c9d216f3add6bd._comment @@ -0,0 +1,7 @@ +[[!comment format=mdwn + username="pdurbin" + subject="comment 2" + date="2016-05-30T11:24:42Z" + content=""" +Well, it's already easy to turn off htmlization and preprocessing of cell contents as Markdown by renaming the file with the table directive (which references my TSV file) from \"foo.mdwn\" to \"foo.wiki\" but when I do that the URLs in the TSV file are no longer turned into clickable links. My hack of not processing certain Markdown syntax, such as ignoring \"#\" when it's at the beginning of a cell, is more what I want. Actually, making links clickable is the only Markdown processing of my data that I want. +"""]] diff --git a/doc/ikiwikiusers.mdwn b/doc/ikiwikiusers.mdwn index 2ce5f885f..a26c0e514 100644 --- a/doc/ikiwikiusers.mdwn +++ b/doc/ikiwikiusers.mdwn @@ -14,10 +14,11 @@ Ikiwiki Hosting =============== [[!table data=""" -Name | Ikiwiki Configuration | Costs -[Branchable](http://branchable.com/) | Open configuration with [ikiwiki-hosting](http://ikiwiki-hosting.branchable.com/) | Free for free software, otherwise involves fees -[Piny.be](http://piny.be/) | Restricted configuration with [Piny](http://piny.be/piny-code/) | Free for non-profit purposes (including open source projects); commercial activity disallowed. -[FairlyStable.org](http://fairlystable.org/) | Restricted configuration with [Piny](http://piny.be/piny-code/) | Free for small projects, otherwise involves fees +Name | Ikiwiki Configuration | Costs +[Branchable](http://branchable.com/) | Open configuration with [ikiwiki-hosting](http://ikiwiki-hosting.branchable.com/) | Free for free software, otherwise involves fees +[Piny.be](http://piny.be/) | Restricted configuration with [Piny](http://piny.be/piny-code/) | Free for non-profit purposes (including open source projects); commercial activity disallowed. +[FairlyStable.org](http://fairlystable.org/) | Restricted configuration with [Piny](http://piny.be/piny-code/) | Free for small projects, otherwise involves fees +[FreedomBox](https://wiki.debian.org/FreedomBox/) | Web configuration with Plinth | Runs on your home's private cloud server """]] Projects & Organizations @@ -96,13 +97,14 @@ Projects & Organizations * [[CAS Libres|http://cas-libres.poivron.org]] - A French feminist radio program. * [[Les Barricades|http://barricades.int.eu.org]] - A French socialist choir (CSS has been adapted from the one of [[Grésille|http://www.gresille.org]]). * [DKØTU Amateur Radio Station](http://www.dk0tu.de), TU Berlin -* [[Plan A|http://www.plan-a-muenchen.de/]] - A proposal for improvement of the urban public transport in Munich (by PRO BAHN, Bund Naturschutz and others) +* [[Plan A|http://www.plan-a-muenchen.de/]] - A proposal for improvement of the urban public transport in Munich (by [[PRO BAHN|http://www.pro-bahn.de/]], Bund Naturschutz and others) * [[Smuxi IRC Client|https://smuxi.im/]] - powerful IRC client for GNOME * [[hplusroadmap|http://diyhpl.us/wiki/]] - a community for open source hardware, do-it-yourself biohacking and practical transhumanism * [[OpenAFS|http://wiki.openafs.org]] - an open-source, cross-platform distributed file system * [Copyleft.org](http://copyleft.org/) * [Hacklab Independência](https://hi.ato.br) - radical tech collective * [Piratas XYZ](http://piratas.xyz) - one of [pirate party of brazil](http://partidopirata.org)'s sites +* [Bürgerinitiative S4-Ausbau](https://www.s4-ausbau.de/) - A initative in the larger munich area to improve the public transport line S4 Personal sites and blogs ======================== @@ -215,3 +217,4 @@ Personal sites and blogs * [Mídia Capoeira](https://capoeira.li/blog/) - independent journalism initiative * [Sean Whitton's personal website](http://spwhitton.name/) * [Matto's personal website](https://box.matto.nl) +* [Rob Sayers' personal website](http://www.robsayers.com) diff --git a/doc/plugins/contrib/bibtex2html.mdwn b/doc/plugins/contrib/bibtex2html.mdwn new file mode 100644 index 000000000..fc3034326 --- /dev/null +++ b/doc/plugins/contrib/bibtex2html.mdwn @@ -0,0 +1,64 @@ +[[!template id=plugin name=bibtex2html author="[[anarcat]]"]] +[[!tag type/format]] + +Trivial plugin to implement [[todo/BibTeX]] support simply using [bibtex2html](https://www.lri.fr/~filliatr/bibtex2html/). It only takes a `bib` file as an argument and dumps whatever bibtex2html returns for it, so it shows *all* the entries, something that is not really possible with the existing [[bibtex]] plugin, as that one requires you to explicitly state every citation you want to show. + +It is hopefully secure enough, but I have still marked it as unsafe because I am worried about parameter expansion in bibtex calls from bibtex2html that wouldn't escape those characters properly. The pipeline is called safely, but certain `-flags` could be maliciously added to the filenames somehow. + +[[!format perl """ +#!/usr/bin/perl +package IkiWiki::Plugin::bibtex2html; +use warnings; +use strict; +use IkiWiki 3.00; +use open qw{:utf8 :std}; + +sub import { + hook(type => "getsetup", id => "bibtex2html", call => \&getsetup); + hook(type => "preprocess", id => "bibtex2html", call => \&bibtex2html); +} + +sub getsetup () { + return + plugin => { + safe => 0, + rebuild => undef, + section => "core", + }, +} + +sub bibtex2html { + my %params=@_; + + # check the files exist + my $file=shift; + if (! defined $file) { + error sprintf(gettext('file parameter is required')); + } + my $near = bestlink($params{page}, $file); + if (! $near) { + error sprintf(gettext('cannot find bestlink for "%s"'), $file); + } + if (! exists $pagesources{$near}) { + error sprintf(gettext('cannot find file "%s"'), $near); + } + add_depends($params{page}, $near); + $near = srcfile($near); + my @bibtex_cmd = (qw[bibtex2html -noheader -nofooter -nobibsource -nodoc -q -o -], $near); + + open(PIPE, "-|", @bibtex_cmd) + || error "can't open pipe to @bibtex_cmd: $!"; + my $html = join("", ); + close PIPE; + debug "ran @bibtex_cmd: $html"; + return "
$html
"; +} + +1; +"""]] + +This could be extended to process `.bib` files directly as source files instead of injecting them in the HTML like this. + +The plugin is generic enough that it could be abstracted to do more than just `bibtex2html`, in a manner similar to the [[compile]] plugin. Unfortunately, the [[compile]] plugin gives too much power to the user providing input to the wiki, which can modify even the commands being run in the directives. There is therefore some room here to make generic preprocessor or even htmlize plugin that would take a hash of `extension` -> `command` configuration to turn (say) `.bib` or `.tex` files into HTML or PDF or whatever you fancy. + +Obviously, this very plugin should have been implemented with Text::Bibtex because forking to `bibtex2html` is expensive. Yet I haven't found a way to do what this plugin does with the existing [[bibtex]] module. [[bibtex]] could of course be extended and then render this plugin obsolete, but I have found it simpler to just reuse an existing working rendered than rewrite my own in Perl. --[[anarcat]] diff --git a/doc/plugins/contrib/bibtex2html/discussion.mdwn b/doc/plugins/contrib/bibtex2html/discussion.mdwn new file mode 100644 index 000000000..3e4207e4e --- /dev/null +++ b/doc/plugins/contrib/bibtex2html/discussion.mdwn @@ -0,0 +1,138 @@ +# [[plugins/contrib/bibtex2html]] and [[plugins/contrib/compile]] plugins + +*Answer to [[anarcat]] mentionning [[plugins/contrib/compile]] in the [[plugins/contrib/bibtex2html]] documentation.* + +I do not think that the [[plugins/contrib/compile]] plugin can replace the [[plugins/contrib/bibtex2html]] plugin right now: the [[plugins/contrib/compile]] plugin compiles a document, and renders *an HTML link to* the compiled document, whereas (if I am not wrong), the [[plugins/contrib/bibtex2html]] plugin compiles a document, and renders *the content of* the compiled document (which happens to be some HTML code). + +Right now, it is not possible for the [[plugins/contrib/compile]] plugin to render the *content* of the compiled document. This could be done by providing a `DESTCONTENT` template variable, containing the content of the compiled document. This should not be hard to implement. + +-- [[Louis|spalax]] (author of [[plugins/contrib/compile]]) + +> Interesting! I am thinking of writing a simpler plugin (maybe called "exec") that would be a merge of the two approaches. There would be an `htmlize` hook to render arbitrary page extensions (based on the configuration) into anything with predefined pipelines. Then a `preprocess` hook would allo directives to inject links to documents or simply inline them like bibtex2html does. The plugin could be secure insofar as the pipelines configured are secure as well. Should that be merged in compile or be a separate plugin? --[[anarcat]] + +>> This "arbitrary executable" stuff scares me, and I'm not going to merge anything +>> like that without a relatively paranoid review. As a result, it could take a while. +>> +>> At some point when I have more time and energy I should try to write down what +>> ikiwiki's security model is. The short version is that the plugins shipped +>> with ikiwiki should never let wiki editors execute arbitrary code, even if they +>> have direct VCS access or can alter "safe"-flagged setup options. The ability to +>> alter non-"safe" setup options is equivalent to access to the uid running the +>> wiki, and so is the ability to alter the plugins that the wiki uses. +>> +>> Defining pipelines or compilation commands in the setup file does not +>> *directly* contradict that, because the setup option would not be flagged +>> as safe, but it does provide an easy way to cause a huge +>> increase in attack surface, particularly when shell scripts are known to +>> be a difficult thing to write securely. If people want arbitrary compilation, +>> Perl or XML-RPC (e.g. Python) plugins are probably safer (even if they call +>> external commands with `IPC::Run` or `subprocess`!), and they would mean that +>> the authors of the arbitrary-compilation code can't have any illusions about +>> "oh, this isn't all that security-sensitive, I'm just writing an +>> ad-hoc command". +>> +>> I hope that ImageTragick is still fresh in everyone's minds - many of the +>> individual vulnerabilities there involved ImageMagick and GraphicsMagick +>> running arbitrary shell pipelines from delegates.xml that turned out not +>> to be hardened against invocation by a hostile user. --[[smcv]] + +>>> The `exec` plugin would definitely not be marked as "safe": it +>>> allows wiki administrators to execute arbitrary code as the wiki +>>> user. +>>> +>>> That said, I believe it is possible to craft a configuration that +>>> *would* be safe to use for *users* in general. Of course, we can't +>>> exclude foot-shooting here: if an admin misconfigures the plugin, +>>> they can introduce new attack vectors. But default and sample +>>> configurations should be secure. +>>> +>>> It is with that model in mind that I wrote the bibtex2html plugin: it doesn't +>>> use the shell to execute bibtex2html: +>>> +>>> [[!format perl """my @bibtex_cmd = (qw[bibtex2html -noheader -nofooter -nobibsource -nodoc -q -o -], $near); open(PIPE, "-|", @bibtex_cmd) || error "can't open pipe to @bibtex_cmd: $!";"""]] +>>> +>>> I specifically tried to address that case, to make sure users +>>> can't execute arbitrary code even if the plugin is enabled. +>>> +>>> Still: it is tricky! The above pipeline could *still* be +>>> vulnerable to certain attacks if bibtex2html does some dangerous +>>> stuff on its own. For example, it could call other executables +>>> with the shell without checking arguments, and then the filename +>>> would be expanded into hostile shell commands. Even worse and +>>> trickier, the filename could be something like `-oclobberfile` and +>>> one file would be destroyed! +>>> +>>> bibtex2html is probably vulnerable to such an attack right now. We +>>> should check attachments for weird filenames and restrict what is +>>> allowed to upload and pass to the plugin. +>>> +>>> In case you haven't reviewed the [[compile]] plugin in detail, +>>> what struck me as an interesting model is the way it allows admin +>>> to configure extensions to pipeline mappings. What I had in mind +>>> was something like this: +>>> +>>> exec_pipelines: +>>> - bib: 'bibtex2html -o- %s' +>>> - svg: 'inkscape -o- %s' +>>> - tex: +>>> - 'pdflatex %s' +>>> - 'bibtex %s' +>>> - 'pdflatex %s' +>>> - 'pdflatex %s' +>>> +>>> (forgive my YAML cluelessness, the idea above is to define a hash +>>> of extension -> (command) mapping.) The command would be broken up +>>> on spaces into an array and the `%s` element would be replaced by +>>> the source file, which would be forbidden to use shell +>>> metacharacters, including prefixed dashes. I believe such a plugin +>>> could be crafted to be secure with proper configuration +>>> +>>> Of course, it's better if there's a native plugin for +>>> everything. For bibtex, we need to use Text::Bibtex, for +>>> example. But that basically means rewriting bibtex2html in Perl, +>>> which not something any user can do easily. And it's an even worse +>>> problems for documents like Word spreadsheets or Latex +>>> documents. Only the native commands can do the right thing. +>>> +>>> A clever admin can certainly find out about such a command and +>>> having a way for that admin to easily hook that into ikiwiki would +>>> be a powerful tool, with all that implies. --[[anarcat]] + +>>>> Concerning the ability to run arbitrary commands, a [[discussion was +>>>> started|https://ikiwiki.info/plugins/contrib/compile/discussion/]] by someone +>>>> who wanted a secure version of this plugin. The idea I had (which has some +>>>> similarities with what is being discussed here) was to provide a +>>>> `compile_secure` boolean option to restrict what the user can do (if +>>>> false, users can run arbitrary commands; if true, users can only run a set of +>>>> predefined commands). However, since [[fr33domlover]], who started the +>>>> discussion, did not answer, nothing was implemented. +>>>> +>>>> Concerning arbitrary commands, I do not know Perl, but I think it can run +>>>> commands using something similar to [exec](http://linux.die.net/man/3/exec), +>>>> which prevents (?) shell injections. This adds the burden of manipulating +>>>> arrays instead of strings, but security should be improved. +>>>> +>>>> But none of those ideas solve the problems you mentionned, being that +>>>> external commands can do nasty things (the `-oclobberfile` option of +>>>> `bibtex2html`) or contain bugs (like ImageMagick). +>>>> +>>>> If we want to merge this plugin and compile, I think a better idea than the one +>>>> I proposed at the beginning of the discussion would be to provide two different +>>>> directives: a `\[[!compile "foo.bar"]]` would compile the file and render it as a +>>>> link to the compiled file (what the compile plugin does right now), while +>>>> `\[[!render "foo.bar"]]` would compile the file, +>>>> and render its content in the current page (whath the bibtex2html plugin +>>>> does). In fact, providing this +>>>> `\[[!render ...]]` directive (without the security considerations) seems +>>>> easy enough to implement, and I might implement it some day (soon, if it +>>>> solves [[anarcat]] problem and closes the discussion). +>>>> +>>>> While I am really happy to see that my plugin sparks some interest, I fear I +>>>> won't be able to implement what is discussed here, apart from the quick +>>>> feature I mentionned in the previous paragraph (I have a baby at home, I am +>>>> moving to another city in a few weeks, and the only code I ever wrote in Perl +>>>> was to contribute to IkiWiki). However, you have my blessing for making +>>>> whatever you want with my code: contribute, write a version 2 of it, write a +>>>> new plugin that makes it obsolete, copy the good ideas and dump the rest, etc. +>>>> +>>>> --[[Louis|spalax]] diff --git a/doc/plugins/contrib/compile.mdwn b/doc/plugins/contrib/compile.mdwn index 7527f2698..d3139e900 100644 --- a/doc/plugins/contrib/compile.mdwn +++ b/doc/plugins/contrib/compile.mdwn @@ -21,7 +21,9 @@ Some important security notice. - This plugins allows user to execute arbitrary commands when compiling the wiki. Use at your own risk. If you use Ikiwiki as a static web site compiler (and not a wiki), and you are the only one to compile the wiki, there is no - risk. + risk. If you *do* allow untrusted users to edit or comment on the wiki, they + can use the `compile` directives to execute completely arbitrary code, regardless + of configuration safeguards you may put. - Source files are published, wheter option `source` is true or not. If `source` is false, source may not be *advertised*, but it is still available @@ -30,6 +32,19 @@ Some important security notice. do not use this plugin if you do not want to publish your source files (sorry: I designed this plugin to publish free stuff). +The plugin could be modified to only allow commands to be modified from the +configuration and it would be safer to use. However, it would still be vulnerable +to command injection attacks because it uses `qx()` command expansion, which +runs commands through `/bin/sh -c`. A thorough security review would be in order +before this should be considered secure running on untrusted input. + +A simpler implementation, that only runs a predefined set of commands, may be +simpler to implement than auditing this whole plugin. For example, the +[[bibtex2html]] module performs a similar task than the compile module, but +hardcodes the command used and doesn't call it with `/bin/sh -c`. It could be +expanded to cover more commands. See this +[[plugins/contrib/bibtex2html/discussion/]] for a followup on this idea. + ## Rationale I want to publish some latex files, both source (`.tex`) and compiled (`.pdf`) @@ -91,7 +106,7 @@ using python-like string formatting, and described in the setup options section. advertised). - `template`: Name of the template to use (if set, the `source` option is irrelevant). -- `var_*`: Any argument with a name starting with ``var_`` is transmitted to the template. For instance, if directive has argument ``var_foo=bar``, then the template will have a variable named ``foo``, and ```` will be replaced by ``bar``. +- `var_*`: Any argument with a name starting with ``var_`` is transmitted to the command and template. For instance, if directive has argument ``var_foo=bar``, then string ``%{foo}s`` in the command will be replaced by ``bar``, and the template will have a variable named ``foo``, and ```` will be replaced by ``bar``. ### Extensions diff --git a/doc/plugins/contrib/datetime_cmp.mdwn b/doc/plugins/contrib/datetime_cmp.mdwn index ba35b37c6..47eaffaec 100644 --- a/doc/plugins/contrib/datetime_cmp.mdwn +++ b/doc/plugins/contrib/datetime_cmp.mdwn @@ -11,6 +11,8 @@ creation or modification times. It also sets the date of the next modification of the page on relevant date, so that the page will be rebuilt if the condition changes. +It requires the DateTime::Format::Duration perl module (on Debian : ``apt-get install libdatetime-format-duration-perl``). + ## List of functions The list of functions is given by the following regexp: diff --git a/doc/plugins/contrib/irker.mdwn b/doc/plugins/contrib/irker.mdwn new file mode 100644 index 000000000..603ee0dd8 --- /dev/null +++ b/doc/plugins/contrib/irker.mdwn @@ -0,0 +1,128 @@ +[[!template id=plugin name=irker author="[[anarcat]]"]] +[[!tag type/special-purpose]] + +This plugin will configure your wiki to send IRC notifications using the [irker](http://www.catb.org/esr/irker/) notification bot. + +It is fairly simple and requires no configuration but installation of the irker package. For template configuration, patches from [Debian bug #824512](https://bugs.debian.org/824512) are necessary. + +[[!format perl """ +package IkiWiki::Plugin::irker; + +use warnings; +use strict; +use IkiWiki 3.00; + +sub import { + hook(type => "getsetup", id => "irker", call => \&getsetup); + hook(type => "checkconfig", id => "branchable", call => \&checkconfig, + first => 1); + hook(type => "genwrapper", id => "irker", call => \&genwrapper, + last => 1); +} + +sub getsetup() { + return + plugin => { + safe => 0, + rebuild => undef, + section => "core", + }, + irker_channels => { + type => "string", + example => ['ircs://irc.example.com/example'], + description => "IRC channels to send notifications to", + safe => 1, + rebuild => 0, + }, + irker_template => { + type => "string", + example => "'%(bold)s%(project)s:%(reset)s %(green)s%(author)s%(reset)s %(repo)s:%(yellow)s%(branch)s%(reset)s * %(bold)s%(rev)s%(reset)s / %(bold)s%(files)s%(reset)s: %(logmsg)s %(brown)s%(url)s%(reset)s", + description => "Template to use for messages. Only supported with patch from https://bugs.debian.org/824512", + safe => 1, + rebuild => 0, + }, + irker_hook => { + type => "string", + example => "irkerhook-git", + description => 'Hook to setup for notifications, will look in $PATH if File::Which is available, otherwise use absolute path.', + safe => 1, + rebuild => 0, + }, +} + +sub checkconfig { + use URI; # ikiwiki Depends on it + foreach my $channel (@{$config{'irker_channels'}}) { + my $uri = URI->new( $channel ); + # inspired by http://stackoverflow.com/a/2599378/1174784 + # and http://stackoverflow.com/a/4953329/1174784 + if (!$uri->scheme || $uri->path =~ m/^([#&]?[^\x07\x2C\s]{,200})/) { + error("$channel is not a valid IRC channel URI"); + } + } + # check if hook exists + if (-x $config{irker_hook}) { + # shortcut: already configured + return; + } + eval q{use File::Which}; + # check with which, i available + if (!$@) { + my $hook; + if (!defined $config{'irker_hook'}) { + $config{'irker_hook'} = 'irkerhook-git'; + } + $hook = which($config{'irker_hook'}); + if (defined $hook) { + $config{'irker_hook'} = $hook; + } + else { + error("irker hook '$config{irker_hook}' not found in PATH"); + } + } + if (!-x $config{irker_hook}) { + error("irker hook '$config{irker_hook}' not executable"); + } +} + +# Parses git_wrapper to find out where the git repository is. +# cargo-culted from branchable.pm +sub find_git_repository { + if ($config{rcs} eq 'git' && + $config{git_wrapper}=~m!^(.*)/hooks/post-update$!) { + return $1; + } + else { + return undef; + } +} + +# setup the hook symlink and git configuration +sub genwrapper() { + my $repo=find_git_repository(); + if (defined $repo && defined $config{'irker_channels'}) { + if (!-l $repo . '/hooks/post-receive') { + if (-e $repo . '/hooks/post-receive') { + error('post-receive hook exists and is not a symlink, failed to setup hook'); + } + symlink($config{'irker_hook'}, $repo . '/hooks/post-receive') || error('failed to symlink: $!'); + } + my $channels = join(",", @{$config{'irker_channels'}}); + system { 'git' } ('config', '-C', $repo, 'config', 'irker.channels', $channels); + system { 'git' } ('config', '-C', $repo, 'config', 'irker.channels', $config{'wikiname'}); + if ($config{'irker_template'}) { + exec { 'git' } ('config', '-C', $repo, 'config', 'irker.channels', $config{'irker_template'}); + } + } + else { + system { 'git' } ('config', '-C', $repo, 'config', '--remove-section', 'irker'); + if (-l $repo . '/hooks/post-receive' && + readlink($repo . '/hooks/post-receive') =~ m/irkerhook/) { + unlink($repo . '/hooks/post-receive'); + } + } + return ""; +} + +1 +"""]] diff --git a/doc/plugins/openid.mdwn b/doc/plugins/openid.mdwn index 82c23fc4f..4c8e0d381 100644 --- a/doc/plugins/openid.mdwn +++ b/doc/plugins/openid.mdwn @@ -35,3 +35,14 @@ certain setups. See [[plugins/openid/troubleshooting]] for a number of issues that may need to be addressed when setting up ikiwiki to accept OpenID logins reliably. + +## delegation + +This plugin does not take care of doing the "server" part of the +OpenID protocol, only the "client" part. In other words, it allows +users to login to your site through OpenID, but is not in itself an +OpenID provider. + +It is possible, however, to use your Ikiwiki site as a delegation +point to another OpenID provider. For this, use the +[[ikiwiki/directive/meta/]] directive with the `openid` parameter. diff --git a/doc/sandbox.mdwn b/doc/sandbox.mdwn index 038412d14..d7f866c76 100644 --- a/doc/sandbox.mdwn +++ b/doc/sandbox.mdwn @@ -1,3 +1,7 @@ +###Is this a heading? + +Sure it is. + Nope my friend. <<<<<<< HEAD diff --git a/doc/sandbox/pagestats.mdwn b/doc/sandbox/pagestats.mdwn new file mode 100644 index 000000000..45beda99b --- /dev/null +++ b/doc/sandbox/pagestats.mdwn @@ -0,0 +1,3 @@ +[[tagging]] should be in this list, since it is tagged 'foo': + +[[!inline pages="tagged(foo)" archive="yes"]] diff --git a/doc/sandbox/tagging.mdwn b/doc/sandbox/tagging.mdwn new file mode 100644 index 000000000..39a3355db --- /dev/null +++ b/doc/sandbox/tagging.mdwn @@ -0,0 +1,5 @@ +[[!tag foo]] + +I'm linking to [[patch]] but I have a taglink to [[!taglink branches]]. I also have a hidden *foo* tag. I link to the non-existing page [[bar]]. + +\[[!inline pages="tagged(branches)" archive="yes"]] diff --git a/doc/setup/byhand/discussion.mdwn b/doc/setup/byhand/discussion.mdwn index 941976789..deb79a8db 100644 --- a/doc/setup/byhand/discussion.mdwn +++ b/doc/setup/byhand/discussion.mdwn @@ -5,3 +5,18 @@ What directory is the 'working copy'? There can be two interpretations: the curr > copies of all the versioned files, and whatever VCS-specific cruft that > entails. So, a working copy is everything you get when you `git clone` > a repository. --[[Joey]] + +------------------- + +The page says *"Note that this file should **not** be put in your wiki's directory with the rest of the files."* Why is that? + +One possible thing is security: Is it just a precaution or would anyone with "write" access to wiki be able to replace the file? + + --[[Martian]] + +> Anyone with the ability to delete/replace attachments via the web UI, or the ability +> to commit directly to the VCS, would be able to replace it. That breaks ikiwiki's +> security model, because replacing the setup file is sufficient to achieve +> arbitrary code execution as the user running the CGI and VCS hooks. --[[smcv]] + +>> Thanks. After all found it here: [[security]]. Now I wonder if I always use a file from the master branch, while limiting users to staging, it might fly... diff --git a/doc/tips/dot_cgi.mdwn b/doc/tips/dot_cgi.mdwn index 3fc404820..8667fed41 100644 --- a/doc/tips/dot_cgi.mdwn +++ b/doc/tips/dot_cgi.mdwn @@ -45,6 +45,8 @@ configuration changes should work anywhere. ErrorDocument 404 /cgi-bin/ikiwiki.cgi +* On Fedora (and RHEL, CentOS, and derivatives) you may need to change CGI mode from `06755` to `755` as suid/sgid bit is prohibited by `suexec`. ([Bug 1341568](https://bugzilla.redhat.com/show_bug.cgi?id=1341658)) + ## lighttpd Here is how to enable cgi on [lighttpd](http://www.lighttpd.net/) and diff --git a/doc/tips/monitor_page_changes_through_IRC.mdwn b/doc/tips/monitor_page_changes_through_IRC.mdwn index 3c5d17ed4..94f0944d8 100644 --- a/doc/tips/monitor_page_changes_through_IRC.mdwn +++ b/doc/tips/monitor_page_changes_through_IRC.mdwn @@ -9,3 +9,18 @@ the workaround I found so far was to join the `#ikiwiki` channel on freenode, an this will watch for any change to this page. -- [[anarcat]] hello anarcat, I'm editing your page! -- [[micah]] + +obviously, the above assumes that the wiki is already configured to send notifications on IRC when commits are done through the git repository. there are multiple ways of doing that, which somewhat fall outside the scope of Ikiwiki itself, since you should really learn how to do this elsewhere. All you need to know is that the hook needs to be in `repository.git/hooks/post-receive` file. + +there are basically two alternatives now: + +* [KGB](https://kgb.alioth.debian.org/) - a Perl script that has been running at Debian since 2009 +* [irker](http://www.catb.org/esr/irker/) - a Python script whipped up by ESR in the fall of CIA.vc (~2011), ignoring the existing KGB bot + +KGB is harder to setup ([tutorial](https://www.donarmstrong.com/posts/switching_to_kgb/)), as it , but more reliable than irker, in my experience. + +I built the [[plugins/contrib/irker]] plugin to automatically configure notifications with irker. I chose irker because it could be configured per wiki, without having to touch a central configuration as would be required for KGB.--[[anarcat]] + +There is also a public service named [Notifico](http://n.tkte.ch/) that aims to replace the defunct [CIA.vc](http://cia.vc/) but it still requires server-side software configuration, so I think it is worth it. Same for [Pursuivant](https://martinsandsmark.wordpress.com/2012/11/20/irc-commit-notifications/). There is also a plethora of commercial notification services which are obviously not covered here. + +See also [[todo/ikibot]] for another bot idea. diff --git a/doc/todo/dynamic_rootpage.mdwn b/doc/todo/dynamic_rootpage.mdwn index 3c39484bc..fc6d7f012 100644 --- a/doc/todo/dynamic_rootpage.mdwn +++ b/doc/todo/dynamic_rootpage.mdwn @@ -1,5 +1,5 @@ I prefer to use a current year, month and day to archive my blog posts, for example -`post/2007/11/12/foo-bar-baz` path is better for me then `post/foo-bar-baz`. +`post/2007/11/12/foo-bar-baz` path is better for me than `post/foo-bar-baz`. Unfortunately it seems that `rootpage` parameter of inline plugin is very static. Is it a chance to make it more dynamic? Now I have to use `svn mkdir` command to create appropriate subdirectories by hand. diff --git a/doc/todo/multiple_setup_option_on_command_line.mdwn b/doc/todo/multiple_setup_option_on_command_line.mdwn new file mode 100644 index 000000000..382faf26d --- /dev/null +++ b/doc/todo/multiple_setup_option_on_command_line.mdwn @@ -0,0 +1,13 @@ +While playing with Perl setup I by accident found multiple setups can be specified on command line like: + + ikiwiki --setup COMMON.setup --setup MY.setup + +Could this be an official feature, in which case it would be nice documented or an "undocumented one" to avoid? + +What about Perl setup files which are undocumented but in the source code. +I have found out after all... + +See also: + +* [[/forum/Best_way_to_share_settings_between_repositories]] +* [[/todo/support_includes_in_setup_files]] diff --git a/doc/todo/pdf_output.mdwn b/doc/todo/pdf_output.mdwn index a0f324054..e273f60fc 100644 --- a/doc/todo/pdf_output.mdwn +++ b/doc/todo/pdf_output.mdwn @@ -2,7 +2,7 @@ Some time ago there was a [[question|http://ikiwiki.info/forum/how_to_get_nice_p Note that for example dokuwiki has a [[nice plugin|http://danjer.doudouke.org/tech/dokutexit]] which converts the wiki page to latex and then to pdf and you can customize the latex-preamble. -> I've actually written one, it's just not publicly released. You can check it out from the "experimental" branch of my ikiplugins githup repo. It's called "html2pdf" and it depends on the static version of wkhtmltopdf rather than requiring a whole LaTeX setup. It's only been used on Ubuntu, so I can't say what problems there might be on other setups, but it works for me. It's not properly documented; I'd appreciate some help with that. +> I've actually written one, it's just not publicly released. You can check it out from the "experimental" branch of my ikiplugins githup repo. It's called "html2pdf" and it depends on the static version of wkhtmltopdf rather than requiring a whole LaTeX setup. It's only been used on Ubuntu, so I can't say what problems there might be on other setups, but it works for me. It's not properly documented; I'd appreciate some help with that. > -- [[KathrynAndersen]] >> Thanks, I downloaded the git-repro and did `sudo cp html2pdf.pm /usr/share/perl5/IkiWiki/Plugin/` then I added html2pdf to the addplugins line in my setup-file (`mywiki.setup`) as well a new line `html2pdf_pages=>"/*",`. Then I did `sudo ikiwiki --setup mywiki.setup`. However there is no button or something like that which let's me create the pdf's diff --git a/doc/users/anarcat.mdwn b/doc/users/anarcat.mdwn index 2bd50c76b..38976c3a6 100644 --- a/doc/users/anarcat.mdwn +++ b/doc/users/anarcat.mdwn @@ -1,4 +1,4 @@ -See +See . I have home pages like this on tons of other wikis including [MoinMoin](https://moinmo.in/TheAnarcat), [Wikipedia](https://en.wikipedia.org/wiki/User:TheAnarcat) and [Koumbit](https://wiki.koumbit.net/TheAnarcat). [[!toc]] diff --git a/doc/users/spalax.mdwn b/doc/users/spalax.mdwn index a9a030c5a..d9e9c5fc9 100644 --- a/doc/users/spalax.mdwn +++ b/doc/users/spalax.mdwn @@ -13,6 +13,7 @@ I wrote and maintain a few plugins, which are available here: [[https://atelier. I have a few things in mind. Their status is something between *I will implement it someday* to *maybe someone could need this* or *I will need it if I implement this killer website I have in mind*. * [[plugins/contrib/htaccessmanager]]: Create a cgi page to manage a htaccess file. +* [[forum/Questions_about_a_new_plugin]] # Contact diff --git a/ikiwiki-calendar.in b/ikiwiki-calendar.in index 74e100be2..d3e31b6db 100755 --- a/ikiwiki-calendar.in +++ b/ikiwiki-calendar.in @@ -1,7 +1,8 @@ #!/usr/bin/perl +no lib '.'; use warnings; use strict; -use lib '.'; # For use in nonstandard directory, munged by Makefile. +use FindBin; use lib $FindBin::Bin; # For use in nonstandard directory, munged by Makefile. use IkiWiki; use IkiWiki::Setup; use Getopt::Long; diff --git a/ikiwiki-comment.in b/ikiwiki-comment.in index 1c7baead0..174647b06 100755 --- a/ikiwiki-comment.in +++ b/ikiwiki-comment.in @@ -1,7 +1,8 @@ #!/usr/bin/perl +no lib '.'; use warnings; use strict; -use lib '.'; # For use in nonstandard directory, munged by Makefile. +use FindBin; use lib $FindBin::Bin; # For use in nonstandard directory, munged by Makefile. use IkiWiki; use IkiWiki::Plugin::comments; use Getopt::Long; diff --git a/ikiwiki-mass-rebuild b/ikiwiki-mass-rebuild index 06a9b512b..ce4e084e8 100755 --- a/ikiwiki-mass-rebuild +++ b/ikiwiki-mass-rebuild @@ -1,4 +1,5 @@ #!/usr/bin/perl +no lib '.'; use warnings; use strict; diff --git a/ikiwiki-transition.in b/ikiwiki-transition.in index e3be645cc..3b617bbfa 100755 --- a/ikiwiki-transition.in +++ b/ikiwiki-transition.in @@ -1,7 +1,8 @@ #!/usr/bin/perl +no lib '.'; use warnings; use strict; -use lib '.'; # For use in nonstandard directory, munged by Makefile. +use FindBin; use lib $FindBin::Bin; # For use in nonstandard directory, munged by Makefile. use IkiWiki; use HTML::Entities; diff --git a/ikiwiki-update-wikilist b/ikiwiki-update-wikilist index 56d6e0731..2807e6be6 100755 --- a/ikiwiki-update-wikilist +++ b/ikiwiki-update-wikilist @@ -1,6 +1,7 @@ #!/usr/bin/perl -t # Add a user to the system wide wikilist. # This script can safely be made suid or put in /etc/sudoers. +no lib '.'; use warnings; use strict; use English; diff --git a/ikiwiki.in b/ikiwiki.in index 1327d70e1..30df628b2 100755 --- a/ikiwiki.in +++ b/ikiwiki.in @@ -1,9 +1,10 @@ #!/usr/bin/perl package IkiWiki; +no lib '.'; use warnings; use strict; -use lib '.'; # For use in nonstandard directory, munged by Makefile. +use FindBin; use lib $FindBin::Bin; # For use in nonstandard directory, munged by Makefile. use IkiWiki 3.00; sub usage () { diff --git a/ikiwiki.spec b/ikiwiki.spec index 30f81434a..39ddd5ca5 100644 --- a/ikiwiki.spec +++ b/ikiwiki.spec @@ -1,5 +1,5 @@ Name: ikiwiki -Version: 3.20160509 +Version: 3.20160728 Release: 1%{?dist} Summary: A wiki compiler diff --git a/pm_filter b/pm_filter index 8e1480564..374e9a44f 100755 --- a/pm_filter +++ b/pm_filter @@ -12,7 +12,7 @@ if (/INSTALLDIR_AUTOREPLACE/) { elsif (/VERSION_AUTOREPLACE/) { $_=qq{our \$version="$ver";}; } -elsif (/^use lib/) { +elsif (/^(?:use FindBin; *)?use lib/) { # The idea here is to figure out if the libdir the Makefile.PL # was configured to use is in perl's normal search path. # If not, hard code it into ikiwiki. diff --git a/po/bg.po b/po/bg.po index cd3d75f2a..c45130aa7 100644 --- a/po/bg.po +++ b/po/bg.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki-bg\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-05-09 21:57+0100\n" +"POT-Creation-Date: 2016-06-14 18:58+0000\n" "PO-Revision-Date: 2007-01-12 01:19+0200\n" "Last-Translator: Damyan Ivanov \n" "Language-Team: Bulgarian \n" @@ -1238,7 +1238,7 @@ msgstr "пропускане на невалидното име на файл #: ../IkiWiki/Render.pm:353 ../IkiWiki/Render.pm:402 #, perl-format -msgid "%s has multiple possible source pages" +msgid "%s has multiple possible source files; one will be chosen at random" msgstr "" #: ../IkiWiki/Render.pm:439 @@ -1333,18 +1333,18 @@ msgstr "не може да бъде създадена обвивка, коят msgid "wrapper filename not specified" msgstr "не е указан файл на обвивката" -#: ../IkiWiki/Wrapper.pm:122 +#: ../IkiWiki/Wrapper.pm:120 msgid "Please wait" msgstr "" #. translators: The parameter is a C filename. -#: ../IkiWiki/Wrapper.pm:288 +#: ../IkiWiki/Wrapper.pm:301 #, perl-format msgid "failed to compile %s" msgstr "крешка при компилиране на файла %s" #. translators: The parameter is a filename. -#: ../IkiWiki/Wrapper.pm:308 +#: ../IkiWiki/Wrapper.pm:321 #, perl-format msgid "successfully generated %s" msgstr "успешно генериране на %s" diff --git a/po/cs.po b/po/cs.po index b4bfddb00..13765a93d 100644 --- a/po/cs.po +++ b/po/cs.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-05-09 21:57+0100\n" +"POT-Creation-Date: 2016-06-14 18:58+0000\n" "PO-Revision-Date: 2009-09-11 20:23+0200\n" "Last-Translator: Miroslav Kure \n" "Language-Team: Czech \n" @@ -1229,8 +1229,8 @@ msgid "skipping bad filename %s" msgstr "přeskakuji chybné jméno souboru %s" #: ../IkiWiki/Render.pm:353 ../IkiWiki/Render.pm:402 -#, perl-format -msgid "%s has multiple possible source pages" +#, fuzzy, perl-format +msgid "%s has multiple possible source files; one will be chosen at random" msgstr "%s má několik možných zdrojových stránek" #: ../IkiWiki/Render.pm:439 @@ -1325,18 +1325,18 @@ msgstr "nemohu vytvořit obal, který využívá soubor setup" msgid "wrapper filename not specified" msgstr "jméno souboru s obalem nebylo zadáno" -#: ../IkiWiki/Wrapper.pm:122 +#: ../IkiWiki/Wrapper.pm:120 msgid "Please wait" msgstr "" #. translators: The parameter is a C filename. -#: ../IkiWiki/Wrapper.pm:288 +#: ../IkiWiki/Wrapper.pm:301 #, perl-format msgid "failed to compile %s" msgstr "nelze zkompilovat %s" #. translators: The parameter is a filename. -#: ../IkiWiki/Wrapper.pm:308 +#: ../IkiWiki/Wrapper.pm:321 #, perl-format msgid "successfully generated %s" msgstr "%s byl úspěšně vytvořen" diff --git a/po/da.po b/po/da.po index 321d28ec6..796dea034 100644 --- a/po/da.po +++ b/po/da.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 3.20110430\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-05-09 21:57+0100\n" +"POT-Creation-Date: 2016-06-14 18:58+0000\n" "PO-Revision-Date: 2011-05-05 13:30+0200\n" "Last-Translator: Jonas Smedegaard \n" "Language-Team: None\n" @@ -1231,8 +1231,8 @@ msgid "skipping bad filename %s" msgstr "udelader forkert filnavn %s" #: ../IkiWiki/Render.pm:353 ../IkiWiki/Render.pm:402 -#, perl-format -msgid "%s has multiple possible source pages" +#, fuzzy, perl-format +msgid "%s has multiple possible source files; one will be chosen at random" msgstr "%s har flere mulige kildesider" #: ../IkiWiki/Render.pm:439 @@ -1327,18 +1327,18 @@ msgstr "kan ikke oprette en wrapper som bruger en opsætningsfil" msgid "wrapper filename not specified" msgstr "wrapper-navn ikke angivet" -#: ../IkiWiki/Wrapper.pm:122 +#: ../IkiWiki/Wrapper.pm:120 msgid "Please wait" msgstr "" #. translators: The parameter is a C filename. -#: ../IkiWiki/Wrapper.pm:288 +#: ../IkiWiki/Wrapper.pm:301 #, perl-format msgid "failed to compile %s" msgstr "kompilering af %s mislykkedes" #. translators: The parameter is a filename. -#: ../IkiWiki/Wrapper.pm:308 +#: ../IkiWiki/Wrapper.pm:321 #, perl-format msgid "successfully generated %s" msgstr "Korrekt bygget %s" diff --git a/po/de.po b/po/de.po index 1ed8acd32..12f60dfaf 100644 --- a/po/de.po +++ b/po/de.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 3.14159\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-05-09 21:57+0100\n" +"POT-Creation-Date: 2016-06-14 18:58+0000\n" "PO-Revision-Date: 2010-03-14 16:09+0530\n" "Last-Translator: Sebastian Kuhnert \n" "Language-Team: German \n" @@ -1246,8 +1246,8 @@ msgid "skipping bad filename %s" msgstr "überspringe fehlerhaften Dateinamen %s" #: ../IkiWiki/Render.pm:353 ../IkiWiki/Render.pm:402 -#, perl-format -msgid "%s has multiple possible source pages" +#, fuzzy, perl-format +msgid "%s has multiple possible source files; one will be chosen at random" msgstr "%s hat mehrere mögliche Quellseiten" #: ../IkiWiki/Render.pm:439 @@ -1345,18 +1345,18 @@ msgstr "Kann keinen Wrapper erzeugen, der eine Einrichtungsdatei verwendet" msgid "wrapper filename not specified" msgstr "Dateiname des Wrappers nicht angegeben" -#: ../IkiWiki/Wrapper.pm:122 +#: ../IkiWiki/Wrapper.pm:120 msgid "Please wait" msgstr "" #. translators: The parameter is a C filename. -#: ../IkiWiki/Wrapper.pm:288 +#: ../IkiWiki/Wrapper.pm:301 #, perl-format msgid "failed to compile %s" msgstr "erzeugen von %s fehlgeschlagen" #. translators: The parameter is a filename. -#: ../IkiWiki/Wrapper.pm:308 +#: ../IkiWiki/Wrapper.pm:321 #, perl-format msgid "successfully generated %s" msgstr "%s wurde erfolgreich erstellt" diff --git a/po/es.po b/po/es.po index bd20f299c..b05e0a48e 100644 --- a/po/es.po +++ b/po/es.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: es\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-05-09 21:57+0100\n" +"POT-Creation-Date: 2016-06-14 18:58+0000\n" "PO-Revision-Date: 2009-06-14 12:32+0200\n" "Last-Translator: Victor Moral \n" "Language-Team: \n" @@ -1250,8 +1250,8 @@ msgid "skipping bad filename %s" msgstr "ignorando el archivo %s porque su nombre no es correcto" #: ../IkiWiki/Render.pm:353 ../IkiWiki/Render.pm:402 -#, perl-format -msgid "%s has multiple possible source pages" +#, fuzzy, perl-format +msgid "%s has multiple possible source files; one will be chosen at random" msgstr "%s tiene mútiples páginas fuente posibles" #: ../IkiWiki/Render.pm:439 @@ -1350,18 +1350,18 @@ msgstr "" msgid "wrapper filename not specified" msgstr "el programa envoltorio no ha sido especificado" -#: ../IkiWiki/Wrapper.pm:122 +#: ../IkiWiki/Wrapper.pm:120 msgid "Please wait" msgstr "" #. translators: The parameter is a C filename. -#: ../IkiWiki/Wrapper.pm:288 +#: ../IkiWiki/Wrapper.pm:301 #, perl-format msgid "failed to compile %s" msgstr "ha fallado la compilación del programa %s" #. translators: The parameter is a filename. -#: ../IkiWiki/Wrapper.pm:308 +#: ../IkiWiki/Wrapper.pm:321 #, perl-format msgid "successfully generated %s" msgstr "creado con éxito el programa envoltorio %s" diff --git a/po/fr.po b/po/fr.po index 82a28485c..0f5d7a528 100644 --- a/po/fr.po +++ b/po/fr.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 3.141\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-05-09 21:57+0100\n" +"POT-Creation-Date: 2016-06-14 18:58+0000\n" "PO-Revision-Date: 2010-10-03 10:42+0200\n" "Last-Translator: Philippe Batailler \n" "Language-Team: French \n" @@ -1241,8 +1241,8 @@ msgid "skipping bad filename %s" msgstr "Omission du fichier au nom incorrect %s" #: ../IkiWiki/Render.pm:353 ../IkiWiki/Render.pm:402 -#, perl-format -msgid "%s has multiple possible source pages" +#, fuzzy, perl-format +msgid "%s has multiple possible source files; one will be chosen at random" msgstr "%s peut être associé à plusieurs pages source." #: ../IkiWiki/Render.pm:439 @@ -1343,18 +1343,18 @@ msgstr "" msgid "wrapper filename not specified" msgstr "Le nom du fichier CGI n'a pas été indiqué" -#: ../IkiWiki/Wrapper.pm:122 +#: ../IkiWiki/Wrapper.pm:120 msgid "Please wait" msgstr "" #. translators: The parameter is a C filename. -#: ../IkiWiki/Wrapper.pm:288 +#: ../IkiWiki/Wrapper.pm:301 #, perl-format msgid "failed to compile %s" msgstr "Échec de la compilation de %s" #. translators: The parameter is a filename. -#: ../IkiWiki/Wrapper.pm:308 +#: ../IkiWiki/Wrapper.pm:321 #, perl-format msgid "successfully generated %s" msgstr "%s a été créé avec succès" diff --git a/po/gu.po b/po/gu.po index 9c631fa26..becb520d2 100644 --- a/po/gu.po +++ b/po/gu.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki-gu\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-05-09 21:57+0100\n" +"POT-Creation-Date: 2016-06-14 18:58+0000\n" "PO-Revision-Date: 2007-01-11 16:05+0530\n" "Last-Translator: Kartik Mistry \n" "Language-Team: Gujarati \n" @@ -1226,7 +1226,7 @@ msgstr "ખરાબ ફાઇલ નામ છોડી દે છે %s" #: ../IkiWiki/Render.pm:353 ../IkiWiki/Render.pm:402 #, perl-format -msgid "%s has multiple possible source pages" +msgid "%s has multiple possible source files; one will be chosen at random" msgstr "" #: ../IkiWiki/Render.pm:439 @@ -1321,18 +1321,18 @@ msgstr "ગોઠવણ ફાઇલનો ઉપયોગ કરે છે ત msgid "wrapper filename not specified" msgstr "આવરણ ફાઇલનામ સ્પષ્ટ કરેલ નથી" -#: ../IkiWiki/Wrapper.pm:122 +#: ../IkiWiki/Wrapper.pm:120 msgid "Please wait" msgstr "" #. translators: The parameter is a C filename. -#: ../IkiWiki/Wrapper.pm:288 +#: ../IkiWiki/Wrapper.pm:301 #, perl-format msgid "failed to compile %s" msgstr "%s કમ્પાઇલ કરવામાં નિષ્ફળ" #. translators: The parameter is a filename. -#: ../IkiWiki/Wrapper.pm:308 +#: ../IkiWiki/Wrapper.pm:321 #, perl-format msgid "successfully generated %s" msgstr "સફળતાપૂર્વક પેદા કરેલ છે %s" diff --git a/po/ikiwiki.pot b/po/ikiwiki.pot index 25571f2da..77ae82319 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: 2016-05-09 21:58+0100\n" +"POT-Creation-Date: 2016-07-28 10:33+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -137,7 +137,7 @@ msgstr "" msgid "deleting bucket.." msgstr "" -#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:225 +#: ../IkiWiki/Plugin/amazon_s3.pm:38 ../ikiwiki.in:226 msgid "done" msgstr "" @@ -1197,7 +1197,7 @@ msgstr "" #: ../IkiWiki/Render.pm:353 ../IkiWiki/Render.pm:402 #, perl-format -msgid "%s has multiple possible source pages" +msgid "%s has multiple possible source files; one will be chosen at random" msgstr "" #: ../IkiWiki/Render.pm:439 @@ -1292,43 +1292,43 @@ msgstr "" msgid "wrapper filename not specified" msgstr "" -#: ../IkiWiki/Wrapper.pm:122 +#: ../IkiWiki/Wrapper.pm:120 msgid "Please wait" msgstr "" #. translators: The parameter is a C filename. -#: ../IkiWiki/Wrapper.pm:288 +#: ../IkiWiki/Wrapper.pm:301 #, perl-format msgid "failed to compile %s" msgstr "" #. translators: The parameter is a filename. -#: ../IkiWiki/Wrapper.pm:308 +#: ../IkiWiki/Wrapper.pm:321 #, perl-format msgid "successfully generated %s" msgstr "" -#: ../ikiwiki.in:10 +#: ../ikiwiki.in:11 msgid "usage: ikiwiki [options] source dest" msgstr "" -#: ../ikiwiki.in:11 +#: ../ikiwiki.in:12 msgid " ikiwiki --setup my.setup [options]" msgstr "" -#: ../ikiwiki.in:102 +#: ../ikiwiki.in:103 msgid "usage: --set var=value" msgstr "" -#: ../ikiwiki.in:109 +#: ../ikiwiki.in:110 msgid "usage: --set-yaml var=value" msgstr "" -#: ../ikiwiki.in:214 +#: ../ikiwiki.in:215 msgid "rebuilding wiki.." msgstr "" -#: ../ikiwiki.in:217 +#: ../ikiwiki.in:218 msgid "refreshing wiki.." msgstr "" diff --git a/po/it.po b/po/it.po index e14d35456..8eb388109 100644 --- a/po/it.po +++ b/po/it.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Ikiwiki\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-05-09 21:57+0100\n" +"POT-Creation-Date: 2016-06-14 18:58+0000\n" "PO-Revision-Date: 2009-08-16 11:01+0100\n" "Last-Translator: Luca Bruno \n" "Language-Team: Italian TP \n" @@ -1240,8 +1240,8 @@ msgid "skipping bad filename %s" msgstr "ignorato il file dal nome scorretto %s" #: ../IkiWiki/Render.pm:353 ../IkiWiki/Render.pm:402 -#, perl-format -msgid "%s has multiple possible source pages" +#, fuzzy, perl-format +msgid "%s has multiple possible source files; one will be chosen at random" msgstr "%s ha diverse pagine sorgenti possibili" #: ../IkiWiki/Render.pm:439 @@ -1337,18 +1337,18 @@ msgstr "impossibile creare un contenitore che utilizzi un file di setup" msgid "wrapper filename not specified" msgstr "nome del file del contenitore non specificato" -#: ../IkiWiki/Wrapper.pm:122 +#: ../IkiWiki/Wrapper.pm:120 msgid "Please wait" msgstr "" #. translators: The parameter is a C filename. -#: ../IkiWiki/Wrapper.pm:288 +#: ../IkiWiki/Wrapper.pm:301 #, perl-format msgid "failed to compile %s" msgstr "errore nel compilare %s" #. translators: The parameter is a filename. -#: ../IkiWiki/Wrapper.pm:308 +#: ../IkiWiki/Wrapper.pm:321 #, perl-format msgid "successfully generated %s" msgstr "%s generato con successo" diff --git a/po/pl.po b/po/pl.po index 659ce7796..a9e6322e2 100644 --- a/po/pl.po +++ b/po/pl.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 1.51\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-05-09 21:57+0100\n" +"POT-Creation-Date: 2016-06-14 18:58+0000\n" "PO-Revision-Date: 2007-04-27 22:05+0200\n" "Last-Translator: Pawel Tecza \n" "Language-Team: Debian L10n Polish \n" @@ -1247,7 +1247,7 @@ msgstr "pomijanie nieprawidłowej nazwy pliku %s" #: ../IkiWiki/Render.pm:353 ../IkiWiki/Render.pm:402 #, perl-format -msgid "%s has multiple possible source pages" +msgid "%s has multiple possible source files; one will be chosen at random" msgstr "" #: ../IkiWiki/Render.pm:439 @@ -1342,18 +1342,18 @@ msgstr "awaria w trakcie tworzenia osłony używającej pliku konfiguracyjnego" msgid "wrapper filename not specified" msgstr "nieokreślona nazwa pliku osłony" -#: ../IkiWiki/Wrapper.pm:122 +#: ../IkiWiki/Wrapper.pm:120 msgid "Please wait" msgstr "" #. translators: The parameter is a C filename. -#: ../IkiWiki/Wrapper.pm:288 +#: ../IkiWiki/Wrapper.pm:301 #, perl-format msgid "failed to compile %s" msgstr "awaria w trakcie kompilowania %s" #. translators: The parameter is a filename. -#: ../IkiWiki/Wrapper.pm:308 +#: ../IkiWiki/Wrapper.pm:321 #, perl-format msgid "successfully generated %s" msgstr "pomyślnie utworzono %s" diff --git a/po/sv.po b/po/sv.po index 3878ed78b..e7a45e9e0 100644 --- a/po/sv.po +++ b/po/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-05-09 21:57+0100\n" +"POT-Creation-Date: 2016-06-14 18:58+0000\n" "PO-Revision-Date: 2007-01-10 23:47+0100\n" "Last-Translator: Daniel Nylander \n" "Language-Team: Swedish \n" @@ -1233,7 +1233,7 @@ msgstr "hoppar över felaktigt filnamn %s" #: ../IkiWiki/Render.pm:353 ../IkiWiki/Render.pm:402 #, perl-format -msgid "%s has multiple possible source pages" +msgid "%s has multiple possible source files; one will be chosen at random" msgstr "" #: ../IkiWiki/Render.pm:439 @@ -1328,18 +1328,18 @@ msgstr "kan inte skapa en wrapper som använder en konfigurationsfil" msgid "wrapper filename not specified" msgstr "filnamn för wrapper har inte angivits" -#: ../IkiWiki/Wrapper.pm:122 +#: ../IkiWiki/Wrapper.pm:120 msgid "Please wait" msgstr "" #. translators: The parameter is a C filename. -#: ../IkiWiki/Wrapper.pm:288 +#: ../IkiWiki/Wrapper.pm:301 #, perl-format msgid "failed to compile %s" msgstr "misslyckades med att kompilera %s" #. translators: The parameter is a filename. -#: ../IkiWiki/Wrapper.pm:308 +#: ../IkiWiki/Wrapper.pm:321 #, perl-format msgid "successfully generated %s" msgstr "generering av %s lyckades" diff --git a/po/tr.po b/po/tr.po index 20193a2a7..2418fe080 100644 --- a/po/tr.po +++ b/po/tr.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki 3.20091031\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-05-09 21:57+0100\n" +"POT-Creation-Date: 2016-06-14 18:58+0000\n" "PO-Revision-Date: 2009-11-08 03:04+0200\n" "Last-Translator: Recai Oktaş \n" "Language-Team: Turkish \n" @@ -1196,7 +1196,7 @@ msgstr "" #: ../IkiWiki/Render.pm:353 ../IkiWiki/Render.pm:402 #, perl-format -msgid "%s has multiple possible source pages" +msgid "%s has multiple possible source files; one will be chosen at random" msgstr "" #: ../IkiWiki/Render.pm:439 @@ -1291,18 +1291,18 @@ msgstr "" msgid "wrapper filename not specified" msgstr "" -#: ../IkiWiki/Wrapper.pm:122 +#: ../IkiWiki/Wrapper.pm:120 msgid "Please wait" msgstr "" #. translators: The parameter is a C filename. -#: ../IkiWiki/Wrapper.pm:288 +#: ../IkiWiki/Wrapper.pm:301 #, perl-format msgid "failed to compile %s" msgstr "" #. translators: The parameter is a filename. -#: ../IkiWiki/Wrapper.pm:308 +#: ../IkiWiki/Wrapper.pm:321 #, perl-format msgid "successfully generated %s" msgstr "" diff --git a/po/vi.po b/po/vi.po index e9dd85c8d..69e967d88 100644 --- a/po/vi.po +++ b/po/vi.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: ikiwiki\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-05-09 21:57+0100\n" +"POT-Creation-Date: 2016-06-14 18:58+0000\n" "PO-Revision-Date: 2007-01-13 15:31+1030\n" "Last-Translator: Clytie Siddall \n" "Language-Team: Vietnamese \n" @@ -1233,7 +1233,7 @@ msgstr "đang bỏ qua tên tập tin sai %s" #: ../IkiWiki/Render.pm:353 ../IkiWiki/Render.pm:402 #, perl-format -msgid "%s has multiple possible source pages" +msgid "%s has multiple possible source files; one will be chosen at random" msgstr "" #: ../IkiWiki/Render.pm:439 @@ -1328,18 +1328,18 @@ msgstr "không thể tạo bộ bao bọc sử dụng tập tin thiết lập" msgid "wrapper filename not specified" msgstr "chưa xác định tên tập tin bộ bao bọc" -#: ../IkiWiki/Wrapper.pm:122 +#: ../IkiWiki/Wrapper.pm:120 msgid "Please wait" msgstr "" #. translators: The parameter is a C filename. -#: ../IkiWiki/Wrapper.pm:288 +#: ../IkiWiki/Wrapper.pm:301 #, perl-format msgid "failed to compile %s" msgstr "lỗi biên dịch %s" #. translators: The parameter is a filename. -#: ../IkiWiki/Wrapper.pm:308 +#: ../IkiWiki/Wrapper.pm:321 #, perl-format msgid "successfully generated %s" msgstr "%s đã được tạo ra" diff --git a/t/basewiki_brokenlinks.t b/t/basewiki_brokenlinks.t index 26e3859ab..f639d0dd8 100755 --- a/t/basewiki_brokenlinks.t +++ b/t/basewiki_brokenlinks.t @@ -1,6 +1,7 @@ #!/usr/bin/perl use warnings; use strict; +use Cwd qw(getcwd); use Test::More; my $installed = $ENV{INSTALLED_TESTS}; @@ -14,10 +15,10 @@ if ($installed) { else { ok(! system("make -s ikiwiki.out")); ok(! system("make underlay_install DESTDIR=`pwd`/t/tmp/install PREFIX=/usr >/dev/null")); - @command = qw(env LC_ALL=C perl -I. ./ikiwiki.out + @command = (qw(env LC_ALL=C perl), "-I".getcwd, qw(./ikiwiki.out --underlaydir=t/tmp/install/usr/share/ikiwiki/basewiki --set underlaydirbase=t/tmp/install/usr/share/ikiwiki - --templatedir=templates); + --templatedir=templates)); } foreach my $plugin ("", "listdirectives") { diff --git a/t/comments.t b/t/comments.t index a5add9701..f2e32c46e 100755 --- a/t/comments.t +++ b/t/comments.t @@ -1,6 +1,7 @@ #!/usr/bin/perl use warnings; use strict; +use Cwd qw(getcwd); use Test::More; use IkiWiki; @@ -17,10 +18,10 @@ if ($installed) { } else { ok(! system("make -s ikiwiki.out")); - @command = qw(perl -I. ./ikiwiki.out + @command = ("perl", "-I".getcwd, qw(./ikiwiki.out --underlaydir=underlays/basewiki --set underlaydirbase=underlays - --templatedir=templates); + --templatedir=templates)); } my $comment; diff --git a/t/conflicts.t b/t/conflicts.t index 07c392cd3..2c2761efb 100755 --- a/t/conflicts.t +++ b/t/conflicts.t @@ -2,6 +2,7 @@ # Tests for bugs relating to conflicting files in the srcdir use warnings; use strict; +use Cwd qw(getcwd); use Test::More tests => 106; my $installed = $ENV{INSTALLED_TESTS}; @@ -13,10 +14,10 @@ if ($installed) { } else { ok(! system("make -s ikiwiki.out")); - @command = qw(perl -I. ./ikiwiki.out + @command = ("perl", "-I".getcwd, qw(./ikiwiki.out --underlaydir=underlays/basewiki --set underlaydirbase=underlays - --templatedir=templates); + --templatedir=templates)); } # setup diff --git a/t/cvs.t b/t/cvs.t index 371c21ec9..6acafd701 100755 --- a/t/cvs.t +++ b/t/cvs.t @@ -708,5 +708,5 @@ sub stripext { } sub _wrapper_paths { - return qq{newenviron[i++]="PERL5LIB=$ENV{PERL5LIB}";}; + return qq{addenv("PERL5LIB", "$ENV{PERL5LIB}");}; } diff --git a/t/img.t b/t/img.t index 05a91aff6..228f09a0e 100755 --- a/t/img.t +++ b/t/img.t @@ -13,6 +13,7 @@ package IkiWiki; use warnings; use strict; +use Cwd qw(getcwd); use Test::More; plan(skip_all => "Image::Magick not available") unless eval q{use Image::Magick; 1}; @@ -27,10 +28,10 @@ if ($installed) { } else { ok(! system("make -s ikiwiki.out")); - @command = qw(perl -I. ./ikiwiki.out + @command = ("perl", "-I".getcwd, qw(./ikiwiki.out --underlaydir=underlays/basewiki --set underlaydirbase=underlays - --templatedir=templates); + --templatedir=templates)); } push @command, qw(--set usedirs=0 --plugin img t/tmp/in t/tmp/out --verbose); diff --git a/t/inline.t b/t/inline.t index 8c0f1c35a..3a4450365 100755 --- a/t/inline.t +++ b/t/inline.t @@ -1,6 +1,7 @@ #!/usr/bin/perl use warnings; use strict; +use Cwd qw(getcwd); use Test::More; use IkiWiki; @@ -12,10 +13,10 @@ if ($installed) { } else { ok(! system("make -s ikiwiki.out")); - @command = qw(perl -I. ./ikiwiki.out + @command = ("perl", "-I".getcwd, qw(./ikiwiki.out --underlaydir=underlays/basewiki --set underlaydirbase=underlays - --templatedir=templates); + --templatedir=templates)); } push @command, qw(--set usedirs=0 --plugin inline diff --git a/t/meta.t b/t/meta.t index d23d9bc71..3b26ee7d2 100755 --- a/t/meta.t +++ b/t/meta.t @@ -1,6 +1,7 @@ #!/usr/bin/perl use warnings; use strict; +use Cwd qw(getcwd); use Test::More; use IkiWiki; @@ -16,10 +17,10 @@ if ($installed) { } else { ok(! system("make -s ikiwiki.out")); - @command = qw(perl -I. ./ikiwiki.out + @command = ("perl", "-I".getcwd, qw(./ikiwiki.out --underlaydir=underlays/basewiki --set underlaydirbase=underlays - --templatedir=templates); + --templatedir=templates)); } push @command, qw(--plugin meta --disable-plugin htmlscrubber); diff --git a/t/permalink.t b/t/permalink.t index edb05a81b..2eb557e1d 100755 --- a/t/permalink.t +++ b/t/permalink.t @@ -1,6 +1,7 @@ #!/usr/bin/perl use warnings; use strict; +use Cwd qw(getcwd); use Test::More; my $installed = $ENV{INSTALLED_TESTS}; @@ -11,10 +12,10 @@ if ($installed) { } else { ok(! system("make -s ikiwiki.out")); - @command = qw(perl -I. ./ikiwiki.out + @command = ("perl", "-I".getcwd, qw(./ikiwiki.out --underlaydir=underlays/basewiki --set underlaydirbase=underlays - --templatedir=templates); + --templatedir=templates)); } ok(! system("rm -rf t/tmp")); diff --git a/t/podcast.t b/t/podcast.t index c698d1835..708ac7640 100755 --- a/t/podcast.t +++ b/t/podcast.t @@ -25,10 +25,10 @@ if ($installed) { } else { ok(! system("make -s ikiwiki.out")); - @base_command = qw(perl -I. ./ikiwiki.out + @base_command = ("perl", "-I".getcwd, qw(./ikiwiki.out --underlaydir=underlays/basewiki --set underlaydirbase=underlays - --templatedir=templates); + --templatedir=templates)); } my $tmp = 't/tmp'; diff --git a/t/relativity.t b/t/relativity.t index c67c8ba17..7e382eaa7 100755 --- a/t/relativity.t +++ b/t/relativity.t @@ -24,10 +24,10 @@ if ($installed) { } else { ok(! system("make -s ikiwiki.out")); - @command = qw(perl -I. ./ikiwiki.out + @command = ("perl", "-I".getcwd, qw(./ikiwiki.out --underlaydir=underlays/basewiki --set underlaydirbase=underlays - --templatedir=templates); + --templatedir=templates)); } sub parse_cgi_content { diff --git a/t/trail.t b/t/trail.t index cac64c366..ed180d35c 100755 --- a/t/trail.t +++ b/t/trail.t @@ -1,6 +1,7 @@ #!/usr/bin/perl use warnings; use strict; +use Cwd qw(getcwd); use Test::More; use IkiWiki; @@ -35,10 +36,10 @@ if ($installed) { } else { ok(! system("make -s ikiwiki.out")); - @command = qw(perl -I. ./ikiwiki.out + @command = ("perl", "-I".getcwd, qw(./ikiwiki.out --underlaydir=underlays/basewiki --set underlaydirbase=underlays - --templatedir=templates); + --templatedir=templates)); } push @command, qw(--set usedirs=0 --plugin trail --plugin inline diff --git a/t/wrapper-environ.t b/t/wrapper-environ.t new file mode 100755 index 000000000..d6d34b9d9 --- /dev/null +++ b/t/wrapper-environ.t @@ -0,0 +1,93 @@ +#!/usr/bin/perl +use warnings; +use strict; + +use Test::More; +plan(skip_all => "IPC::Run not available") + unless eval q{ + use IPC::Run qw(run); + 1; + }; + +use IkiWiki; + +use Cwd qw(getcwd); +use Errno qw(ENOENT); + +my $installed = $ENV{INSTALLED_TESTS}; + +my @command; +if ($installed) { + @command = qw(env PERL5LIB=t/tmp ikiwiki); +} +else { + ok(! system("make -s ikiwiki.out")); + @command = (qw(env PERL5LIB=t/tmp:blib/lib:blib/arch perl), + "-I".getcwd, qw(./ikiwiki.out + --underlaydir=underlays/basewiki + --set underlaydirbase=underlays + --templatedir=templates)); +} + +writefile("test.setup", "t/tmp", < "getsetup", id => "excessiveenvironment", call => \&getsetup); + hook(type => "genwrapper", id => "excessiveenvironment", call => \&genwrapper); +} + +sub getsetup { + return plugin => { + safe => 0, + rebuild => undef, + section => "rcs", + }; +} + +sub genwrapper { + my @ret; + foreach my $j (1..4096) { + push @ret, qq{addenv("VAR$j", "val$j");\n}; + } + return join '', @ret; +} + +1; +EOF + ); + +my $stdout; +ok(! system(@command, qw(--setup t/tmp/test.setup --rebuild --wrappers)), "run ikiwiki"); +ok(run(["./t/tmp/ikiwiki.cgi"], '<&-', '>', \$stdout, init => sub { + $ENV{HTTP_HOST} = "localhost"; + $ENV{QUERY_STRING} = "do=prefs"; + $ENV{REQUEST_METHOD} = "GET"; + $ENV{SCRIPT_NAME} = "/cgi-bin/ikiwiki.cgi"; + $ENV{SERVER_PORT} = "80" +}), "run CGI"); + +done_testing();