]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Merge branch 'master' into ubuntu-trusty-backports
authorSimon McVittie <smcv@debian.org>
Fri, 6 May 2016 08:16:11 +0000 (09:16 +0100)
committerSimon McVittie <smcv@debian.org>
Fri, 6 May 2016 08:16:11 +0000 (09:16 +0100)
80 files changed:
IkiWiki.pm
IkiWiki/CGI.pm
IkiWiki/Plugin/comments.pm
IkiWiki/Plugin/editpage.pm
IkiWiki/Plugin/git.pm
IkiWiki/Plugin/img.pm
IkiWiki/Plugin/loginselector.pm
IkiWiki/Plugin/mdwn.pm
IkiWiki/Plugin/rename.pm
IkiWiki/Plugin/search.pm
debian/NEWS
debian/changelog
debian/control
doc/bugs/Anon_edit_caused_lock_out_on_entire_site_.mdwn [new file with mode: 0644]
doc/bugs/Images_detected_as_application__47__octet-stream__44___not_image__47____42__.mdwn [new file with mode: 0644]
doc/bugs/Intermittent_delays_after_editing__63__.mdwn [new file with mode: 0644]
doc/bugs/Remove_redirect_pages_from_inline_pages.mdwn
doc/bugs/activating_sidebar_makes___34__preferences__34___unusable.mdwn [new file with mode: 0644]
doc/bugs/cannot_login.mdwn [new file with mode: 0644]
doc/bugs/color_plugin_produces_artifacts_in_table-of-contents.mdwn [new file with mode: 0644]
doc/bugs/footnotes-look-weird.mdwn [new file with mode: 0644]
doc/bugs/local.css_overwritten_by_ikiwiki_--setup.mdwn [new file with mode: 0644]
doc/bugs/password_reset_failure.mdwn [new file with mode: 0644]
doc/bugs/po_plugin_config_crasher.mdwn
doc/css_market.mdwn
doc/examples.mdwn
doc/forum/An_error_occurred_while_writing_CGI_reply.mdwn [new file with mode: 0644]
doc/forum/An_error_occurred_while_writing_CGI_reply/comment_1_c7a947be22731dba81c936960089fe11._comment [new file with mode: 0644]
doc/forum/Can_I_disable_discussion_links__63__.mdwn [new file with mode: 0644]
doc/forum/Can_I_disable_discussion_links__63__/comment_1_f4f06262082ec86a95e67fef96113f91._comment [new file with mode: 0644]
doc/forum/Instant_Articles.mdwn [new file with mode: 0644]
doc/forum/Instant_Articles/comment_1_4e8ea5e53feba8eee62e1742f01886cd._comment [new file with mode: 0644]
doc/forum/Translating_ikiwiki_interface/comment_1_389a8173abcc0990f6670796c5f8b227._comment [new file with mode: 0644]
doc/forum/bootstrap_theme.mdwn [new file with mode: 0644]
doc/forum/can__39__t_connect_to_local_url_after_installing_ikiwiki.mdwn [new file with mode: 0644]
doc/forum/can__39__t_connect_to_local_url_after_installing_ikiwiki/comment_1_9feba07c25d226bf63d0886139ed7847._comment [new file with mode: 0644]
doc/forum/lockedit_help.mdwn [new file with mode: 0644]
doc/forum/missing_pages_redirected_to_search-SOLVED/comment_2_bc0291b1afc2e9b4a853c168d3adfd78._comment [new file with mode: 0644]
doc/ikiwiki/directive/format.mdwn
doc/ikiwiki/directive/img.mdwn
doc/ikiwiki/pagespec/attachment.mdwn
doc/news/version_3.20141016.mdwn [deleted file]
doc/news/version_3.20160121.mdwn [new file with mode: 0644]
doc/plugins/contrib/admonition.mdwn [new file with mode: 0644]
doc/plugins/contrib/compile.mdwn
doc/plugins/contrib/listsubscribe.mdwn [new file with mode: 0644]
doc/plugins/contrib/listsubscribe/discussion.mdwn [new file with mode: 0644]
doc/plugins/contrib/remark.mdwn [new file with mode: 0644]
doc/plugins/contrib/remark/discussion.mdwn [new file with mode: 0644]
doc/plugins/typography.mdwn
doc/reviewed.mdwn
doc/sandbox.mdwn
doc/security.mdwn
doc/theme_market.mdwn
doc/themes/discussion.mdwn
doc/tips/Importing_posts_from_Wordpress.mdwn
doc/tips/bootstrap_themes_evaluation.mdwn
doc/tips/convert_moinmoin_to_ikiwiki.mdwn
doc/tips/dot_cgi.mdwn
doc/tips/importing_posts_from_wordpress/ikiwiki-wordpress-import.mdwn
doc/todo/Let_plugins_influence_what_environment_variables_a_wrapper_will_preserve.mdwn
doc/todo/Preferred_option_for___34__Page_location__34__.mdwn [new file with mode: 0644]
doc/todo/Reduce_browser_wait_after_adding_comment.mdwn [new file with mode: 0644]
doc/todo/admonitions.mdwn [new file with mode: 0644]
doc/todo/compatible_templates.mdwn [new file with mode: 0644]
doc/todo/highlight_line_numbers.mdwn [new file with mode: 0644]
doc/todo/merge_bootstrap_branch.mdwn [new file with mode: 0644]
doc/todo/open_external_link_in_new_window.mdwn [new file with mode: 0644]
doc/users/Anton_Eliasson.mdwn [new file with mode: 0644]
doc/users/anton.mdwn [new file with mode: 0644]
doc/users/david_rix.mdwn [new file with mode: 0644]
doc/users/desci.mdwn
doc/users/public.mdwn [new file with mode: 0644]
doc/users/schmonz.mdwn
docwiki.setup
ikiwiki-comment.in
t/cvs.t
t/img.t
t/img/redsquare.jpg [new file with mode: 0644]
templates/revert.tmpl

index 0f27ac419d625aea235184f54fd889a0523ffcfa..fa71f479107a2388fde2fe00a67bfa2daa4fb3a9 100644 (file)
@@ -1647,6 +1647,8 @@ sub preprocess ($$$;$$) {
                                if ($@) {
                                        my $error=$@;
                                        chomp $error;
+                                       eval q{use HTML::Entities};
+                                       $error = encode_entities($error);
                                        $ret="[[!$command <span class=\"error\">".
                                                gettext("Error").": $error"."</span>]]";
                                }
index cbc2fe8eb0c6ce8b0e2b6ac5089e42fdd79b7037..243662386a55f84fc21c6959e136b4de3eaec27c 100644 (file)
@@ -488,6 +488,9 @@ sub cgi (;$$) {
 sub cgierror ($) {
        my $message=shift;
 
+       eval q{use HTML::Entities};
+       $message = encode_entities($message);
+
        print "Content-type: text/html\n\n";
        print cgitemplate(undef, gettext("Error"),
                "<p class=\"error\">".gettext("Error").": $message</p>");
index e93db94ebc0f02d5e940d9092cd894fb9362c20e..b47f965e7b76359d391a5a63db8fbfc2c215a46a 100644 (file)
@@ -356,7 +356,8 @@ sub editcomment ($$) {
        my @page_types;
        if (exists $IkiWiki::hooks{htmlize}) {
                foreach my $key (grep { !/^_/ && isallowed($_) } keys %{$IkiWiki::hooks{htmlize}}) {
-                       push @page_types, [$key, $IkiWiki::hooks{htmlize}{$key}{longname} || $key];
+                       push @page_types, [$key, $IkiWiki::hooks{htmlize}{$key}{longname} || $key]
+                               unless $IkiWiki::hooks{htmlize}{$key}{nocreate};
                }
        }
        @page_types=sort @page_types;
index 78d0704c7fd3b699acbb65df391e475b29fae52b..6ca4b589f507ae595d36bb802a97ee9640f0b9bd 100644 (file)
@@ -305,7 +305,8 @@ sub cgi_editpage ($$) {
                        my @page_types;
                        if (exists $hooks{htmlize}) {
                                foreach my $key (grep { !/^_/ } keys %{$hooks{htmlize}}) {
-                                       push @page_types, [$key, $hooks{htmlize}{$key}{longname} || $key];
+                                       push @page_types, [$key, $hooks{htmlize}{$key}{longname} || $key]
+                                               unless $hooks{htmlize}{$key}{nocreate};
                                }
                        }
                        @page_types=sort @page_types;
index f963f06ba1d35a4c0a6ae28bac90bbe35d3e0e8f..bfca933fd8a18c5722876c2128a22716a1d325aa 100644 (file)
@@ -654,7 +654,7 @@ sub rcs_add ($) {
 
        ensure_committer();
 
-       run_or_cry('git', 'add', $file);
+       run_or_cry('git', 'add', '--', $file);
 }
 
 sub rcs_remove ($) {
@@ -664,7 +664,7 @@ sub rcs_remove ($) {
 
        ensure_committer();
 
-       run_or_cry('git', 'rm', '-f', $file);
+       run_or_cry('git', 'rm', '-f', '--', $file);
 }
 
 sub rcs_rename ($$) {
@@ -672,7 +672,7 @@ sub rcs_rename ($$) {
 
        ensure_committer();
 
-       run_or_cry('git', 'mv', '-f', $src, $dest);
+       run_or_cry('git', 'mv', '-f', '--', $src, $dest);
 }
 
 sub rcs_recentchanges ($) {
index 169f5e7137a99739501c170561b164d3c4e8825d..494fe2335fc6de1d3723c97efc2d73ecc17b0a20 100644 (file)
@@ -21,6 +21,28 @@ sub getsetup () {
                        rebuild => undef,
                        section => "widget",
                },
+               img_allowed_formats => {
+                       type => "string",
+                       default => [qw(jpeg png gif svg)],
+                       description => "Image formats to process (jpeg, png, gif, svg, pdf or 'everything' to accept all)",
+                       # ImageMagick has had arbitrary code execution flaws,
+                       # and the whole delegates mechanism is scary from
+                       # that perspective
+                       safe => 0,
+                       rebuild => 0,
+               },
+}
+
+sub allowed {
+       my $format = shift;
+       my $allowed = $config{img_allowed_formats};
+       $allowed = ['jpeg', 'png', 'gif', 'svg'] unless defined $allowed && @$allowed;
+
+       foreach my $a (@$allowed) {
+               return 1 if $a eq $format || $a eq 'everything';
+       }
+
+       return 0;
 }
 
 sub preprocess (@) {
@@ -64,94 +86,165 @@ sub preprocess (@) {
 
        my $dir = $params{page};
        my $base = IkiWiki::basename($file);
-       my $issvg = $base=~s/\.svg$/.png/i;
+       my $extension;
+       my $format;
+
+       if ($base =~ m/\.([a-z0-9]+)$/) {
+               $extension = $1;
+       }
+       else {
+               error gettext("Unable to detect image type from extension");
+       }
+
+       # Never interpret well-known file extensions as any other format,
+       # in case the wiki configuration unwisely allows attaching
+       # arbitrary files named *.jpg, etc.
+       my $magic;
+       my $offset = 0;
+       open(my $in, '<', $srcfile) or error sprintf(gettext("failed to read %s: %s"), $file, $!);
+       binmode($in);
+
+       if ($extension =~ m/^(jpeg|jpg)$/is) {
+               $format = 'jpeg';
+               $magic = "\377\330\377";
+       }
+       elsif ($extension =~ m/^(png)$/is) {
+               $format = 'png';
+               $magic = "\211PNG\r\n\032\n";
+       }
+       elsif ($extension =~ m/^(gif)$/is) {
+               $format = 'gif';
+               $magic = "GIF8";
+       }
+       elsif ($extension =~ m/^(svg)$/is) {
+               $format = 'svg';
+       }
+       elsif ($extension =~ m/^(pdf)$/is) {
+               $format = 'pdf';
+               $magic = "%PDF-";
+       }
+       else {
+               # allow ImageMagick to auto-detect (potentially dangerous)
+               $format = '';
+       }
+
+       error sprintf(gettext("%s image processing disabled in img_allowed_formats configuration"), $format ? $format : "\"$extension\"") unless allowed($format ? $format : "everything");
+
+       # Try harder to protect ImageMagick from itself
+       if (defined $magic) {
+               my $content;
+               read($in, $content, length $magic) or error sprintf(gettext("failed to read %s: %s"), $file, $!);
+               if ($magic ne $content) {
+                       error sprintf(gettext("\"%s\" does not seem to be a valid %s file"), $file, $format);
+               }
+       }
+
        my $ispdf = $base=~s/\.pdf$/.png/i;
        my $pagenumber = exists($params{pagenumber}) ? int($params{pagenumber}) : 0;
        if ($pagenumber != 0) {
                $base = "p$pagenumber-$base";
        }
 
-       eval q{use Image::Magick};
-       error gettext("Image::Magick is not installed") if $@;
-       my $im = Image::Magick->new();
        my $imglink;
        my $imgdatalink;
-       my $r = $im->Read(":$srcfile\[$pagenumber]");
-       error sprintf(gettext("failed to read %s: %s"), $file, $r) if $r;
+       my ($dwidth, $dheight);
 
-       if (! defined $im->Get("width") || ! defined $im->Get("height")) {
-               error sprintf(gettext("failed to get dimensions of %s"), $file);
+       my ($w, $h);
+       if ($params{size} ne 'full') {
+               ($w, $h) = ($params{size} =~ /^(\d*)x(\d*)$/);
        }
 
-       my ($dwidth, $dheight);
+       if ($format eq 'svg') {
+               # svg images are not scaled using ImageMagick because the
+               # pipeline is complex. Instead, the image size is simply
+               # set to the provided values.
+               #
+               # Aspect ratio will be preserved automatically when
+               # only a width or only a height is specified.
+               # When both are specified, aspect ratio will not be
+               # preserved.
+               $imglink = $file;
+               $dwidth = $w if length $w;
+               $dheight = $h if length $h;
+       }
+       else {
+               eval q{use Image::Magick};
+               error gettext("Image::Magick is not installed") if $@;
+               my $im = Image::Magick->new();
+               my $r = $im->Read("$format:$srcfile\[$pagenumber]");
+               error sprintf(gettext("failed to read %s: %s"), $file, $r) if $r;
+
+               if (! defined $im->Get("width") || ! defined $im->Get("height")) {
+                       error sprintf(gettext("failed to get dimensions of %s"), $file);
+               }
 
-       if ($params{size} eq 'full') {
-               $dwidth = $im->Get("width");
-               $dheight = $im->Get("height");
-       } else {
-               my ($w, $h) = ($params{size} =~ /^(\d*)x(\d*)$/);
-               error sprintf(gettext('wrong size format "%s" (should be WxH)'), $params{size})
-                       unless (defined $w && defined $h &&
-                               (length $w || length $h));
-
-               if ($im->Get("width") == 0 || $im->Get("height") == 0) {
-                       ($dwidth, $dheight)=(0, 0);
-               } elsif (! length $w || (length $h && $im->Get("height")*$w > $h * $im->Get("width"))) {
-                       # using height because only height is given or ...
-                       # because original image is more portrait than $w/$h
-                       # ... slimness of $im > $h/w
-                       # ... $im->Get("height")/$im->Get("width") > $h/$w
-                       # ... $im->Get("height")*$w > $h * $im->Get("width")
-
-                       $dheight=$h;
-                       $dwidth=$h / $im->Get("height") * $im->Get("width");
-               } else { # (! length $h) or $w is what determines the resized size
-                       $dwidth=$w;
-                       $dheight=$w / $im->Get("width") * $im->Get("height");
+               if (! length $w && ! length $h) {
+                       $dwidth = $im->Get("width");
+                       $dheight = $im->Get("height");
+               } else {
+                       error sprintf(gettext('wrong size format "%s" (should be WxH)'), $params{size})
+                               unless (defined $w && defined $h &&
+                                       (length $w || length $h));
+
+                       if ($im->Get("width") == 0 || $im->Get("height") == 0) {
+                               ($dwidth, $dheight)=(0, 0);
+                       } elsif (! length $w || (length $h && $im->Get("height")*$w > $h * $im->Get("width"))) {
+                               # using height because only height is given or ...
+                               # because original image is more portrait than $w/$h
+                               # ... slimness of $im > $h/w
+                               # ... $im->Get("height")/$im->Get("width") > $h/$w
+                               # ... $im->Get("height")*$w > $h * $im->Get("width")
+
+                               $dheight=$h;
+                               $dwidth=$h / $im->Get("height") * $im->Get("width");
+                       } else { # (! length $h) or $w is what determines the resized size
+                               $dwidth=$w;
+                               $dheight=$w / $im->Get("width") * $im->Get("height");
+                       }
                }
-       }
 
-       if ($dwidth < $im->Get("width") || $ispdf) {
-               # resize down, or resize to pixels at all
+               if ($dwidth < $im->Get("width") || $ispdf) {
+                       # resize down, or resize to pixels at all
 
-               my $outfile = "$config{destdir}/$dir/$params{size}-$base";
-               $imglink = "$dir/$params{size}-$base";
+                       my $outfile = "$config{destdir}/$dir/$params{size}-$base";
+                       $imglink = "$dir/$params{size}-$base";
 
-               will_render($params{page}, $imglink);
+                       will_render($params{page}, $imglink);
 
-               if (-e $outfile && (-M $srcfile >= -M $outfile)) {
-                       $im = Image::Magick->new;
-                       $r = $im->Read($outfile);
-                       error sprintf(gettext("failed to read %s: %s"), $outfile, $r) if $r;
-               }
-               else {
-                       $r = $im->Resize(geometry => "${dwidth}x${dheight}");
-                       error sprintf(gettext("failed to resize: %s"), $r) if $r;
-
-                       $im->set(($issvg || $ispdf) ? (magick => 'png') : ());
-                       my @blob = $im->ImageToBlob();
-                       # don't actually write resized file in preview mode;
-                       # rely on width and height settings
-                       if (! $params{preview}) {
-                               writefile($imglink, $config{destdir}, $blob[0], 1);
+                       if (-e $outfile && (-M $srcfile >= -M $outfile)) {
+                               $im = Image::Magick->new;
+                               $r = $im->Read($outfile);
+                               error sprintf(gettext("failed to read %s: %s"), $outfile, $r) if $r;
                        }
                        else {
-                               eval q{use MIME::Base64};
-                               error($@) if $@;
-                               $imgdatalink = "data:image/".$im->Get("magick").";base64,".encode_base64($blob[0]);
+                               $r = $im->Resize(geometry => "${dwidth}x${dheight}");
+                               error sprintf(gettext("failed to resize: %s"), $r) if $r;
+
+                               $im->set($ispdf ? (magick => 'png') : ());
+                               my @blob = $im->ImageToBlob();
+                               # don't actually write resized file in preview mode;
+                               # rely on width and height settings
+                               if (! $params{preview}) {
+                                       writefile($imglink, $config{destdir}, $blob[0], 1);
+                               }
+                               else {
+                                       eval q{use MIME::Base64};
+                                       error($@) if $@;
+                                       $imgdatalink = "data:image/".$im->Get("magick").";base64,".encode_base64($blob[0]);
+                               }
                        }
+
+                       # always get the true size of the resized image (it could be
+                       # that imagemagick did its calculations differently)
+                       $dwidth  = $im->Get("width");
+                       $dheight = $im->Get("height");
+               } else {
+                       $imglink = $file;
                }
 
-               # always get the true size of the resized image (it could be
-               # that imagemagick did its calculations differently)
-               $dwidth  = $im->Get("width");
-               $dheight = $im->Get("height");
-       } else {
-               $imglink = $file;
-       }
-       
-       if (! defined($dwidth) || ! defined($dheight)) {
-               error sprintf(gettext("failed to determine size of image %s"), $file)
+               if (! defined($dwidth) || ! defined($dheight)) {
+                       error sprintf(gettext("failed to determine size of image %s"), $file)
+               }
        }
 
        my ($fileurl, $imgurl);
@@ -170,10 +263,10 @@ sub preprocess (@) {
                }
        }
        
-       my $imgtag='<img src="'.$imgurl.
-               '" width="'.$dwidth.
-               '" height="'.$dheight.'"'.
-               $attrs.
+       my $imgtag='<img src="'.$imgurl.'"';
+       $imgtag.=' width="'.$dwidth.'"' if defined $dwidth;
+       $imgtag.=' height="'.$dheight.'"' if defined $dheight;
+       $imgtag.= $attrs.
                (exists $params{align} && ! exists $params{caption} ? ' align="'.$params{align}.'"' : '').
                ' />';
 
index 26c80b4ce4c3a23423daff216b539217abea0307..17539ce8afe33fc9896803fe56a88d36a04bc0d1 100644 (file)
@@ -94,7 +94,6 @@ sub checkconfig () {
                my $real_cgi_signin;
                my $otherform_label=gettext("Other");
                if (keys %{$IkiWiki::hooks{auth}} > 1) {
-                       $real_cgi_signin=\&IkiWiki::cgi_signin;
                        # Special case to avoid labeling password auth as
                        # "Other" when it's the only auth plugin not
                        # integrated with the loginselector.
@@ -106,6 +105,9 @@ sub checkconfig () {
                        if (keys %h == 1 && exists $h{passwordauth}) {
                                $otherform_label=gettext("Password");
                        }
+                       if (keys %h > 0) {
+                               $real_cgi_signin=\&IkiWiki::cgi_signin;
+                       }
                }
                inject(name => "IkiWiki::cgi_signin", call => sub ($$) {
                        login_selector($real_cgi_signin, $otherform_label, @_);
index 014e78eea124604e249d35d42a6b9ccf6524c254..daf9d592e4189e1e06d279b568e43db3b3858262 100644 (file)
@@ -9,6 +9,7 @@ use IkiWiki 3.00;
 sub import {
        hook(type => "getsetup", id => "mdwn", call => \&getsetup);
        hook(type => "htmlize", id => "mdwn", call => \&htmlize, longname => "Markdown");
+       hook(type => "htmlize", id => "md", call => \&htmlize, longname => "Markdown (popular file extension)", nocreate => 1);
 }
 
 sub getsetup () {
index 6d56340b896519e921e9b6c7d8a06ffd1d56fe2a..4a86d5a09b11f1e5097b053c6624cf0080f13796 100644 (file)
@@ -141,7 +141,8 @@ sub rename_form ($$$) {
                my @page_types;
                if (exists $IkiWiki::hooks{htmlize}) {
                        foreach my $key (grep { !/^_/ } keys %{$IkiWiki::hooks{htmlize}}) {
-                               push @page_types, [$key, $IkiWiki::hooks{htmlize}{$key}{longname} || $key];
+                               push @page_types, [$key, $IkiWiki::hooks{htmlize}{$key}{longname} || $key]
+                                       unless $IkiWiki::hooks{htmlize}{$key}{nocreate};
                        }
                }
                @page_types=sort @page_types;
index 24b16fe2a78c4607f89788cd78ea1d7e5a1ac137..f9193b6aad5f4d4cbd385d9fb18e586436654679 100644 (file)
@@ -34,7 +34,7 @@ sub getsetup () {
                        rebuild => 0,
                },
                google_search => {
-                       type => "booblean",
+                       type => "boolean",
                        example => 1,
                        description => "use google site search rather than internal xapian index?",
                        safe => 1,
index b2753c638f5580aa5b6594f598715dbcd3cd4272..e169658ea28b4f362b5528a98a34daad4e4e7848 100644 (file)
@@ -1,3 +1,27 @@
+ikiwiki (3.20160506) unstable; urgency=medium
+
+  To mitigate CVE-2016-3714 and similar ImageMagick security vulnerabilities,
+  the [[!img]] directive is now restricted to these common web formats by
+  default:
+
+  * JPEG (.jpg, .jpeg)
+  * PNG (.png)
+  * GIF (.gif)
+  * SVG (.svg)
+
+  (In particular, by default resizing PDF files is no longer allowed.)
+
+  Additionally, resized SVG files are displayed in the browser as SVG
+  instead of being converted to PNG.
+
+  If all users who can attach images are fully trusted, this restriction
+  can be removed with the new img_allowed_formats setup option.
+  See <https://ikiwiki.info/ikiwiki/directive/img/>
+  or <file:///usr/share/doc/ikiwiki/html/ikiwiki/directive/img.html> for
+  more details.
+
+ -- Simon McVittie <smcv@debian.org>  Fri, 06 May 2016 07:49:56 +0100
+
 ikiwiki (3.20150610) unstable; urgency=low
 
   The new "emailauth" plugin allows users to authenticate using an email
index a2be64c35fa4776c3f4544b61f8c102cb69975eb..2fdfc0525649cc339ca0a8b063ff825a1815040b 100644 (file)
@@ -1,3 +1,40 @@
+ikiwiki (3.20160506) unstable; urgency=medium
+
+  [ Simon McVittie ]
+  * img: stop ImageMagick trying to be clever if filenames contain a colon,
+    avoiding mis-processing
+  * HTML-escape error messages, in one case avoiding potential cross-site
+    scripting (OVE-20160505-0012)
+  * Mitigate ImageMagick vulnerabilities such as CVE-2016-3714:
+    - img: force common Web formats to be interpreted according to extension,
+      so that "allowed_attachments: '*.jpg'" does what one might expect
+    - img: restrict to JPEG, PNG and GIF images by default, again mitigating
+      CVE-2016-3714 and similar vulnerabilities
+    - img: check that the magic number matches what we would expect from
+      the extension before giving common formats to ImageMagick
+  * d/control: use https for Homepage
+  * d/control: add Vcs-Browser
+
+  [ Joey Hess ]
+  * img: Add back support for SVG images, bypassing ImageMagick and
+    simply passing the SVG through to the browser, which is supported by all
+    commonly used browsers these days.
+    SVG scaling by img directives has subtly changed; where before
+    size=wxh would preserve aspect ratio, this cannot be done when passing
+    them through and so specifying both a width and height can change
+    the SVG's aspect ratio.
+  * loginselector: When only openid and emailauth are enabled, but
+    passwordauth is not, avoid showing a "Other" box which opens an
+    empty form.
+
+  [ Amitai Schlair ]
+  * mdwn: Process .md like .mdwn, but disallow web creation.
+
+  [ Florian Wagner ]
+  * git: Correctly handle filenames starting with a dash in add/rm/mv.
+
+ -- Simon McVittie <smcv@debian.org>  Fri, 06 May 2016 07:54:26 +0100
+
 ikiwiki (3.20160121~ppa1) trusty; urgency=medium
 
   * Untested backport to Ubuntu trusty. No source changes.
index 8af788c2db1311da9c088face9e3ef94a2612709..60d0e82dbc008bc60fdcef21510e8b8e18208bdf 100644 (file)
@@ -17,7 +17,7 @@ Build-Depends-Indep:
  libhtml-scrubber-perl,
  libhtml-template-perl,
  libimage-magick-perl | perlmagick,
- libmagickcore-6.q16-2-extra | libmagickcore-extra,
+ libmagickcore-extra,
  libnet-openid-consumer-perl,
  librpc-xml-perl,
  libtext-markdown-discount-perl,
@@ -33,8 +33,9 @@ Maintainer: Simon McVittie <smcv@debian.org>
 Uploaders:
  Josh Triplett <josh@freedesktop.org>,
 Standards-Version: 3.9.6
-Homepage: http://ikiwiki.info/
+Homepage: https://ikiwiki.info/
 Vcs-Git: git://git.ikiwiki.info/
+Vcs-Browser: http://source.ikiwiki.branchable.com/?p=source.git;a=summary
 Testsuite: autopkgtest-pkg-perl
 
 Package: ikiwiki
diff --git a/doc/bugs/Anon_edit_caused_lock_out_on_entire_site_.mdwn b/doc/bugs/Anon_edit_caused_lock_out_on_entire_site_.mdwn
new file mode 100644 (file)
index 0000000..a669413
--- /dev/null
@@ -0,0 +1,59 @@
+Probably caused by something misconfigured about the [[plugins/comments]] plugin.
+
+---
+
+## Config
+
+My setup file:
+
+    # comments plugin
+    # PageSpec of pages where comments are allowed
+    comments_pagespec: forum/* or blog/posts/* or tarefa/*
+    # PageSpec of pages where posting new comments is not allowed
+    comments_closed_pagespec: ''
+    # Base name for comments, e.g. "comment_" for pages like "sandbox/comment_12"
+    comments_pagename: comment_
+    # Interpret directives in comments?
+    #comments_allowdirectives: 0
+    # Allow anonymous commenters to set an author name?
+    comments_allowauthor: 1
+    # commit comments to the VCS
+    comments_commit: 1
+    # Restrict formats for comments to (no restriction if empty)
+    comments_allowformats: mdwn txt
+
+The `moderatedcomments` plugins is **not** enabled
+
+The `anonok` plugin is **not** enabled
+
+---
+
+## Steps
+
+I've tried to place a comment clicking in the obvious [Add a comment](https://dev.iikb.xyz/ikiwiki.cgi?do=comment&page=forum%2FTema_bootstrap) in a [forum post](https://dev.iikb.xyz/forum/Tema_bootstrap/).
+
+I've not signed in because the *sign in* page didn't come up, instead a simple `(You might want to Signin first?)` showed up, which I've haven't read and commented away.
+
+---
+
+## Results
+
+As a consequence of that, the user '' - that's a null character, have somehow logged in and it seems that there is no way to [log it out](https://dev.iikb.xyz/ikiwiki.cgi?do=prefs).
+
+None of this phantom user edits are being commited - this [blog post](https://dev.iikb.xyz/blog/posts/Bug_severo_neste_site/) was made with that user logged in via web.
+
+It seems I can't log out from nowhere. I've rebuild the wiki from the command line and restarted the nginx server, the phantom user remains logged in and open to anyone willing to edit away the wiki.
+
+---
+
+## Conclusion
+
+If I wanted to do a totally anonnymous wiki, this would be the best setup ever.
+
+For [this particular installation](https://dev.iikb.xyz), that's not the case.
+
+---
+
+## Question
+
+Is there a session file or something to logout this phantom user?
diff --git a/doc/bugs/Images_detected_as_application__47__octet-stream__44___not_image__47____42__.mdwn b/doc/bugs/Images_detected_as_application__47__octet-stream__44___not_image__47____42__.mdwn
new file mode 100644 (file)
index 0000000..29b7114
--- /dev/null
@@ -0,0 +1,47 @@
+Steps to reproduce:
+
+ * Running ikiwiki version 3.20130904.1ubuntu1 on Ubuntu 14.04 LTS
+ * Also installed `perlmagick` and `libxml-writer-perl`
+ * Enable attachment plugin
+ * Set attachment rule to `mimetype(image/*)`
+ * Attempt to attach an image (e.g. downloaded version of https://commons.wikimedia.org/wiki/Category:Lolcats#/media/File:You_gotz_a_lolcat.jpg )
+
+What should happen:
+
+ * Attachment is uploaded
+
+What happens instead:
+
+ * Error message: `prohibited by allowed_attachments (file MIME type is application/octet-stream, not image/*)`
+
+Workaround:
+
+ * Change attachment rule to `mimetype(image/*) or application/octet-stream`
+
+Other notes:
+
+ * Downloading and uploading from a Windows machine via Firefox
+
+---
+
+> File type detection relies on some of the external packages in ikiwiki's Suggests list.
+>
+> Do you have [[!ubupkg file]] installed?
+>
+> Do you have [[!ubupkg libfile-mimeinfo-perl]] installed?
+>
+> --[[smcv]]
+>
+> Yup, we have both of those installed. -- [[David Rix]]
+
+>> This is probably the same thing as
+>> [[bugs/can't upload a simple png image: prohibited by allowed__95__attachments (file MIME type is application__47__octet-stream...]]
+>> which was [[fixed in 2014|done]]. You could open a bug on Launchpad, but
+>> since ikiwiki is in Ubuntu `universe`, it will probably never receive bug fixes.
+>>
+>> I would suggest either upgrading to a version of ikiwiki from a newer Debian or
+>> Ubuntu suite (I'm using the latest release 3.20160121 myself), or applying
+>> [the patch](http://source.ikiwiki.branchable.com/?p=source.git;a=commitdiff;h=77a2267dcfb103b63a675e4a2226076166b29d3f)
+>> manually. --[[smcv]]
+
+>>> Thanks so much for digging into that! There's a new LTS around the corner with a [newer (post 2014) version of ikiwiki](http://packages.ubuntu.com/xenial/ikiwiki) so we can probably afford to wait and/or switch to a self-managed packaged. -- [[David Rix]]
diff --git a/doc/bugs/Intermittent_delays_after_editing__63__.mdwn b/doc/bugs/Intermittent_delays_after_editing__63__.mdwn
new file mode 100644 (file)
index 0000000..9671925
--- /dev/null
@@ -0,0 +1,47 @@
+Steps to reproduce:
+
+ * Running ikiwiki version 3.20130904.1ubuntu1 on Ubuntu 14.04 LTS
+ * ikiwiki accessed via `https://DOMAIN/wiki/ikiwiki.cgi` using fcgiwrap and Nginx
+ * Start ikiwiki site
+ * Edit an existing page
+
+What should happen:
+
+ * Change is immediately available
+
+What happens instead:
+
+ * Change is sometimes not immediately available
+ * After (approx) 1-2 minutes, change is available
+
+Other notes:
+
+ * Similarly for creating new pages
+ * Not consistent (the next edit may be visible immediately)
+ * If changes are visible from one browser, may not be visible from another browser on a different machine, logged in as the same user (admin)
+ * Seems to be happening less / not at all after running the site for approx 30-60 minutes
+ * fcgiwrap is invoked with Supervisor (aka supervisord)
+ * Related Nginx location blocks:
+
+```
+# non-wiki files at DOMAIN/...
+location / {
+    try_files $uri $uri/ /index.html =404;
+}
+
+# wiki files at DOMAIN/wiki
+location /wiki {
+    alias /home/USERNAME/public_html/WIKINAME;
+}
+
+# wiki script at DOMAIN/wiki/ikiwiki.cgi
+location /wiki/ikiwiki.cgi {
+    fastcgi_pass  unix:/tmp/fcgi.socket;
+    fastcgi_index ikiwiki.cgi;
+    fastcgi_param SCRIPT_FILENAME    /home/USERNAME/public_html/WIKINAME/ikiwiki.cgi;
+    fastcgi_param DOCUMENT_ROOT    /home/USERNAME/public_html/WIKINAME;
+    include /etc/nginx/fastcgi_params;
+}
+```
+
+Please let me know if this is expected/known, and/or if there's anything helpful I can add to the report.
index a43bd408f4ada0d0dfbfb3db3e658c0c04f1edbb..a9067e049c98fc9c4688e77ebdafa72b3146ae7a 100644 (file)
@@ -13,3 +13,9 @@ Any ideas how to handle this situation?
 
 > Well, you can adjust the inline's pagespec to exclude it, or even tag it
 > with a tag that the pagespec is adjusted to exclude. --[[Joey]]
+
+>> I did it by making a new tag called "redir", tagging the redir page with it and then modifying the *pages* attribute of my inline to exclude pages with that tag. However, there is the same problem with the archives, probably the [[plugins/calendar]] if you use that and likely some other cases that I haven't thought about. In all these places you need to explicitly exclude redir pages. I think that ideally redir pages should have some special treatment that excludes them by default in most situations, because they are not real pages in a sense. They can have a body but if the browser is working properly it will never be shown.
+>>
+>> How about adding a new PageSpec called redir(glob) and excluding such pages from the post(glob) PageSpec? I think this behaviour makes more sense and thus should be the default, but if a user wants the old behaviour that's still available as "page(glob) or redir(glob)".
+>>
+>> Good URL redirections are important because they allow you to move things around without breaking incoming links from external sites and people's browsing history (which you can't fix, unlike internal links). --[[anton]], 2016-01-31
diff --git a/doc/bugs/activating_sidebar_makes___34__preferences__34___unusable.mdwn b/doc/bugs/activating_sidebar_makes___34__preferences__34___unusable.mdwn
new file mode 100644 (file)
index 0000000..f3c9e91
--- /dev/null
@@ -0,0 +1,14 @@
+I have an ikiwiki, where I activated the plug-in sidebar: 
+* enable sidebar? yes
+* show sidebar page on all pages? yes
+
+In order to create the page, I add a link to it on my entrance page: \[[sidebar]].
+I now can choose where to put it, I put it as "sidebar", not index/sidebar. Language is Markdown, nothing else installed on the system.
+After saving I can create the page clicking on the "?" and I fill it with links and the plugin pagestats.
+The sidbar appears properly on all pages, also the tag-cloud.
+
+However, when I try to go into "preferences" I just get an error message, saying it has the format html: "Content-type: text/html "
+The entire html is
+\<html><head></head><body>Content-type: text/html</body></html>
+
+What is happening?
diff --git a/doc/bugs/cannot_login.mdwn b/doc/bugs/cannot_login.mdwn
new file mode 100644 (file)
index 0000000..d8a8d5a
--- /dev/null
@@ -0,0 +1,85 @@
+I can't seem to login to ikiwiki sites reliably anymore.
+
+I am not sure what is going on. It affects this wiki and the git-annex
+wiki. I am editing this through the anonymous git push interface.
+
+OpenID is failing on me. That is, sometimes it works, sometimes it
+doesn't. For example, while writing this, I clicked the "Preferences"
+link and I seemed to have been logged in automatically without
+problem, even though I previously *tried* to login and failed with an
+error similar to [[bugs/Error:_OpenID_failure:_time_bad_sig:]], which
+of course I cannot reproduce anymore on ikiwiki.info now:
+
+    Error: OpenID failure: time_bad_sig: Return_to signature is not
+    valid.
+
+I *can* still reproduce this on the git-annex wiki, however, which is
+odd. This *could* be because the OpenID host is screwing up, as I am
+not directly responsible for that box anymore... but then why would it
+work on one wiki and not the other?
+
+But worse, I cannot login with my regular non-OpenID user, which I
+started using more regularly now. When I type the wrong password, the
+login form gives me "Invalid entry" next to the password field. But
+then if I do a password recall and reset my password, I get a
+different error:
+
+    Error: login failed, perhaps you need to turn on cookies?
+
+That happens reliably on git-annex.branchable.com. ikiwiki.info seems
+to be more stable: i can eventually login. i can login to my personal
+wiki with OpenID fine. I can also login to branchable.com itself with
+openid without issues.
+
+So I guess the problem is mostly with git-annex.branchable.com? Not
+sure how to debug this further.
+
+Thanks. --[[anarcat]]
+
+Update: now I can't login to the ikiwiki.info site anymore, getting
+the same errors as on the git-annex site.
+
+Update2: it seems this is specific to the HTTP/HTTPS switch. If I use HTTPS, things work fine, but not with plain HTTP. So I'm moving this to the branchable wiki, as I am not having that problem on other ikiwiki sites. Maybe the bug specific to ikiwiki is the lack of clarity in figuring out wth is going on here... See <http://www.branchable.com/bugs/login_failures_without_https>
+
+> This seems to be a concacentation of multiple unrelated problems with
+> different stuff, which is not a good bug report technique. Then to add to
+> the fun, you filed the same bug on branchable too. Sigh!
+> 
+> The `time_bad_sig` problem with the perl openid library is a problem I am
+> aware of but it's not clear if the problem is clock skew, or a protocol
+> problem. At least one user to report it seemed to get it due to a http
+> proxy. I'm pretty sure it could also happen if multiple openid logins
+> were attempted at the same time (the `consumer_secret` which is stored
+> server-side is used). The problem is not specific to ikiwiki.
+> 
+> Ikiwiki says "login failed, perhaps you need to turn on cookies?" when
+> the user successfully logged in, but their cookie does not indicate why
+> they were logging in to begin with, so ikiwiki does not know what action
+> to continue to. One way to get this when cookies are enabled is to
+> re-post a login form after already using it, by eg using the back button
+> to go back to a previous login form and try to reuse it.
+> 
+> --[[Joey]]
+
+>> I am sorry. I thought the problem was originally related to ikiwiki
+>> then figured it was *only* happening on branchable sites, so I figured
+>> it was better to report it on the branchable.com forums.
+>>
+>> I know that there's a OpenID-specific issue, but I had such issues in
+>> the past and succesfuly solved those. Because the timing of the emergence
+>> of the problem, i felt there was a correlation between the two issues.
+>>
+>> And indeed, there seems to be a HTTPS-related issue: both login mechanisms
+>> work fine when on HTTPS, and both fail on HTTP. So I don't see those things
+>> as being necessarily distinct. -- [[anarcat]]
+
+>>> I've explained how the "login failed, perhaps you need to turn on
+>>> cookies?" can happen and what it means. Clearly nothing to do with
+>>> http; clearly not specific to branchable.
+>>> 
+>>> I just now logged into this site using openid over http, and it worked
+>>> ok. I think it's more likely that the `time_bad_sig` problem occurs
+>>> intermittently (which would make sense if it's a timing related issue),
+>>> and so you've just so happened to see it when logging in with
+>>> http and not https, than that there's actually a correlation.
+>>> --[[Joey]]
diff --git a/doc/bugs/color_plugin_produces_artifacts_in_table-of-contents.mdwn b/doc/bugs/color_plugin_produces_artifacts_in_table-of-contents.mdwn
new file mode 100644 (file)
index 0000000..d4dae77
--- /dev/null
@@ -0,0 +1,81 @@
+# Bug Descriptipn 
+
+If color and toc plugins are enabled and you use colored headers, those headers are never colored but sometimes are prefixed with text artifacts like "color: red".
+
+Example: The header 
+
+    # [[!color  foreground=red text="Testing"]]
+
+would sometimes be seen in the toc as
+
+    color: redTesting
+
+Reason for this behaviour is: 
+
+1. the color plugin uses a special syntax to preserve the color through sanitize and that syntax has a plain text component. 
+1. the toc plugin removes everything except plain text from headers in the toc
+1. if the toc plugin is executed before the color plugin in the format hook it sees the special syntax and clobbers the toc, otherwise it just removes the color markup
+
+# Solutions
+
+There are a few possible solutions to this depending on how it should work:
+
+1. The easiest thing would be to just add a "last" parameter to the toc plugin format hook (or "first" to the color plugin). Result: No color in tocs at all
+1. Adding four (**EDIT** seven) lines to toc.pm (and possibly removing ~4 now superfluous lines **EDIT** No) would make it preserve ALL markup in headers, color as well as html markup or markdown (*emphasize* for example). Execution order of the plugins would not matter at all
+1. A bit more code would be necessary to just specifically preserve the color, but nothing else
+
+I would propose implementing the second option because visual markers in headers are useful to convey additional information very fast and this information should be preserved in the toc. Example: Bug or task/project tracker with color conveying status of the bug or task.
+
+It seems you can stuff anything into ordered lists (according to w3.orgs doku), so apart from stylistic reasons I don't see any problems with markup in the toc. 
+
+# Patch
+
+This is the proposed patch to the second solution. I did not yet test it with the latest version of ikiwiki, but I did check that both plugins are identical in my test versions and the latest. I will update my wikis in use to the latest version and test it further, anyway. 
+
+The part that could probably be removed in toc is the handler call "$p->handler(text => sub {" in line 110. It collects all text in the header as HTML::Parser "dtext", which means entities are decoded in the text. Since that step is probably already done in ikiwiki or doesn't need to be done (otherwise ikiwiki with toc.pm disabled would not work correctly) I'm pretty sure the "dtext" is not necessary. And in that case the patch below would just collect that text in the default handler. Not tested at all, I want to hear a second opinion first. 
+
+**EDIT** Ok, the handler call is still necessary, but the "dtext" could be changed to "text". Also I needed to add 3 more lines, the patch below is up to date. It works with all markup and markdown I could think of. The only case not handled optimal is if the header is just a link and nothing else, then there is no text left for the local link, the toc links directly to a different page. Is that acceptable or not?
+
+(Should I upload this patch as a branch to ikiwiki.info? Not sure about how patch submission works here)
+
+    diff --git a/IkiWiki/Plugin/toc.pm b/IkiWiki/Plugin/toc.pm
+    index ac07b9a..5c2b056 100644
+    --- a/IkiWiki/Plugin/toc.pm
+    +++ b/IkiWiki/Plugin/toc.pm
+    @@ -57,6 +57,7 @@ sub format (@) {
+           my $startlevel=($params{startlevel} ? $params{startlevel} : 0);
+           my $curlevel=$startlevel-1;
+           my $liststarted=0;
+    +  my $headercollect=0;
+           my $indent=sub { "\t" x $curlevel };
+           $p->handler(start => sub {
+                   my $tagname=shift;
+    @@ -107,6 +108,7 @@ sub format (@) {
+                           $index.=&$indent."<li class=\"L$curlevel\">".
+                                   "<a href=\"#$anchor\">";
+
+    +                  $headercollect=1;
+                           $p->handler(text => sub {
+                                   $page.=join("", @_);
+                                   $index.=join("", @_);
+    @@ -117,12 +119,17 @@ sub format (@) {
+                                           $p->handler(text => undef);
+                                           $p->handler(end => undef);
+                                           $index.="</a>\n";
+    +                                  $headercollect=0;
+    +                          }
+    +                          else {
+    +                              $index.=join("",@_);
+                                   }
+                                   $page.=join("", @_);
+                           }, "tagname, text");
+                   }
+                   else {
+                           $page.=$text;
+    +                  $index.=$text if ($headercollect);
+                   }
+           }, "tagname, text");
+           $p->handler(default => sub { $page.=join("", @_) }, "text");
+    -- 
+    1.8.4.5
+
diff --git a/doc/bugs/footnotes-look-weird.mdwn b/doc/bugs/footnotes-look-weird.mdwn
new file mode 100644 (file)
index 0000000..be1e5d5
--- /dev/null
@@ -0,0 +1,127 @@
+Multimarkdown footnotes are pretty useful. If they are enabled in a
+wiki, they don't look so good with the default stylesheet, however, as
+the references are in the same size and positioning as everything
+else.
+
+This particular wiki does not use multimarkdown, so there's no easy
+way to demonstrate this here, you'll have to trust me on this. :)
+
+The following stylesheet should be added to `style.css`:
+
+    a.footnote { vertical-align: super; font-size: xx-small; }
+    div.footnotes { font-size: small; }
+
+This is a typical style that user-agents apply to the `<sup>` tag. For
+example, chromium has this builtin style for `<sup>`:
+
+    vertical-align: super;
+    font-size: smaller;
+
+Bootstrap uses this instead:
+
+    sup {
+        top: -.5em;
+    }
+    
+    sub, sup {
+        position: relative;
+        font-size: 75%;
+        line-height: 0;
+        vertical-align: baseline;
+    }
+
+I settled on `xx-small` because it's the only size that doesn't affect
+line-height here. However, Bootstrap's way may be better.
+
+At any rate, the correct way to fix this is to *avoid* custom styling
+and use the `<sup>` tag for the footnote reference, as it has
+*meaning* which is important to have proper semantic output (e.g. for
+screen readers), as detailed in [this Stack Overflow discussion][].
+--[[anarcat]]
+
+[this Stack Overflow discussion]: http://stackoverflow.com/questions/501671/superscript-in-css-only
+
+> ikiwiki code does not interpret Markdown or translate it into HTML.
+> If I'm interpreting what you say correctly, you seem to be implying
+> that you think [[!cpan Text::MultiMarkdown]] is producing incorrect
+> HTML for footnotes (is an `<a>` with a `class`, should be a `<sup>`).
+> If so, please report that as a MultiMarkdown bug, not an ikiwiki bug,
+> or alternatively don't use MultiMarkdown.
+>
+> The recommended backend for the [[plugins/mdwn]] plugin is
+> [[!cpan Text::Markdown::Discount]], which optionally implements
+> footnotes using the same syntax as MultiMarkdown (originating in
+> "PHP Markdown Extra"). However, ikiwiki doesn't currently enable
+> that particular feature. Maybe it should, at least via a site-wide
+> option.
+>
+> What remains after eliminating the MultiMarkdown bug seems to be:
+> ikiwiki's default stylesheet does not contain the necessary styling
+> to work around the non-semantic markup produced by the non-default
+> Text::MultiMarkdown Markdown implementation. Is that an accurate
+> summary?
+> --[[smcv]]
+
+>> That is an accurate summary.
+>>
+>> I didn't realize that Discount didn't actually support footnotes in
+>> Ikiwiki by default. I guess I enabled Multimarkdown exactly for that
+>> kind of stuff that was missing...  It seems to me it would be
+>> reasonable to enable footnotes in Ikiwiki. There's already a lot of
+>> stuff that Discount does that is way more exotic (e.g. tables) and
+>> non-standard (e.g. `abbr:`).
+>>
+>> Ideally, users would get to configure which
+>> [Discount flags](http://www.pell.portland.or.us/~orc/Code/markdown/#flags)
+>> are enabled in their configuration, but I understand that makes the
+>> configuration more complicated and error-prone.
+>>
+>>> Discount enables enough features by default that adding footnotes doesn't
+>>> seem bad to me. I'm also tempted by something like
+>>>
+>>> ```
+>>> mdwn_enable: [footnotes]
+>>> mdwn_disable: [alphalist, superscript]
+>>> ```
+>>>
+>>> where the default for anything that was neither specifically enabled
+>>> nor specifically disabled would be to enable everything that we don't
+>>> think is a poor fit for the processing model (pandoc-style document
+>>> headers) or likely to trigger by mistake (typographic quotes and
+>>> [[maybe alpha lists|forum/"S."_gets_replace_by_"a."_in_my_ikiwiki]]).
+>>> --[[smcv]]
+>>>
+>>>> Makes perfect sense to me. --[[anarcat]]
+>>>
+>> For example, to enable footnotes, one needs to call Discount like this:
+>> 
+>>       Text::Markdown::Discount::markdown($text, Text::Markdown::Discount::MKD_EXTRA_FOOTNOTE())
+>>
+>> That being said, Discount generates proper semantic markup when
+>> footnotes, so this bug doesn't apply to the default Discount mode,
+>> if we ignore the fact that it doesn't support footnotes at all.
+>> Should I open a todo about this and the above?
+>>
+>> Also, it seems this *is* a bug with multimarkdown - I have
+>> [reported the issue there](https://github.com/bobtfish/text-multimarkdown/issues/30).
+>>
+>> In the meantime, wouldn't it be better to have some styling here to
+>> workaround the problem in MMD?
+>>
+>>> Honestly, I'd rather have ikiwiki's level of support for the non-preferred
+>>> Markdown implementation be: if you are stuck on a platform with no C compiler
+>>> or Perl headers, you can use the pure-Perl Markdown flavours, and they
+>>> will sort of mostly work (but might not look great).
+>>>
+>>> I'm a little concerned that styling these rather generically-named classes
+>>> might interfere with the implementations of footnotes in other Markdown
+>>> implementations, or indeed non-Markdown - I wouldn't want to style
+>>> `a.footnote` if the HTML produced by some other htmlize hook was
+>>> `<sup><a class="footnote" ...>[1]</a></sup>` for instance.
+>>> But they're probably harmless.
+>>>
+>>>> Alright, your call. :) At least this bug will be available as a workaround
+>>>> for others that stumble upon the same problem! :) --[[anarcat]]
+
+Note that I also make the bottom `<div>` small as well so that it has
+less weight than the rest of the text. -- [[anarcat]]
diff --git a/doc/bugs/local.css_overwritten_by_ikiwiki_--setup.mdwn b/doc/bugs/local.css_overwritten_by_ikiwiki_--setup.mdwn
new file mode 100644 (file)
index 0000000..222a951
--- /dev/null
@@ -0,0 +1,28 @@
+Steps to reproduce:
+
+ * Running ikiwiki 3.20130904.1ubuntu1 on Ubuntu 14.04 LTS
+ * Modify `~/public_html/MYWIKI/local.css`
+ * Run `ikiwiki --setup MYWIKI.setup` (or update via websetup interface)
+
+What should happen:
+
+ * Setup is updated/site is rebuilt
+ * local.css is retained and used
+
+What happens instead:
+
+ * Setup is updated (works)
+ * local.css reverts to blank version
+
+Workaround:
+
+ * Create mylocal.css, and manually copy it over local.css every time
+
+---
+
+> This is [[working as intended|done]]. IkiWiki is a wiki compiler: everything
+> in its `$destdir`, in your case `~/public_html/MYWIKI`, is intended to be
+> under its control. Please create `local.css` in the `$srcdir`
+> (probably `~/MYWIKI`) and commit it to the VCS, or enable the
+> [[plugins/attachment]] plugin and "attach" it to the top-level `index` page.
+> IkiWiki will copy it into the `$destdir` whenever it changes. --[[smcv]]
diff --git a/doc/bugs/password_reset_failure.mdwn b/doc/bugs/password_reset_failure.mdwn
new file mode 100644 (file)
index 0000000..1e40981
--- /dev/null
@@ -0,0 +1,22 @@
+I can't seem to do a password reset on this wiki. I am writing this
+through the anonymous git push interface (phew for that!).
+
+I have tried three times now to reset my password through the user
+interface - my account name is [[anarcat]], and when i do the password
+reset, I get a token. I go visit the website, set a passphrase, click
+`Save Preferences` and I end up on a login form. I enter my
+passphrase, click `Login` and I get the error:
+
+    1 error(s) were encountered with your submission. Please correct the fields highlighted below.
+    
+    Name
+    [anarcat]
+    
+    Password
+    [*************] Invalid entry
+
+`Password` is highlighted.
+
+Even if I leave the password there (my cleartext password is in the
+login form by default after the password reset, which is strange), it
+still gives me that error. -- [[anarcat]]
index 9669597ed60c44299fde70d9c3535a7de1d92029..700917443afa6d7c665fb29651daa405fb8b4b10 100644 (file)
@@ -33,3 +33,10 @@ Is this helpful or have I done anything stupid ? -- Michael
 > This would be helpful if I could reproduce the crash from your instructions, but I couldn't :-(
 > Which version of ikiwiki is this?
 > --[[smcv]]
+
+>> It was version 3.20141016.2 as it is in debian stable / jessie  
+>> I tried again with version 3.20160121 as it is in debian sid  
+>> same behavior as described  
+>>  
+>> I did setup a new blog with auto-blog.setup, activated the po plugin with the defaults  
+>> and get the error again (running ikiwiki --setup twice) --Michael
index 376f81b8baa1aea797541d5cc7e794400381926b..d41a4a318dc0d5e4df51c6780ff3c0823c897356 100644 (file)
@@ -4,6 +4,9 @@ User contributed stylesheet files for ikiwiki. Unless otherwise noted,
 these style sheets can be installed by copying them into your wiki's source
 dir with a filename of `local.css`.
 
+Note that if you enable the [[plugins/localstyle]] plugin, you can also
+create stylesheets that affect only certain parts of the wiki.
+
 Some of stylesheets have developed into fullfledged [[themes]] that are
 included in ikiwiki for easy use.
 
@@ -50,21 +53,9 @@ gnomes will convert them to css files..)
 
 * ** http://blog.lastlog.de/, contributed by joachim schiele; please feel free to copy.
 
-* **[blankoblues.css][1]**, contributed by [[Blanko]]. Can be seen on [Blankoblues Demo][2]. Local.css and templates available [here][3].
-
-* **[contraste.css][4]**, contributed by [[Blanko]]. Can be seen on [Contraste Demo][5]. Local.css and templates available [here][6].
-
 * **[wiki.css](http://cyborginstitute.net/includes/wiki.css)** by [[tychoish]]. 
   I typically throw this in as `local.css` in new wikis as a slightly more clear and readable
   layout for wikis that need to be functional and elegant, but not necessarily uniquely designed. 
   Currently in use by the [the outeralliance wiki](http://oa.criticalfutures.com/). 
 * **[ikiwiked gray-green](https://github.com/AntPortal/ikiwiked/raw/master/theme/gray-green/local.css)**, contributed by [Danny Castonguay](https://antportal.com/).
 * **[ikiwiked gray-orange](https://github.com/AntPortal/ikiwiked/raw/master/theme/gray-orange/local.css)**, contributed by [Danny Castonguay](https://antportal.com/). Can be seen in action at [antportal.com/wiki](https://antportal.com/wiki/). Feel free to modify and contribute on [Github](https://github.com/AntPortal/ikiwiked)
-<!-- Page links -->
-
- [1]: http://olivier.dossmann.net/demo/ikiwiki/blankoblues/src/local.css (Download Blankoblues CSS)
- [2]: http://olivier.dossmann.net/demo/ikiwiki/blankoblues/htdocs/ (Take a tour on Blankoblues Demo)
- [3]: http://olivier.dossmann.net/demo/ikiwiki/blankoblues/blankoblues.tar.gz (Download local.css and templates for Blankoblues theme)
- [4]: http://olivier.dossmann.net/demo/ikiwiki/contraste/src/local.css (Download Contraste CSS)
- [5]: http://olivier.dossmann.net/demo/ikiwiki/contraste/htdocs/ (Take a tour on Contraste Demo)
- [6]: http://olivier.dossmann.net/demo/ikiwiki/contraste/contraste.tar.gz (Download local.css and templates for Contraste theme)
index 19631ad478dbb0f732f5043f68791cd3e392afb1..c772dc05b57ba30f2f8d9cad20d5c5dca13f024c 100644 (file)
@@ -9,4 +9,4 @@ Each example is contained in its own subdirectory; just copy the source
 files into your wiki to start using one of the examples.
 
 The [[tips]] page has some other ideas for ways to use ikiwiki, and the
-[[css_market]] and [[theme market|themes]] has some example stylesheets to change ikiwiki's look.
+[[css_market]] and [[theme market|themes]] explain how to change ikiwiki's look.
diff --git a/doc/forum/An_error_occurred_while_writing_CGI_reply.mdwn b/doc/forum/An_error_occurred_while_writing_CGI_reply.mdwn
new file mode 100644 (file)
index 0000000..e79697b
--- /dev/null
@@ -0,0 +1,2 @@
+An error occurred while writing CGI reply
+Is my owner error? chmod or chown ?
diff --git a/doc/forum/An_error_occurred_while_writing_CGI_reply/comment_1_c7a947be22731dba81c936960089fe11._comment b/doc/forum/An_error_occurred_while_writing_CGI_reply/comment_1_c7a947be22731dba81c936960089fe11._comment
new file mode 100644 (file)
index 0000000..e3d3cd1
--- /dev/null
@@ -0,0 +1,10 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-03-11T15:43:14Z"
+ content="""
+Please explain why you edited the front page of this site and tried to add
+some image to it?
+
+We reverted the edit.
+"""]]
diff --git a/doc/forum/Can_I_disable_discussion_links__63__.mdwn b/doc/forum/Can_I_disable_discussion_links__63__.mdwn
new file mode 100644 (file)
index 0000000..8c70a81
--- /dev/null
@@ -0,0 +1 @@
+Is it possible to disable the "Discussion" link on every page? I'm struggling to search for "discussion" topics without bringing up lots of discussion pages :D
diff --git a/doc/forum/Can_I_disable_discussion_links__63__/comment_1_f4f06262082ec86a95e67fef96113f91._comment b/doc/forum/Can_I_disable_discussion_links__63__/comment_1_f4f06262082ec86a95e67fef96113f91._comment
new file mode 100644 (file)
index 0000000..1b5ef1e
--- /dev/null
@@ -0,0 +1,8 @@
+[[!comment format=mdwn
+ username="mx.david.rix@3bf9592fa655d6681eedf8add3d3b830d00a40d3"
+ nickname="mx.david.rix"
+ subject="Doh!"
+ date="2016-01-22T15:09:53Z"
+ content="""
+Found it on the setup interface while I was looking for something else. Must've missed it the first time.
+"""]]
diff --git a/doc/forum/Instant_Articles.mdwn b/doc/forum/Instant_Articles.mdwn
new file mode 100644 (file)
index 0000000..c9970f5
--- /dev/null
@@ -0,0 +1,7 @@
+Dave Winer has an interesting post about RSS and "Facebook Instant Articles" here:
+
+http://scripting.com/liveblog/users/davewiner/2016/03/04/1094.html
+
+One feed works for both Facebook and for regular RSS readers.
+
+I'm thinking about doing this on one of my ikiwiki sites. Any reasons not to do this on a feed?
diff --git a/doc/forum/Instant_Articles/comment_1_4e8ea5e53feba8eee62e1742f01886cd._comment b/doc/forum/Instant_Articles/comment_1_4e8ea5e53feba8eee62e1742f01886cd._comment
new file mode 100644 (file)
index 0000000..5e0cba1
--- /dev/null
@@ -0,0 +1,9 @@
+[[!comment format=mdwn
+ username="smcv"
+ subject="comment 1"
+ date="2016-03-06T12:22:33Z"
+ content="""
+If it's a compatible extension to RSS (adds new elements but doesn't require changing much/anything in the existing feed), I don't see why not. I think you'd just need to adapt `templates/rssitem.tmpl` and `templates/rsspage.tmpl`. Please contribute your changes as a [[git]] branch and/or a [[todo]] item.
+
+If Facebook also supports Atom, I'd prefer to use that instead of RSS - RSS is poorly specified, and the Atom spec fixes a lot of the vagueness.
+"""]]
diff --git a/doc/forum/Translating_ikiwiki_interface/comment_1_389a8173abcc0990f6670796c5f8b227._comment b/doc/forum/Translating_ikiwiki_interface/comment_1_389a8173abcc0990f6670796c5f8b227._comment
new file mode 100644 (file)
index 0000000..fbee2ce
--- /dev/null
@@ -0,0 +1,7 @@
+[[!comment format=mdwn
+ username="desci"
+ subject="Any chance on moving forward on this?"
+ date="2016-04-09T00:21:45Z"
+ content="""
+How about having an intermediate file defining TMPL_VAR_STRING_X and creating .pot files from this intermediate file? --[[desci]]
+"""]]
diff --git a/doc/forum/bootstrap_theme.mdwn b/doc/forum/bootstrap_theme.mdwn
new file mode 100644 (file)
index 0000000..949aef5
--- /dev/null
@@ -0,0 +1,17 @@
+I've edited a lot of pages with redundant questions, so I will centralize this right here.
+
+After reading a lot until I've found the [[/forum/debconf13_ikiwiki_bof]], and I saw there was a *welcome* for a generic bootstrap theme, so I've delivered.
+
+The 'yet another bootstrap theme' has it's source code on [notabug](https://notabug.org/iikb/ikiwiki-theme-bootstrap).
+
+The installation is like I expected any other theme to be:
+
+* [Untar](https://notabug.org/iikb/ikiwiki-theme-bootstrap/archive/1.0.0.25.tar.gz) or [unzip](https://notabug.org/iikb/ikiwiki-theme-bootstrap/archive/1.0.0.25.zip) the [release files](https://notabug.org/iikb/ikiwiki-theme-bootstrap/releases) into `/usr/share/ikiwiki/themes/bootstrap/`;
+* Active the theme `bootstrap` in the setup file or web setup like [[the manual said|/plugins/theme]];
+* Rebuild the wiki if it doesn't automatically and the site should look like [this](https://web.archive.org/web/20160409044511/https://dev.iikb.org/forum/Tema_bootstrap/).
+
+The [current release](https://notabug.org/iikb/ikiwiki-theme-bootstrap/archive/1.0.0.25.tar.gz) has less than the basics, however it should work out of the box and without modifying anything else, the template files that are tampered with are contained inside the theme folder.
+
+It also shouldn't use external *cdn*s, it does currently use [my own cdn](https://cdn.iik.org) but no one should rely on it so I'm moving the files inside the git tree so it will be auto contained.
+
+It is available in the [[theme_market]] already.
diff --git a/doc/forum/can__39__t_connect_to_local_url_after_installing_ikiwiki.mdwn b/doc/forum/can__39__t_connect_to_local_url_after_installing_ikiwiki.mdwn
new file mode 100644 (file)
index 0000000..20462f7
--- /dev/null
@@ -0,0 +1,60 @@
+Hello,
+
+I just installed ikiwiki to my local computer, but still can't edit through the browser.
+Haven't tried editing differently, because I'm a total dummy in programming.
+Help wanted!! :)
+Here is what the terminal shows after installation:
+
+```
+kund-Mac-2:~ kund$ sudo ikiwiki --setup /opt/local/etc/ikiwiki/auto.setup
+Password:
+What will the wiki be named? Relatii cu Publicul
+What revision control system to use? git
+Which user (wiki account, openid, or email) will be admin? Kund Kopacz
+
+
+Setting up Relatii cu Publicul ...
+Importing /Users/kund/RelatiicuPublicul into git
+Initialized empty shared Git repository in /Users/kund/RelatiicuPublicul.git/
+Initialized empty Git repository in /Users/kund/RelatiicuPublicul/.git/
+[master (root-commit) 02fa1fa] initial commit
+ Committer: System Administrator <root@kund-Mac-2.local>
+Your name and email address were configured automatically based
+on your username and hostname. Please check that they are accurate.
+You can suppress this message by setting them explicitly:
+
+    git config --global user.name "Your Name"
+    git config --global user.email you@example.com
+
+After doing this, you may fix the identity used for this commit with:
+
+    git commit --amend --reset-author
+
+ 1 file changed, 1 insertion(+)
+ create mode 100644 .gitignore
+Counting objects: 3, done.
+Writing objects: 100% (3/3), 234 bytes | 0 bytes/s, done.
+Total 3 (delta 0), reused 0 (delta 0)
+To /Users/kund/RelatiicuPublicul.git
+ * [new branch]      master -> master
+Directory /Users/kund/RelatiicuPublicul is now a clone of git repository /Users/kund/RelatiicuPublicul.git
+Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\\documentclass{ <-- HERE article}/ at /opt/local/lib/perl5/vendor_perl/5.22/IkiWiki/Plugin/teximg.pm line 149.
+Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\\documentclass{ <-- HERE scrartcl}/ at /opt/local/lib/perl5/vendor_perl/5.22/IkiWiki/Plugin/teximg.pm line 150.
+
+
+Creating wiki admin Kund Kopacz ...
+Choose a password: 
+Confirm password: 
+
+
+ikiwiki-update-wikilist: no changes need to be made
+
+
+Successfully set up Relatii cu Publicul:
+       url:         http://kund-Mac-2.local/~root/RelatiicuPublicul
+       srcdir:      ~/RelatiicuPublicul
+       destdir:     ~/public_html/RelatiicuPublicul
+       repository:  ~/RelatiicuPublicul.git
+To modify settings, edit ~/RelatiicuPublicul.setup and then run:
+       ikiwiki --setup ~/RelatiicuPublicul.setup
+```
diff --git a/doc/forum/can__39__t_connect_to_local_url_after_installing_ikiwiki/comment_1_9feba07c25d226bf63d0886139ed7847._comment b/doc/forum/can__39__t_connect_to_local_url_after_installing_ikiwiki/comment_1_9feba07c25d226bf63d0886139ed7847._comment
new file mode 100644 (file)
index 0000000..b1689e1
--- /dev/null
@@ -0,0 +1,51 @@
+[[!comment format=mdwn
+ username="smcv"
+ subject="You'll need a web server, and don't run ikiwiki as root"
+ date="2016-03-11T20:39:35Z"
+ content="""
+> sudo ikiwiki --setup /opt/local/etc/ikiwiki/auto.setup
+
+This is probably not the cause of your problem, but please don't do this. ikiwiki
+should always be run as an ordinary user, never as root. If it runs as root, any
+bugs in ikiwiki could have very bad consequences.
+
+(I'm tempted to make it just exit with an error message if run as root, actually.)
+
+> ```
+>     url:         http://kund-Mac-2.local/~root/RelatiicuPublicul
+>     srcdir:      ~/RelatiicuPublicul
+>     destdir:     ~/public_html/RelatiicuPublicul
+>     repository:  ~/RelatiicuPublicul.git
+> ```
+
+ikiwiki does not include a web server (http server), so you cannot edit via a
+browser without providing one.
+
+`auto.setup` tries to guess at some reasonable defaults that will work on a
+reasonable number of Unix machines: it assumes that `~/public_html` is
+mapped to `http://${hostname}/~${username}/` by your web server. This is
+the default configuration on many Linux and *BSD systems; I don't know
+whether that's true on OS X or not.
+
+It also assumes that an executable named `ikiwiki.cgi` in `public_html`
+will be run as a CGI script. Again, this is often true, but not always.
+
+Perhaps we should have some wording like
+
+```
+If you have a web server running, your site might be available at:
+
+     url:         http://kund-Mac-2.local/~root/RelatiicuPublicul
+     srcdir:      ~/RelatiicuPublicul
+     destdir:     ~/public_html/RelatiicuPublicul
+     repository:  ~/RelatiicuPublicul.git
+```
+
+as a hint that ikiwiki has done what it can, and the rest is up to you?
+
+> Unescaped left brace in regex is deprecated
+
+I think we fixed this in the latest version of ikiwiki, so you might not
+be running the current version (that won't affect this particular
+issue, but there are other improvements).
+"""]]
diff --git a/doc/forum/lockedit_help.mdwn b/doc/forum/lockedit_help.mdwn
new file mode 100644 (file)
index 0000000..60decf0
--- /dev/null
@@ -0,0 +1,22 @@
+I'm having some trouble getting the lockedit plugin to work as I'd expect.
+
+We have a small in-house wiki that should be public-viewable, but only editable by a few users.
+I've added these users to the `adminuser` keyword in my `.setup` file:
+
+    adminuser:
+      - user1
+      - user2
+      - user3
+
+`lockedit` is enabled:
+
+    add_plugins:
+      - lockedit
+
+And the `locked_pages` is set to '*':
+
+    locked_pages: '*'
+
+However, I can still edit all pages using any user.  To test I simply created a new user
+by attempting to edit a page while not logged in.  After creating the user I could edit the
+page.
diff --git a/doc/forum/missing_pages_redirected_to_search-SOLVED/comment_2_bc0291b1afc2e9b4a853c168d3adfd78._comment b/doc/forum/missing_pages_redirected_to_search-SOLVED/comment_2_bc0291b1afc2e9b4a853c168d3adfd78._comment
new file mode 100644 (file)
index 0000000..d170ab4
--- /dev/null
@@ -0,0 +1,83 @@
+[[!comment format=mdwn
+ username="https://launchpad.net/~eliasson"
+ nickname="eliasson"
+ subject="comment 2"
+ date="2016-01-31T20:07:52Z"
+ content="""
+Using Apache 2.4.10 (Debian 8's package) I solved it the following way:
+
+1. In the Apache site configuration, set `ErrorDocument 404` to the ikiwiki.cgi URL path.
+2. Apply the following patch to the plugins search and 404. The easiest and probably cleanest way is to copy the plugins to your `$libdir/IkiWiki/Plugins` and edit them there. It works with xapian omega search but wouldn't work with google, since the *P* CGI parameter is not set (instead, omega uses the `QUERY_STRING` environment variable). Perhaps one day I'll make this a proper patch and submit as a pull request.
+
+[Apache 2.4.13 adds support](https://httpd.apache.org/docs/2.4/mod/core.html#errordocument) for dynamic strings in `ErrorDocument`s, so you could do something similar to the solution for Nginx above. Until that is packaged in your stable Linux distro of choice, this hack can be used.
+
+<pre>
+<code>
+diff --git a/IkiWiki/Plugin/404.pm b/IkiWiki/Plugin/404.pm
+index 42cfa9e..a12fd40 100644
+--- a/IkiWiki/Plugin/404.pm
++++ b/IkiWiki/Plugin/404.pm
+@@ -74,7 +74,9 @@ sub cgi ($) {
+               my $page = cgi_page_from_404(
+                       Encode::decode_utf8($ENV{REDIRECT_URL}),
+                       $config{url}, $config{usedirs});
+-              IkiWiki::Plugin::goto::cgi_goto($cgi, $page);
++
++              $ENV{QUERY_STRING}=\"P=$page\";
++              IkiWiki::Plugin::search::search($cgi);
+       }
+ }
+diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm
+index 24b16fe..24d7b3c 100644
+--- a/IkiWiki/Plugin/search.pm
++++ b/IkiWiki/Plugin/search.pm
+@@ -183,24 +183,31 @@ sub delete (@) {
+       }
+ }
++sub search($) {
++      my $cgi=shift;
++
++      if ($config{google_search}) {
++              print $cgi->redirect(\"https://www.google.com/search?sitesearch=$config{url}&q=\".$cgi->param('P'));
++              exit 0;
++      }
++      else {
++              # only works for GET requests
++              chdir(\"$config{wikistatedir}/xapian\") || error(\"chdir: $!\");
++              $ENV{OMEGA_CONFIG_FILE}=\"./omega.conf\";
++              $ENV{CGIURL}=IkiWiki::cgiurl();
++              IkiWiki::loadindex();
++              $ENV{HELPLINK}=htmllink(\"\", \"\", \"ikiwiki/searching\",
++                                      noimageinline => 1, linktext => \"Help\");
++
++              exec($config{omega_cgi}) || error(\"$config{omega_cgi} failed: $!\");
++      }
++}
++
+ sub cgi ($) {
+       my $cgi=shift;
+       if (defined $cgi->param('P')) {
+-              if ($config{google_search}) {
+-                      print $cgi->redirect(\"https://www.google.com/search?sitesearch=$config{url}&q=\".$cgi->param('P'));
+-                      exit 0;
+-              }
+-              else {
+-                      # only works for GET requests
+-                      chdir(\"$config{wikistatedir}/xapian\") || error(\"chdir: $!\");
+-                      $ENV{OMEGA_CONFIG_FILE}=\"./omega.conf\";
+-                      $ENV{CGIURL}=IkiWiki::cgiurl();
+-                      IkiWiki::loadindex();
+-                      $ENV{HELPLINK}=htmllink(\"\", \"\", \"ikiwiki/searching\",
+-                              noimageinline => 1, linktext => \"Help\");
+-                      exec($config{omega_cgi}) || error(\"$config{omega_cgi} failed: $!\");
+-              }
++              search($cgi);
+       }
+ }
+</code>
+</pre>
+"""]]
index 04ed139593bfbe578798d8149091127e2162985c..ae976faed51456b218f5c332a84733469397c33e 100644 (file)
@@ -26,4 +26,12 @@ supported. For example:
        print "hello, world\n";
        """]]
 
+`format` can also be used to format entire source files and display them on a page. Simply put an [[inline]] directive with the `raw` attribute set inside a `format`. This can be useful if you want to both serve the file raw, as well as show it syntax highlighted on a page. An example:
+
+       \[[!format python """
+       [[!inline pages="program.py" raw="yes"]]
+       """]]
+
+       \[[View raw file|program.py]]
+
 [[!meta robots="noindex, follow"]]
index 08d15898702ca800c825cc33cb610c34bec50f23..a940a44b6567ef72c9f8b23a8900a1545be508d0 100644 (file)
@@ -12,11 +12,13 @@ providing a link to a full-size version.
 The image file will be searched for using the same rules as used to find
 the file pointed to by a [[ikiwiki/WikiLink]].
 
-The `size` parameter is optional, defaulting to full size. Note that the
-original image's aspect ratio is always preserved, even if this means
-making the image smaller than the specified size. You can also specify only
-the width or the height, and the other value will be calculated based on
-it: "200x", "x200"
+The `size` parameter is optional, defaulting to full size.
+You can specify only the width or the height, and the other value will
+be calculated based on it: "200x", "x200".
+
+If you specify both the width and height, the original image's aspect
+ratio will be preserved, even if this means making the image smaller
+than the specified size. (However, this is not done for svg images.)
 
 You can also pass `alt`, `title`, `class`, `align`, `id`, `hspace`, and
 `vspace` parameters.
@@ -39,4 +41,27 @@ the page, unless overridden. Useful when including many images on a page.
        \[[!img photo2.jpg]]
        \[[!img photo3.jpg size=200x600]]
 
+## format support
+
+By default, the `img` directive only supports a few common web formats:
+
+* PNG (`.png`)
+* JPEG (`.jpg` or `.jpeg`)
+* GIF (`.gif`)
+* SVG (`.svg`)
+
+These additional formats can be enabled with the `img_allowed_formats`
+[[!iki setup]] option, but are disabled by default for better
+[[!iki security]]:
+
+* PDF (`.pdf`)
+* `everything` (accepts any file supported by ImageMagick: make sure
+  that only completely trusted users can
+  [[upload attachments|ikiwiki/pagespec/attachment]])
+
+For example, a wiki where only `admin()` users can upload attachments might
+use:
+
+    img_allowed_formats: [png, jpeg, gif, svg, pdf]
+
 [[!meta robots="noindex, follow"]]
index fa2bc58679afd9044bdab4c4b8bf1a5b16702770..868fb2310d250da5e493a179b3e47fac263628e3 100644 (file)
@@ -12,7 +12,7 @@ while allowing larger mp3 files to be uploaded by joey into a specific
 directory, and check all attachments for viruses, something like this could be
 used:
   
-       virusfree() and ((user(joey) and podcast/*.mp3 and mimetype(audio/mpeg) and maxsize(15mb)) or (mimetype(image/*) and maxsize(50kb)))
+       virusfree() and ((user(joey) and podcast/*.mp3 and mimetype(audio/mpeg) and maxsize(15mb)) or ((mimetype(image/jpeg) or mimetype(image/png)) and maxsize(50kb)))
 
 The regular [[ikiwiki/PageSpec]] syntax is expanded with the following
 additional tests:
diff --git a/doc/news/version_3.20141016.mdwn b/doc/news/version_3.20141016.mdwn
deleted file mode 100644 (file)
index 3579794..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-ikiwiki 3.20141016 released with [[!toggle text="these changes"]]
-[[!toggleable text="""
-[ Joey Hess ]
-
-  * Fix crash that can occur when only_committed_changes is set and a
-    file is deleted from the underlay.
-
-[ Simon McVittie ]
-
-  * core: avoid dangerous use of CGI->param in list context, which led
-    to a security flaw in Bugzilla; as far as we can tell, ikiwiki
-    is not vulnerable to a similar attack, but it's best to be safe
-  * core: new reverse_proxy option prevents ikiwiki from trying to detect
-    how to make self-referential URLs by using the CGI environment variables,
-    for instance when it's deployed behind a HTTP reverse proxy
-    (Closes: [[!debbug 745759]])
-  * core: the default User-Agent is now "ikiwiki/$version" to work around
-    ModSecurity rules assuming that only malware uses libwww-perl
-  * core: use protocol-relative URLs (e.g. //www.example.com/wiki) so that
-    https stays on https and http stays on http, particularly if the
-    html5 option is enabled
-  * core: avoid mixed content when a https cgiurl links to http static pages
-    on the same server (the static pages are assumed to be accessible via
-    https too)
-  * core: force the correct top URL in w3mmode
-  * google plugin: Use search form
-  * docwiki: replace Paypal and Flattr buttons with text links
-  * comments: don't record the IP address in the wiki if the user is
-    logged in via passwordauth or httpauth
-  * templates: add ARIA roles to some page elements, if html5 is enabled.
-    Thanks, Patrick
-  * debian: build-depend on libmagickcore-6.q16-2-extra | libmagickcore-extra
-    so we can thumbnail SVGs in the docwiki
-  * debian: explicitly depend and build-depend on libcgi-pm-perl
-  * debian: drop unused python-support dependency
-  * debian: rename debian/link to debian/links so the intended symlinks appear
-  * debian: fix some wrong paths in the copyright file
-"""]]
-[[!meta date="2014-10-17 01:01:53 +0100"]]
diff --git a/doc/news/version_3.20160121.mdwn b/doc/news/version_3.20160121.mdwn
new file mode 100644 (file)
index 0000000..2e727a6
--- /dev/null
@@ -0,0 +1,46 @@
+ikiwiki 3.20160121 released with [[!toggle text="these changes"]]
+[[!toggleable text="""
+ * [ [[Amitai Schlair|schmonz]] ]
+   * [[plugins/meta]]: Fix `\[[!meta name=foo]]` by closing the open quote.
+   * Avoid unescaped `{` in regular expressions
+   * meta test: Add tests for many behaviors of the directive.
+   * img test: Bail gracefully when [[!cpan ImageMagick]] is not present.
+ * [ [[Joey Hess|joey]] ]
+   * [[plugins/emailauth]]: Added `emailauth_sender` config.
+   * Modified `page.tmpl` to to set html `lang=` and `dir=` when
+     values have been specified for them, which the [[plugins/po|po plugin]] does.
+   * Specifically license the javascript underlay under the permissive
+     basewiki license.
+ * [ [[Simon McVittie|smcv]] ]
+   * [[plugins/git]]: if no committer identity is known, set it to
+     `IkiWiki <ikiwiki.info>` in `.git/config`. This resolves commit errors
+     in versions of git that require a non-trivial committer identity.
+   * [[plugins/inline]], [[plugins/trail]]: rename `show`, `feedshow` parameters to `limit`, `feedlimit`
+     (with backwards compatibility)
+   * [[plugins/pagestats]]: add `show` option to show [[plugins/meta]] fields. Thanks, [[Louis|spalax]]
+   * [[plugins/inline]]: force RSS `<comments>` to be a fully absolute URL as required
+     by the W3C validator. Please use Atom feeds if relative URLs are
+     desirable on your site.
+   * [[plugins/inline]]: add `<atom:link rel="self">` to RSS feeds as recommended by
+     the W3C validator
+   * [[plugins/inline]]: do not produce links containing `/./` or `/../`
+   * syslog: accept and encode UTF-8 messages
+   * syslog: don't fail to log if the wiki name contains `%s`
+   * Change dependencies from transitional package [[!debpkg perlmagick]]
+     to [[!debpkg libimage-magick-perl]] (Closes: #[789221](http://bugs.debian.org/789221))
+   * debian/copyright: update for the rename of `openid-selector` to
+     `login-selector`
+   * d/control: remove leading article from Description
+     (lintian: description-synopsis-starts-with-article)
+   * d/control: Standards-Version: 3.9.6, no changes required
+   * Wrap and sort control files (`wrap-and-sort -abst`)
+   * Silence "used only once: possible typo" warnings for variables
+     that are part of modules' APIs
+   * Run [[!debpkg autopkgtest]] tests using [[!debpkg autodep8]] and the pkg-perl team's
+     infrastructure
+   * Add enough build-dependencies to run all tests, except for
+     non-git VCSs
+   * tests: consistently use `done_testing` instead of `no_plan`
+   * `t/img.t`: do not spuriously skip
+   * img test: skip testing PDFs if unsupported
+   * img test: use the right filenames when testing that deletion occurs"""]]
diff --git a/doc/plugins/contrib/admonition.mdwn b/doc/plugins/contrib/admonition.mdwn
new file mode 100644 (file)
index 0000000..43c63e4
--- /dev/null
@@ -0,0 +1,56 @@
+[[!meta author="anarcat"]]
+[[!template id=plugin name=admonition author="[[anarcat]]"]]
+[[!tag type/chrome]]
+
+# Admonitions
+
+This plugin adds directives that allow users to outline certain
+sections of text using a custom style sheet and bright icons.
+
+5 directives are available:
+
+* [[ikiwiki/directive/tip]]
+* [[ikiwiki/directive/note]]
+* [[ikiwiki/directive/important]]
+* [[ikiwiki/directive/caution]]
+* [[ikiwiki/directive/warning]]
+
+Or, in Ikiwiki markup:
+
+    \[[!tip "Lorem ipsum dolor sit amet, consectetuer adipiscing elit."]]
+    \[[!note "Vivamus id enim."]]
+    \[[!important "In id erat non orci commodo lobortis."]]
+    \[[!caution "In id erat non orci commodo lobortis."]]
+    \[[!warning "Phasellus neque orci, porta a, aliquet quis, semper a, massa."]]
+
+Those directives simply create a `<div>` elements in the right
+style. So the above can also be simply written as:
+
+    <div class="tip">Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</div>
+    <div class="note">Vivamus id enim.</div>
+    <div class="important">In id erat non orci commodo lobortis.</div>
+    <div class="caution">In id erat non orci commodo lobortis.</div>
+    <div class="warning">Phasellus neque orci, porta a, aliquet quis, semper a, massa.</div>
+
+# Rationale
+
+The idea behind the directives is to make the the CSS elements easier
+to discover through the builtin documentation. Obviously, more
+admonitions can be created simply by adding similar icons and CSS
+elements. Of course, you will not get the above directives expanded
+automatically unless you patch the admonition plugin, unfortunately.
+
+# Code
+
+[[!template id=gitbranch branch=anarcat/admonitions author="[[anarcat]]"]]
+
+The [[!taglink patch]] is available from
+[anarcat's "admonition" branch][] and is designed to be merged in
+Ikiwiki directly:
+
+    git clone -b admonitions git://src.anarc.at/ikiwiki.git
+
+[anarcat's "admonition" branch]: http://src.anarc.at/ikiwiki.git/shortlog/refs/heads/admonitions
+
+See also [[todo/admonitions]] for the discussion leading to the
+creation of this plugin.
index 564f7f68c8a3320a101f861bf14bcbc233188326..7527f26984bc51be95f3104fdf21d87e00ef0f8f 100644 (file)
@@ -91,6 +91,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 ``<TMPL_VAR FOO>`` will be replaced by ``bar``.
 
 ### Extensions
 
diff --git a/doc/plugins/contrib/listsubscribe.mdwn b/doc/plugins/contrib/listsubscribe.mdwn
new file mode 100644 (file)
index 0000000..6467319
--- /dev/null
@@ -0,0 +1,25 @@
+[[!template id=plugin name=listsubscribe author="[[schmonz]]"]]
+[[!template id=gitbranch branch=schmonz/listsubscribe author="[[schmonz]]"]]
+[[!tag type/web patch reviewed]]
+
+This plugin provides the `listsubscribe` directive, which inserts a web
+form for your readers to subscribe to a mailing list. The directive
+takes a required `listname` parameter, which must refer to one of the
+lists named in the wiki setup file.
+
+## Example
+
+In `ikiwiki.setup`:
+
+    add_plugins:
+    - listsubscribe
+    
+    listsubscribe:
+      'my supercool mailing list': supercool-subscribe@neato.great
+
+(Where `supercool-subscribe@neato.great` is the subscription address
+provided by your mailing list manager.)
+
+In any wiki page:
+
+    [[!listsubscribe listname="my supercool mailing list"]]
diff --git a/doc/plugins/contrib/listsubscribe/discussion.mdwn b/doc/plugins/contrib/listsubscribe/discussion.mdwn
new file mode 100644 (file)
index 0000000..2815349
--- /dev/null
@@ -0,0 +1,44 @@
+## Code review
+
+### Main things 
+
+[[!format diff """
++<form method="get" action="<TMPL_VAR LISTSUBSCRIBEACTION>" id="listsubscribeform">
+"""]]
+
+This should have `ESCAPE=HTML` (see [[!cpan HTML::Template]]). The other TMPL_VARs probably
+should too.
+
+The method should be `post`, and the CGI should ideally not respond to `GET`s (because sending
+email isn't idempotent).
+
+### Minor things
+
+It would be good to have the documentation specify exactly what "API" it expects from the
+mailing list: in this case it seems to be an address to which you can send a blank message
+with the desired subscription address in the `From:` header. I believe that works for most
+but not all mailing list managers (hopefully the ones where you're meant to mail the posting
+address with "subscribe" in the body have died out by now).
+
+[[!format diff """
++<h4>Join <TMPL_VAR LISTSUBSCRIBELISTNAME></h4>
+"""]]
+
+Might be better to have a separate parameter for the human-readable name?
+
+[[!format diff """
++       my $list_subscribe_form = template('listsubscribeform.tmpl');
+"""]]
+
+I wonder whether this would benefit from an optional `template` parameter, with this as default? 
+
+```
+listsubscribe:
+  'my supercool mailing list': supercool-subscribe@neato.great
+```
+
+This won't be available to [[plugins/websetup]], which doesn't understand hashes/dicts/maps.
+If it was a list of flat strings with a syntactic structure, like the language list for `po`,
+then it would be. Sorry, I can't think of a particularly good syntax...
+
+--[[smcv]]
diff --git a/doc/plugins/contrib/remark.mdwn b/doc/plugins/contrib/remark.mdwn
new file mode 100644 (file)
index 0000000..8c17832
--- /dev/null
@@ -0,0 +1,31 @@
+[[!template id=plugin name=remark author="[[schmonz]]"]]
+[[!template id=gitbranch branch=schmonz/remark.js author="[[schmonz]]"]]
+[[!tag type/format]]
+
+[Remark.js](http://remarkjs.com) makes web slides from Markdown. This
+plugin integrates Remark into ikiwiki. Simply write `your_slides.remark`
+instead of `your_blog_post.mdwn`, separating slides with `---`.
+
+To set shared styles across all presentations on your site, put them in
+a top-level `remarklocal.css`. To set per-presentation styles, use the
+[[localstyle]] plugin as usual.
+
+## Problem: `inline`
+
+Web slides are sort of a regular web page, but not exactly: no action
+links, and almost none of the other accoutrements of `page.tmpl`. The
+branch's current behavior is that Remark slides are naively inlined like
+any other page, which -- because the Markdown is deliberately not being
+rendered by ikiwiki -- results in the slide source being displayed (and
+not elegantly). Clicking through to the slides works right, of course.
+
+See [[Discussion#inline]].
+
+## Problem: safety of web-editing
+
+This plugin is not currently safe for wikis where `.remark` pages can be
+edited by untrusted users; the [[plugins/htmlscrubber]] is unlikely to be
+able to prevent cross-site scripting in this plugin. Make sure only trusted
+(administrative) users can create or edit `.remark` pages.
+
+See [[Discussion#editing]].
diff --git a/doc/plugins/contrib/remark/discussion.mdwn b/doc/plugins/contrib/remark/discussion.mdwn
new file mode 100644 (file)
index 0000000..ab8d409
--- /dev/null
@@ -0,0 +1,59 @@
+## Problem: `inline` <a id="inline"></a>
+
+Web slides are sort of a regular web page, but not exactly: no action
+links, and almost none of the other accoutrements of `page.tmpl`. The
+branch's current behavior is that Remark slides are naively inlined like
+any other page, which -- because the Markdown is deliberately not being
+rendered by ikiwiki -- results in the slide source being displayed (and
+not elegantly). Clicking through to the slides works right, of course.
+
+Should [[inline]] (and more generally [[ikiwiki/PageSpec]]) understand
+that web slides are not exactly regular pages? And/or should this plugin
+detect when slides are being inlined and allow ikiwiki to process the
+Markdown as a sort of "preview"? --[[schmonz]]
+
+> If you want web slides to not be a normal page, that's what internal
+> pages are for. An internal page has an extension (file type) starting
+> with `_`, and has the following properties:
+>
+> * `foo._ext` does not automatically render `foo[/index].html`
+> * `glob(foo)` (for which unadorned globs are syntactic sugar) does not
+>   match it, you have to use `internal(foo)`
+> * [[plugins/editpage]] won't edit it
+>
+> I'd be very tempted to use `foo._remark` and set it up so all such pages
+> are copied to `foo.html` unchanged. You'd probably have to add a new hook
+> that is run instead of most or all of `render()`, and also make those
+> pages exempt from `derender_internal()`?
+>
+> When a remark page is inlined (via `internal()` if it's internal)
+> I think it might be nice to pass it through (the htmlize function of)
+> ikiwiki's normal [[plugins/mdwn]] instead. --[[smcv]]
+
+## Concern: safety of web-editing <a id="editing"></a>
+
+Even though `remarkpage.tmpl` has no action links, is it still possible
+for someone to trick their way into web-editing a slide deck? And if
+they do, is that dangerous? --[[schmonz]]
+
+> Yes, it's likely both possible and dangerous. If you've already
+> deployed this plugin, make sure it's covered by [[plugins/lockedit]].
+>
+> Every *page* that is not *internal* can be edited. Look at
+> [[plugins/editpage]] for the (only) logic that is applied when deciding
+> whether to accept an edit: whether there is an action link is irrelevant.
+>
+> Here *page* is a jargon term for something matching `page()`, i.e. its
+> extension is the same as the name of a `htmlize` hook, while *internal*
+> means a *page* whose extension additionally starts with `_`.
+>
+> I think there's a cross-site scripting vulnerability here. If there is
+> some Markdown source that is seen as OK by
+> [[plugins/htmlscrubber]] and [[plugins/htmlbalance]], but induces
+> remark.js to produce HTML that is then evaluated in the security context
+> of your wiki and executes attacker-supplied JavaScript in visitors' browsers,
+> then an attacker able to edit the remark source could act with the
+> privileges of your wiki and anything else that shares its origin
+> (domain name). In particular, the attacker could steal login cookies.
+> The simplest proof-of-concept would be something like
+> `[click here](javascript:alert("XSS! " + document.cookie))`. --[[smcv]]
index 9ff6c4ffdcb87ccbc74c81a30f5bd6438b041bc4..4b274d1f41d731d394ab559f5e558bdddf843309 100644 (file)
@@ -7,6 +7,8 @@ plain ASCII punctuation characters into ``smart'' typographic punctuation HTML
 entities. To use it, you need to have the [[!cpan Text::Typography]] module
 installed.
 
-This plugin has a configuration option. To change the attributes,
-set `--typographyattributes=whatever`. See the documentation for
-[[!cpan Text::Typography]] for available attributes.
+This plugin has a configuration option. To change the attributes, set
+`--typographyattributes=whatever`.  Alternatively, set
+`typograph_attributes: whatever` in your config file.  The default is
+`3`.  See the documentation for [[!cpan Text::Typography]] for available
+attributes.
index 14772a3691730663e79888815ad17d6a87dcb656..4c4db1eb80e0e86093765ae7fbb2ea9931fd3628 100644 (file)
@@ -3,5 +3,4 @@ shows up here, the ball is back in your court, to respond to the review and
 deal with whatever is preventing it from being merged into ikiwiki. Once
 you do, remove the "reviewed" tag.
 
-[[!inline pages="(todo/* or bugs/*) and link(/branches) and !link(bugs/done)
-and !link(todo/done) and !*/*/* and link(.)" show=0 archive=yes]]
+[[!inline pages="tagged(reviewed)" show=0 archive=yes]]
index 25e5324c618cdedf6db691dfe5659dc9f3c0c330..038412d14b09156f2cee05e93ce4b3600587c3ad 100644 (file)
@@ -1,5 +1,10 @@
-[[!template  id=test45 text="""Here is the text to insert into my note."""]]
-dddddddddddd
+Nope my friend.
+
+<<<<<<< HEAD
+[[test link]]
+=======
+[[Test link]]
+>>>>>>> 59f04c5ad3daf0c01e81d28ec1106e23567a1100
 
 [[!meta date="Thu Jun 16 22:04:33 2005" updated="Thu Dec 22 01:23:20 2011"]]
 
@@ -8,6 +13,8 @@ This is the [[SandBox]], a page anyone can edit to try out ikiwiki
 vvvv
 CamelCase ?
 
+[[!tag sandbox]]
+
 What about [[this page]], nono better [[that page]]?
 
 hello world (right back at ya)
@@ -22,6 +29,54 @@ Hello!
 pre formated text?
 ~~~
 
+```
+testing markdown
+```
+
+# one
+
+- foo
+
+## two
+
+- bar
+
+### trois
+
+- blah
+    - more blah
+
+#### quatre
+
+## bir
+- bir
+
+## iki
+- iki
+
+* yildiz
+** cyildiz
+
+- tire
+  - ctire
+
+* *i dene*
+* **b dene**
+
+
+1. number
+2. list
+    a. ick
+    b. bar
+
+| table | here |
+|----|.----.|
+| test adfasdfasdfa | 2 |
+| subtest | adfad|
+
+ok no formating.
+
+
 > This is a blockquote.
 >
 > This is the first level of quoting.
index d5a0266cdce5638cd437c4d79cb58592f886bc01..6d4841fe6f258d25eeb077dc0a650bfd35b25422 100644 (file)
@@ -178,7 +178,8 @@ the same standards as the rest of ikiwiki, but with that said, here are
 some security notes for them.
 
 * The [[plugins/img]] plugin assumes that imagemagick/perlmagick are secure
-  from malformed image attacks. Imagemagick has had security holes in the
+  from malformed image attacks for at least the formats listed in
+  `img_allowed_formats`. Imagemagick has had security holes in the
   past. To be able to exploit such a hole, a user would need to be able to
   upload images to the wiki.
 
@@ -506,3 +507,22 @@ The hole was reported on March 24th, a fix was developed on March 27th,
 and the fixed version 3.20150329 was released on the 29th. A fix was backported
 to Debian jessie as version 3.20141016.2 and to Debian wheezy as version
 3.20120629.2. An upgrade is recommended for sites using CGI and openid.
+
+## XSS via error messages
+
+CGI error messages did not escape HTML meta-characters, potentially
+allowing an attacker to carry out cross-site scripting by directing a
+user to a URL that would result in a crafted ikiwiki error message. This
+was discovered on 4 May by the ikiwiki developers, and the fixed version
+3.20160506 was released on 6 May. An upgrade is recommended for sites using
+the CGI.
+
+## ImageMagick CVE-2016–3714 ("ImageTragick")
+
+ikiwiki 3.20160506 attempts to mitigate [[!cve CVE-2016-3714]] and any
+future ImageMagick vulnerabilities that resemble it, by restricting the
+image formats that the [[ikiwiki/directive/img]] directive is willing to
+resize. An upgrade is recommended for sites where an untrusted user is
+able to attach images. Upgrading ImageMagick to a version where
+CVE-2016-3714 has been fixed is also recommended, but at the time of
+writing no such version is available.
index 3cd6149a9cead7339564e67b3164ca76df0ac841..dd3b073d71065b9250e745628c1406bee5af38c3 100644 (file)
@@ -6,16 +6,24 @@ It is usually preferable (and more maintainable) to create a [[css]] file instea
 
 Feel free to add your own [[theme|themes]] here, but first consider writing a simpler [[css]] file and adding it to the [[css market]] instead, or look at the [[themes]] shipped with ikiwiki.
 
- * **[[AntPortal theme|https://github.com/AntPortal/ikiwiked]]**, contributed by Danny, see an example [[on the Antportal wiki|https://antportal.com/wiki/]]
+* **[AntPortal theme](https://github.com/AntPortal/ikiwiked)**, contributed by Danny, see an example [on the Antportal wiki](https://antportal.com/wiki/)
 
- * **[[Night city theme|http://anarcat.ath.cx/night_city/README/]]**, contributed by [[anarcat]], see an example [[on his homepage|http://anarcat.ath.cx/]]
+* **[Night city theme](http://anarcat.ath.cx/night_city/README/)**, contributed by [[anarcat]].
 
- * **[[Bootstrap theme|http://anonscm.debian.org/gitweb/?p=users/jak/website.git;a=summary]]**, contributed by [[JAK LINUX|http://jak-linux.org/about/]], based on [[Twitter Bootstrap|http://twitter.github.com/bootstrap/]]
+* **[Bootstrap theme](http://anonscm.debian.org/gitweb/?p=users/jak/website.git;a=summary)**, contributed by [JAK LINUX](http://jak-linux.org/about/), based on [Twitter Bootstrap](http://twitter.github.com/bootstrap/), [modifications available](https://anarc.at/blog/2015-09-09-bootstrap/) from [[anarcat]] as well
 
- * **[[Bootstrap 3|https://github.com/ramseydsilva/ikiwiki-bootstrap-theme]]**, contributed by [[ramsey]], based on [[Twitter Bootstrap 3|http://getbootstrap.com]], also modified by [dequis.org](https://github.com/dequis/ikiwiki-bootstrap-theme/tree/dequis.org)
+  * [Yet another bootstrap theme](https://notabug.org/iikb/ikiwiki-theme-bootstrap), this one can be used like a regular theme by placing [the theme files](https://notabug.org/iikb/ikiwiki-theme-bootstrap/archive/1.0.0.25.zip) on `/usr/share/ikiwiki/themes/bootstrap/` and changing the `theme` configuration to `boostrap`.
 
- * **[[Bootstrap 2|https://notabug.org/hiatobr/ikiwiki-bootstrap-theme-2]]**, contributed by [Hacklab Independência](https://hi.ato.br), a fork of [[ramsey]]'s [[Bootstrap 3|https://github.com/ramseydsilva/ikiwiki-bootstrap-theme]] original work. You may see examples on [[my user page|/users/desci]]
+* **[Bootstrap 3](https://github.com/ramseydsilva/ikiwiki-bootstrap-theme)**, contributed by [[ramsey]], based on [Twitter Bootstrap 3](http://getbootstrap.com). [Example](http://bootstrap-ramseydsilva.wiki.orangeseeds.org). This template has been forked and modified in many ways:
 
- * yet another **[Bootstrap 3](https://github.com/anderbubble/ikiwiki-bootstrap)** theme, contributed by anderbubble
+  * Modification for [dequis.org](https://github.com/dequis/ikiwiki-bootstrap-theme/tree/dequis.org). [Example](http://bootstrap-dequis.wiki.orangeseeds.org).
+
+  * Modification to fix the sidebar: **[Bootstrap 2](https://notabug.org/hiatobr/ikiwiki-bootstrap-theme-2)**, contributed by [Hacklab Independência](http://hi.ato.br). This one is hard translated to brazilian portuguese. [Example](http://bootstrap-hiatobr.wiki.orangeseeds.org).
+
+  * Yet another **[Bootstrap 3](https://github.com/anderbubble/ikiwiki-bootstrap)** theme, contributed by anderbubble. [Example](http://bootstrap-anderbubble.wiki.orangeseeds.org).
+
+  * And one more **[Bootstrap 3](https://github.com/tgpfeiffer/ikiwiki-bootstrap-template)** theme (can't you guys get along already?!), contributed by tgpfeiffer, this one shipping a copy of the bootstrap files. [Example](http://bootstrap-tgpfeiffer.wiki.orangeseeds.org).
+
+
+* **[Ikistrap](https://github.com/gsliepen/ikistrap)**, contributed by gsliepen, based on Bootstrap 4.
 
- * and one more **[Bootstrap 3](https://github.com/tgpfeiffer/ikiwiki-bootstrap-template)** theme (can't you guys get along already?!), contributed by tgpfeiffer, this one shipping a copy of the bootstrap files
index 5c0766a0625cb4316043f553cb035aa830be2357..1c0dd91ec56147dd9ab79ca3ea78462da04af806 100644 (file)
@@ -18,3 +18,67 @@ links to the actual theme. -- [[anarcat]]
 > theme yet. I recently made `<TMPL_IF THEME_$NAME>` be available,
 > so the page.tmpl could use that to do different things if the boostrap
 > theme was enabled. --[[Joey]]
+
+>> Would you reconsider? I've made [[this bootstrap theme|/forum/bootstrap_theme]] that works within the theme plugin without changing the `templatedir` configuration option. It seems that the `page.tmpl` I have in the subfolder `templates` takes precedence. Not sure what you meant by "two versions of page.tmpl", though. -- [[desci]]
+
+>>> The reason we don't want individual themes shipped with ikiwiki
+>>> to have to include their own `page.tmpl` is that when we add new
+>>> features (such as new plugins) to the ikiwiki core, if those features
+>>> require a `page.tmpl` change, we don't want to have to add them to
+>>> multiple variations of `page.tmpl`. This would either lead to
+>>> increased maintenance work (repeating ourselves), or theme-dependent
+>>> feature availability like what happens in Wordpress (for instance
+>>> imagine if `osm` only worked with Bootstrap and `sidebar` only worked
+>>> with Actiontabs - you wouldn't be able to have both).
+>>>
+>>> If you maintain your own local theme, you're welcome to maintain a
+>>> version of `page.tmpl` containing only the features you personally
+>>> need, but the `page.tmpl` in ikiwiki should be comprehensive. --[[smcv]]
+
+>>>> I've tried to make the least changes possible in [this page.tmpl file](https://notabug.org/iikb/ikiwiki-theme-bootstrap/raw/master/templates/page.tmpl), but I couldn't overcome the suckness of bootstrap itself.
+>>>> I am aware of alternatives to bootstrap, but it seems that every one of them would require some changes in the `page.tmpl` to work as expected.
+>>>> I think it is realistic to have a bootstrap (or other superb, fantastic css frame*lazy*work) without a `page.tmpl`,
+>>>> but I also think there should be other way around the chaos of each and every [[available theme|theme_market]] having it's own installing proccess.
+>>>> Other argument I have is: could we have a theme-contrib, like the [[plugins]] have? This would require the mantainer to implement the new features in their themes.
+
+---
+
+I have a question.
+
+Where should I put a custom theme other than `/usr/share/ikiwiki/themes/`?
+
+I put `.pm` plugins on `~/.ikiwiki/Ikiwiki/Plugin` and it works well.
+
+How would I go about not tampering with the root filesystem to install a theme?
+
+Also, I have another question:
+
+I have a complex theme I'm working on, and it doesn't even have a `style.css`, because it is about editing `.tmpl` files and relying on the bootstrap files, so I want to know if the theme plugin will understand this structure:
+
+```
+/usr/share/ikiwiki/themes/
+└── my-theme/
+    â”œâ”€â”€ basewiki/
+    â”‚   â”œâ”€â”€ bootstrap/
+    â”‚   â”‚   â”œâ”€â”€ css/
+    â”‚   â”‚   â”‚   â””── bootstrap.min.css
+    â”‚   â”‚   â”œâ”€â”€ js/
+    â”‚   â”‚   â”‚   â”œâ”€â”€ bootstrap.js
+    â”‚   â”‚   â”‚   â””── bootstrap.min.js
+    â”‚   â”‚   â””── fonts/
+    â”‚   â”‚       â”œâ”€â”€ glyphicons-halflings-regular.eot
+    â”‚   â”‚       â”œâ”€â”€ glyphicons-halflings-regular.svg
+    â”‚   â”‚       â”œâ”€â”€ glyphicons-halflings-regular.ttf
+    â”‚   â”‚       â”œâ”€â”€ glyphicons-halflings-regular.woff
+    â”‚   â”‚       â””── glyphicons-halflings-regular.woff2
+    â”‚   â””── index.mdwn
+    â””── templates/
+        â”œâ”€â”€ page.tmpl
+        â””── whatever.tmpl
+```
+
+**Edit:** no, it doesn't. When i change theme in the config to `my-theme`, the engine only uses the `templates` subfolder under `theme/my-theme`, and not `basewiki`. So the workaround is doing like [IkiStrap](https://github.com/gsliepen/ikistrap) proposed, suggesting the user to alter the `underlaydir` and `templatedir` configs instead of choosing a theme via the old fashioned `theme` config.
+
+This feels more like an overhaul than a theme for me, could we clarify what is a theme, a template, an overhaul, a change to the look and feel, a change to the frontend, a change to the design, etc.?
+
+-- [[desci]]
index 6dc9734fe2c0d31d33021fe633a78e1303a4da32..64c995e1800406b16097cf9a52f830dcf1895886 100644 (file)
@@ -2,7 +2,7 @@
 
 Use case: You want to move away from Wordpress to Ikiwiki as your blogging/website platform, but you want to retain your old posts.
 
-[This](http://git.chris-lamb.co.uk/?p=ikiwiki-wordpress-import.git) is a simple tool that generates [git-fast-import](http://www.kernel.org/pub/software/scm/git/docs/git-fast-import.html)-compatible data from a WordPress export XML file.
+[This](https://chris-lamb.co.uk/projects/ikiwiki-wordpress-import) is a simple tool that generates [git-fast-import](http://www.kernel.org/pub/software/scm/git/docs/git-fast-import.html)-compatible data from a WordPress export XML file.
 
 WordPress categories are mapped onto Ikiwiki tags. The ability to import comments is planned.
 
index f1f6553015a3ea83205829f47ee8c24e15c810b2..77849dbf1d82be6cdaee6bf1585e20406281363e 100644 (file)
@@ -12,3 +12,35 @@ In order to figure out exactly which ones fares the best, i made test wikis for
 Hopefully this will help others figure out what the heck is going on here... Personnally, I think I prefer the JAK linux one, but i don't like the idea of depending on a theme-specific plugin...  -- [[anarcat]]
 
 Update: I ended up forking the Jak theme also... My experience has been documented in [this blog post](http://anarc.at/blog/2015-09-09-bootstrap/?updated). --[[anarcat]]
+
+---
+
+Congratulations on your setup and here is my *mea culpa* on this:
+
+Originally I've started making the [hiatobr](http://bootstrap-hiatobr.wiki.orangeseeds.org)'s fork to address the following issues with the other attempts to make a bootstrap theme:
+
+* The sidebar wasn't working;
+* The themes were poorly written and did not found a way to incorporate the bootstrap proposal to the ikiwiki's template model;
+* I wanted diversity and the original idea was to provide a handful of templates like the [bootstrap examples](http://getbootstrap.com/getting-started/#examples).
+
+Turns out:
+
+* I've fixed the sidebar, don't remember how but you may find out in the [history](https://notabug.org/hiatobr/ikiwiki-bootstrap-theme-2/commits/d3769844c536a0d97955157f4c55e719af1dd3d0);
+* I've added an [[opengraph plugin|plugins/contrib/opengraph/]] in the template so your facebook friends can share your blog posts;
+* We have translated stuff to Brazilian Portuguese totally ignoring the i18n conventions so that kind of broke the template;
+* The "proper way" to use the template is not documented;
+* We did not provide other templates as planned because of the [end of Hacklab Independência](https://we.riseup.net/hiatobr/fim-do-hacklab-independ-ncia);
+
+The webdev collective has just met again and the plan to make multiple ikiwiki blog bootstrap templates will continue, but since I've failed once, this shall wait for results.
+
+As for the [[theme_market]] page, since the modifications didn't provide much innovation, mine included, I've [edited the page](http://source.ikiwiki.branchable.com/?p=source.git;a=commit;h=b18ae270ac7b93fe51f83bd7dc885d068165e407), see if it seems cleaner now.
+
+--[[desci]]
+
+---
+
+There you go, I've provided a minimalistic [[Bootstrap 3 Template|/forum/bootstrap_theme]] that should behave the proper way (tm) and it's easy as cloning the repository on `/usr/share/ikiwiki/themes/boostrap` and setting `theme: bootstrap`.
+
+I've saved an [example on the wayback machine](https://web.archive.org/web/20160409044511/https://dev.iikb.org/forum/Tema_bootstrap/), because I will continue to improve that theme and the idea now is to make multiple variations of it, so the user has a choice. For example, changing the navbar from black to white requires some bootstrap specific changes, so I'll probably make another theme just for that.
+
+--[[desci]]
index 4b3deb2ea270bc2189c2b50d52b241fbd38ae2cd..492418b5aee639287da3f2f94d9f4a54fe746772 100644 (file)
@@ -46,7 +46,7 @@ Usage instructions are in the `README` file.
    vertical list instead of an horizontal list)
  * PageList, through [[ikiwiki/directive/map]]
  * MonthCalendar, partially, through [[ikiwiki/directive/calendar]]
- * FootNote, through markdown
+ * FootNote, through multimarkdown (`[^foo]` â†’ `[^foo]: this is the footnote`)
  * Anchor, through markdown and plain HTML
  * `<<BR>>`, through the weird line ending thing
  * AttachList, through a weird [[ikiwiki/directive/inline]]
index a33c8f385a91377804aaa087a56b00cfabd00d8a..3fc4048204ac6829944094d27dfe2ee8c5188627 100644 (file)
@@ -82,6 +82,32 @@ made into a startup script in `init.d`. You may also need to make this file writ
 
     chmod a+w /tmp/fcgi.socket
 
+If you have [systemd](https://en.wikipedia.org/wiki/Systemd), you may use a service file like so:
+
+Edit/create a service file (in Debian it would be: `sudo vim /lib/systemd/system/ikiwiki.service`
+
+Content of `ikiwiki.service`:
+
+    [Unit]
+    Description=Ikiwiki fcgi socket wrap
+    After=network.target
+    
+    [Service]
+    Type=simple
+    User=www-data
+    Group=www-data
+    ExecStart=/usr/bin/spawn-fcgi -s /tmp/fcgi.socket -n -- /usr/sbin/fcgiwrap
+    
+    [Install]
+    WantedBy=multi-user.target
+
+Then run:
+
+    # This enables the service at startup
+    sudo systemctl enable ikiwiki.service
+    # This attempts to start the service
+    sudo systemctl start ikiwiki.service
+
 Then you need an nginx config plugged in that wrapper. Here's an
 example virtual host configuration:
 
index a59d4b5ad48595418d915b12382370f82a3b3064..629fae8721459837a75754638749ed4792df0068 100644 (file)
@@ -238,7 +238,7 @@ sub unique_comment_location {
 I modified the script a bit so categories and tags would actually show up in the output file.
 
 -----
-[[!format '''
+[[!format python '''
 #!/usr/bin/env python
 
 """
@@ -353,7 +353,7 @@ I have another version of the script, which uses the `timestamp` from the script
 (Hopefully I've escaped everything properly; if I missed something, check the source.)
 
 -----
-[[!format '''
+[[!format python '''
 #!/usr/bin/env python
 
 """
index 4f447833081a059c3d82fd0482c176ac093abc34..208e5f6ea371f406c5e33d4889c54b0613496e52 100644 (file)
@@ -1,6 +1,7 @@
 [[!template id=gitbranch branch=jcflack/config-envsave
 author="[[Chapman Flack|jcflack]]"
 browse=https://github.com/joeyh/ikiwiki/pull/14]]
+[[!tag reviewed]]
 
 I created this [[!taglink patch]] in advance of writing the [[plugins/contrib/signinview]] plugin. This patch does nothing `signinview`-specific, but simply refactors wrapper generation a bit so that plugins have some influence over what environment variables a wrapper will preserve.
 
diff --git a/doc/todo/Preferred_option_for___34__Page_location__34__.mdwn b/doc/todo/Preferred_option_for___34__Page_location__34__.mdwn
new file mode 100644 (file)
index 0000000..977d8d2
--- /dev/null
@@ -0,0 +1,8 @@
+It looks like the auto-generated options for "Page location" are:
+
+ * enforced_lowercase
+ * Capitals_As_Typed
+ * subpage/enforced_lowercase
+ * subpage/Capitals_As_Typed
+
+And the default option is `Capitals_As_Typed`. If it isn't already possible (and I've just missed it), could future version allow the admin to pick which of these is the default? (I'd prefer `subpage/enforced_lowercase`)
diff --git a/doc/todo/Reduce_browser_wait_after_adding_comment.mdwn b/doc/todo/Reduce_browser_wait_after_adding_comment.mdwn
new file mode 100644 (file)
index 0000000..11bd0de
--- /dev/null
@@ -0,0 +1,15 @@
+Instead of waiting to complete the full ``refresh`` return to commented page
+as soon as it has been rebuilt.
+
+After commenting on a page the browser wait for what I presume to be the whole
+``--refresh`` to finish. This is often a considerable lag and many users think
+something has gone wrong (at least my users). The actual commented page is
+often regenerated quite quickly as you notice by clicking the backbutton
+immediately after posting a comment.  The rest of the time ikiwiki spends
+regenerating dependent pages such as inlines etc.
+
+I don't know if ikiwiki can communicate that a single specific page has been
+regenerated but if possible it would greatly improve the interactivity of
+ikiwiki.
+
+[[!tag wishlist]]
diff --git a/doc/todo/admonitions.mdwn b/doc/todo/admonitions.mdwn
new file mode 100644 (file)
index 0000000..50f62bf
--- /dev/null
@@ -0,0 +1,125 @@
+In the [MoinMoin wiki][], there is this neat little hack called
+[Admonitions][] that basically create a `<div>` block with a specific
+style out of a certain section of the text.
+
+I couldn't find a way to do this easily in Ikiwiki. On the one hand,
+there is no easy way to create div blocks with arbitrary styles (which
+is basically what MoinMoin admonitions are). On the other hand, there
+are no neat little logos in stylesheets like there are in Moinmoin
+either.
+
+It would be great to see this implemented in Ikiwiki. Now, I know I
+can make a `<div>` myself, but I am not sure we should encourage users
+to inject arbitrary HTML in ikiwiki pages. And even then, we should
+add adminition CSS classes to make that easier to use.
+
+Ideally, Ikiwiki would support Pandoc or Github-style fenced blocks
+and could abuse those to allow arbitrary styles (and markup!) to kick
+in. The [[ikiwiki/directive/format]] directive could also be used, I
+guess, but I dislike how it requires all those brackets and quotes and
+bangs and all...
+
+-- [[anarcat]]
+
+[MoinMoin wiki]: https://moinmo.in/
+[Admonitions]: https://moinmo.in/HelpOnAdmonitions
+
+> ikiwiki's general design is that it supports exactly three forms
+> of markup:
+>
+> * whatever the `htmlize` plugin does
+> * as a special ikiwiki-specific extension, \[[wikilinks]]
+> * as another special ikiwiki-specific extension, \[[!directives]]
+>
+> All markup interpretation beyond wikilinks and directives is
+> the `htmlize` plugin's responsibility. The `mdwn` plugin
+> interprets Markdown, the `rst` plugin interprets
+> reStructuredText and so on.
+>
+> It sounds as though you're asking for a `htmlize` plugin which
+> interprets an extended dialect of Markdown:
+>
+> * standard Markdown (inasmuch as such a thing exists) as usual
+> * mapping certain syntax (what?) to "admonitions"
+>
+> ikiwiki deliberately doesn't implement Markdown parsing, it just
+> calls out to one of several Perl implementations of Markdown.
+>
+> Alternatively, you could have a small plugin that translates
+>
+>     [[!warning "Do what I say, not as I do."]]
+>
+> into an appropriate `<div>`. That's the "lightest" form of
+> markup that is built into ikiwiki itself.
+>
+> Alternatively^2, some different hook (I think [[plugins/typography]]
+> might use the right one?) could interpret an ad-hoc syntax and
+> turn it into a `<div>` either before or after `htmlize` processing.
+> However, that would be adding an extra layer of syntax for your
+> users to keep track of.
+>
+> [[templates|ikiwiki/directive/template]] are another way this could
+> work:
+>
+>     \[[!template id=warning text="Do as I say, not as I do."]]
+>
+> There's a "note" template bundled with ikiwiki already.
+>
+> --[[smcv]]
+
+>> I think you mean the `htmlize` hook, as I cannot find any `htmlize`
+>> plugin.. That said, yeah, i understand the limitations of Ikiwiki
+>> here. I guess that the [[ikiwiki/directive/template]] directive is a
+>> good workaround, but it's not really shorter to write:
+>>
+>>     \[[!template id=warning text="Do as I say, not as I do."]]
+>>
+>> than to write:
+>>
+>> [[!format txt """<div class="warning">Do as I say, not as I do.</div>"""]]
+>>
+>> ... in fact, it's actually longer. So short of allowing arbitrary
+>> classes *and* fenced blocks, I don't think this can go much
+>> further.
+>>
+>> We *could*, however, import the admonition styles from MoinMoin
+>> directly. It would involve importing 5 icons from MoinMoin and
+>> creating associated styles. Is that something you would be open to?
+>>
+>> --[[anarcat]]
+
+>> Looking more at the MoinMoin images, the source (and license!) for
+>> them is not quite clear, so they don't make such great targets for
+>> inclusion. They are, nevertheless, included in Debian so presumably
+>> they are DFSG-friendly? The copyright file marks them as "UNKNOWN"
+>> which is worrisome... I have found the following results about them:
+>>
+>> * [admon-warning.png][] seems to be [public domain according to this sketchy site][]
+>> * [admon-note.png][] seems to have a [source in XFCE][], as part of
+>>   the notes plugin
+>> * [admon-tip.png][] is used in the Debian release notes, so is
+>presumably fine as well [source there](https://www.debian.org/releases/testing/amd64/release-notes/images/note.png)
+>> * [admon-important.png][], same, [important.png](https://www.debian.org/releases/testing/amd64/release-notes/images/important.png)
+>> * [admon-caution.png][] can be found in Mediawiki as well, which is
+>> a good source of icons. According to Debian, some are public domain,
+>> some are LGPL (!?). In MediaWiki itself, the source of that file is
+>> lost in the mists of time.
+>>
+>> Even though there is some confusion about the source of those
+>> images, I think, in good faith, that they can be generally be
+>> considered reusable. --[[anarcat]]
+
+[public domain according to this sketchy site]: http://all-free-download.com/free-vector/download/tango_process_stop_115912.html
+[source in XFCE]: http://git.xfce.org/panel-plugins/xfce4-notes-plugin/tree/data/icons/scalable/xfce4-notes-plugin.svg
+[admon-warning.png]: https://moinmo.in/moin_static19/modernized/img/admon-warning.png
+[admon-note.png]: https://moinmo.in/moin_static19/modernized/img/admon-note.png
+[admon-tip.png]: https://moinmo.in/moin_static19/modernized/img/admon-tip.png
+[admon-important.png]: https://moinmo.in/moin_static19/modernized/img/admon-important.png
+[admon-caution.png]: https://moinmo.in/moin_static19/modernized/img/admon-caution.png
+
+Update: I have made a [[plugins/contrib/admonition]] plugin for this
+purpose, as a patch. Hopefully it will be mergeable here? Here's a
+screenshot of what the help page would look like, to give you an idea
+of the results:
+
+<img src="http://paste.anarc.at/snaps/snap-2016.04.15-18.07.39.png" />
diff --git a/doc/todo/compatible_templates.mdwn b/doc/todo/compatible_templates.mdwn
new file mode 100644 (file)
index 0000000..687515d
--- /dev/null
@@ -0,0 +1,34 @@
+As requested per IRC:
+
+    18:07:32  * RichiH notes (again) that if ikiwiki produced html which fit the common template standards, there would be hundreds of high quality templates there for the taking ;)
+    18:09:47 < smcv> RichiH: where by "common template standards" you mean "something specific to bootstrap"?
+    18:10:05 < smcv> or is there an actual standard with some sort of spec, a la microformats?
+    18:32:16 < RichiH> smcv: all the free webdesign sites have one shared format
+    18:32:48 < RichiH> iirc, there's a patchset for ikiwiki. again iirc, it was already old by debconf13 when we discussed that
+    18:35:16 < smcv> RichiH: please point me to something I can review, I'll try to look at it
+    18:35:40 < smcv> RichiH: also please point to something resembling a specification so I can tell whether the patchset is appropriate
+    18:36:12 < smcv> RichiH: you certainly didn't discuss anything with me at dc13, I haven't been to a debconf since 7 :-)
+    18:38:57 < RichiH> smcv: we discussed it with joeyh 
+    18:39:04 < RichiH> i forgot the name of the other guy with the patch series
+    18:39:39 < RichiH> http://penta.debconf.org/dc13_schedule/events/1060.en.html should have interesting bits and pieces
+    18:42:37 < smcv> please open a todo on ikiwiki.info?
+    18:42:53 < smcv> sorry, I am not going to remember this when not at work
+
+I think it was anarcat who had the patches
+
+> For the record, I don't quite know what we are talking about here. I
+> was not aware there was such a thing as a "common template
+> standard". Also, all my work on Ikiwiki has been published in this
+> wiki, as far as I know. I have made a [custom theme][], which is
+> linked in the [[theme_market]] and also worked on the
+> [bootstrap theme][]... which is now basicallly irrelevant because
+> someone else ported bootstrap4 to ikiwiki (see
+> [ikistrap][]). -- [[anarcat]]
+
+---
+
+I've started [yet another bootstrap theme](https://notabug.org/iikb/ikiwiki-theme-bootstrap). The main reason being because I wanted a theme that actually worked within the [[theme plugin|/plugins/theme]] without changing anything else, and [[I've made it|/forum/bootstrap_theme]]. --[[desci]]
+
+[ikistrap]: https://github.com/gsliepen/ikistrap
+[bootstrap theme]: https://anarc.at/blog/2015-09-09-bootstrap/
+[custom theme]: http://anarcat.ath.cx/night_city/README/
diff --git a/doc/todo/highlight_line_numbers.mdwn b/doc/todo/highlight_line_numbers.mdwn
new file mode 100644 (file)
index 0000000..b5d2ef3
--- /dev/null
@@ -0,0 +1,7 @@
+The highlight library used by the highlight plugin has many features that are not accessible through the ikiwiki format directive.  I've created a patch that exposes the line numbering option and opens the door to expose other options more easily.
+
+The [[!taglink patch]] is in a github branch here: <https://github.com/trapperhoney/ikiwiki/tree/linenumbers>
+
+I made a test/demo of the feature here: <http://www.angrydoughnuts.com/temp/ikiwiki/>
+
+And the updated plugin documentation is here: <http://www.angrydoughnuts.com/temp/ikiwiki/html/plugins/highlight.html>
diff --git a/doc/todo/merge_bootstrap_branch.mdwn b/doc/todo/merge_bootstrap_branch.mdwn
new file mode 100644 (file)
index 0000000..ee42bf5
--- /dev/null
@@ -0,0 +1,23 @@
+I've prepared a bootstrap branch based on
+<https://github.com/gsliepen/ikistrap>. 
+
+Main impediment to merging it is jquery; bootstrap probably needs
+a newer version than the 1.6.2 included in ikiwiki and upgrading
+it would need testing the parts of ikiwiki that use jquery.
+
+It also needs to include bootstrap 4 in ikiwiki, rather than pulling
+it from the CDN, probably. Although depending on a debian package
+would be nicer, if bootstrap 4 got packaged in Debian.
+
+Note that the template changes are not entirely optimial, but I
+did them in a way that makes the diff pretty clear that nothing changes
+except when the bootstrap theme is enabled.
+
+--[[Joey]]
+
+> [bootstrap3 is in debian](https://tracker.debian.org/pkg/twitter-bootstrap3).
+> As far as I know, there is no effort to package b4 just yet,
+> maybe a RFP?
+>
+> My work on bootstrap also involved some changes to the base templates,
+> not sure there is a way to work around that. --[[anarcat]]
diff --git a/doc/todo/open_external_link_in_new_window.mdwn b/doc/todo/open_external_link_in_new_window.mdwn
new file mode 100644 (file)
index 0000000..cc7a1d4
--- /dev/null
@@ -0,0 +1,5 @@
+We are embedding ikiwiki in a frame. When clicking around within the wiki, it makes sense to stay in the frame. But when clicking on an external link, it makes more sense to open the link in a new window (new tab). Especially if the link is to the containing website, otherwise we end up with some kind site-within-the-site situation.
+
+Is there an equivalent to `<a href="blah" target="_blank">...</a>` for Markdown links, or a way to enforce it?
+
+(I am aware from [[CSS_classes_for_links]] and [[rel__61__nofollow_on_external_links]] that this may not be possible because rules for external links are tricky/impossible. If it's possible to do it manually, that would be "good enough".)
diff --git a/doc/users/Anton_Eliasson.mdwn b/doc/users/Anton_Eliasson.mdwn
new file mode 100644 (file)
index 0000000..3d09d64
--- /dev/null
@@ -0,0 +1 @@
+[[!meta redir="anton"]]
diff --git a/doc/users/anton.mdwn b/doc/users/anton.mdwn
new file mode 100644 (file)
index 0000000..2b65117
--- /dev/null
@@ -0,0 +1,3 @@
+[[!meta title="Anton Eliasson"]]
+
+[Anton uses Ikiwiki](https://www.antoneliasson.se/)
diff --git a/doc/users/david_rix.mdwn b/doc/users/david_rix.mdwn
new file mode 100644 (file)
index 0000000..e6bbe0c
--- /dev/null
@@ -0,0 +1,3 @@
+[[!meta title="David Rix"]]
+
+Just another ikiwiki user.
index 47335b93b5e4710003ec9d3e0c02086d073d7ed3..dce4ea48feba8a73070bbc7080d10a61f9c93a2f 100644 (file)
@@ -1,13 +1,24 @@
-Sites I am using Ikiwiki with the [[bootstrap 3 theme|/theme_market]]:
+# Personal information
 
-* <https://hi.ato.br>
-* <https://capoeira.li/blog>
-* <http://dissertosradicais.tem.blog.br>
-* <http://epelaspracasnaoteranome.tem.blog.br>
-* <http://iuri.tem.blog.br>
-* <http://mim.tem.blog.br>
-* <http://piratas.xyz>
+<https://desci.xyz>
 
 ---
 
+# Ikiwiki Plugins
+
 A plugin to add facebook spyware to your ikiwiki: [[plugins/contrib/opengraph/]]
+
+---
+
+# Ikiwiki Themes
+
+A theme to add [bootstrap 3](https://getbootstrap.com) to ikiwiki without overhauling the installation: [[forum/bootstrap_theme]]
+
+---
+
+# Ikiwiki Sites
+
+## Currently online:
+
+* <https://dev.iikb.org>
+* <https://dev.iikb.xyz> (proxy_pass)
diff --git a/doc/users/public.mdwn b/doc/users/public.mdwn
new file mode 100644 (file)
index 0000000..1cb50e1
--- /dev/null
@@ -0,0 +1,5 @@
+[[!img p238572.jpg align="right" size="" alt=""]]
+
+# About me
+
+- I'm Cheung, from China.
index efa3bb6a92ae3a23e2fa5a4744608db01f4a9def..ff594fd122dc261475f4df15e81024892d6b298a 100644 (file)
@@ -9,7 +9,7 @@ pages="!*/Discussion and ((link(users/schmonz) and plugins/* and !plugins/openid
 ## Public
 
 * [My personal web site](http://www.schmonz.com/)
-* [A very small podcast](http://agilein3minutes.com/)
+* [A very small podcast](https://agilein3minut.es/)
 * [A major open-source project's wiki](http://wiki.netbsd.org) (with
   the [[rcs/cvs]] plugin)
 * [An undergraduate group's university-provided-static-hosted
index cc8f346455862bd2960ae0146971d9a0a6a108cc..7a17a0683bd5f374b4a02233fa290218481e0f94 100644 (file)
@@ -21,7 +21,7 @@ use IkiWiki::Setup::Standard {
        underlaydirbase => "underlays",
        underlaydir => "underlays/basewiki",
        discussion => 0,
-       exclude => qr/\/discussion|bugs\/*|todo\/*|forum\/*|sandbox\/*/, # save space
+       exclude => qr/\/discussion|bugs\/*|todo\/*|forum\/*|sandbox\/*|users\/*/, # save space
        locale => '',
        verbose => 1,
        syslog => 0,
index 0891766ab6f154ae1f7977c49a58a7d86f44996b..1c7baead0d6849b223093fd8a75a7470f7a6f11c 100755 (executable)
@@ -115,7 +115,7 @@ sub exec_editor {
                @editor=split(' ', $ENV{EDITOR});
        }
        if (exists $ENV{VISUAL}) {
-       @editor=split(' ', $ENV{VISUAL});
+               @editor=split(' ', $ENV{VISUAL});
        }
        exec(@editor, $file);
 }
diff --git a/t/cvs.t b/t/cvs.t
index 43a2ca3a81f77e07afb997c3e118e64957ba1e81..371c21ec9f7ab53418ac344f5545e6347a11046d 100755 (executable)
--- a/t/cvs.t
+++ b/t/cvs.t
@@ -609,10 +609,10 @@ sub _generate_and_configure_post_commit_hook {
 
        require IkiWiki::Wrapper;
        if ($installed) {
-               $IkiWiki::program_to_wrap = 'ikiwiki.out';
+               $IkiWiki::program_to_wrap = `which ikiwiki`;
        }
        else {
-               $IkiWiki::program_to_wrap = `which ikiwiki`;
+               $IkiWiki::program_to_wrap = './ikiwiki.out';
        }
        # XXX substitute its interpreter to Makefile's $(PERL)
        # XXX best solution: do this to all scripts during build
diff --git a/t/img.t b/t/img.t
index b73988b7caba703983e9b012212b06bc1ab01e54..71b69914e14550c30f339e78cb45395726c5820d 100755 (executable)
--- a/t/img.t
+++ b/t/img.t
@@ -36,7 +36,6 @@ else {
 push @command, qw(--set usedirs=0 --plugin img t/tmp/in t/tmp/out --verbose);
 
 my $magick = new Image::Magick;
-my $SVGS_WORK = defined $magick->QueryFormat("svg");
 
 $magick->Read("t/img/twopages.pdf");
 my $PDFS_WORK = defined $magick->Get("width");
@@ -44,24 +43,26 @@ my $PDFS_WORK = defined $magick->Get("width");
 ok(! system("rm -rf t/tmp; mkdir -p t/tmp/in"));
 
 ok(! system("cp t/img/redsquare.png t/tmp/in/redsquare.png"));
+ok(! system("cp t/img/redsquare.jpg t/tmp/in/redsquare.jpg"));
+ok(! system("cp t/img/redsquare.jpg t/tmp/in/redsquare.jpeg"));
 # colons in filenames are a corner case for img
 ok(! system("cp t/img/redsquare.png t/tmp/in/hello:world.png"));
 ok(! system("cp t/img/redsquare.png t/tmp/in/a:b:c.png"));
 ok(! system("cp t/img/redsquare.png t/tmp/in/a:b:c:d.png"));
 ok(! system("cp t/img/redsquare.png t/tmp/in/a:b:c:d:e:f:g:h:i:j.png"));
 
-if ($SVGS_WORK) {
-       writefile("bluesquare.svg", "t/tmp/in",
-               '<svg width="30" height="30"><rect x="0" y="0" width="30" height="30" fill="blue"/></svg>');
-}
+writefile("bluesquare.svg", "t/tmp/in",
+       '<svg width="30" height="30"><rect x="0" y="0" width="30" height="30" fill="blue"/></svg>');
+ok(! system("cp t/tmp/in/bluesquare.svg t/tmp/in/really-svg.png"));
+ok(! system("cp t/tmp/in/bluesquare.svg t/tmp/in/really-svg.bmp"));
+ok(! system("cp t/tmp/in/bluesquare.svg t/tmp/in/really-svg.pdf"));
 
 # using different image sizes for different pages, so the pagenumber selection can be tested easily
 ok(! system("cp t/img/twopages.pdf t/tmp/in/twopages.pdf"));
-
-my $maybe_svg_img = "";
-if ($SVGS_WORK) {
-       $maybe_svg_img = "[[!img bluesquare.svg size=10x]]";
-}
+ok(! system("cp t/img/twopages.pdf t/tmp/in/really-pdf.jpeg"));
+ok(! system("cp t/img/twopages.pdf t/tmp/in/really-pdf.jpg"));
+ok(! system("cp t/img/twopages.pdf t/tmp/in/really-pdf.png"));
+ok(! system("cp t/img/twopages.pdf t/tmp/in/really-pdf.svg"));
 
 my $maybe_pdf_img = "";
 if ($PDFS_WORK) {
@@ -73,18 +74,31 @@ EOF
 
 writefile("imgconversions.mdwn", "t/tmp/in", <<EOF
 [[!img redsquare.png]]
+[[!img redsquare.jpg size=11x]]
+[[!img redsquare.jpeg size=12x]]
 [[!img redsquare.png size=10x]]
 [[!img redsquare.png size=30x50]] expecting 30x30
 [[!img hello:world.png size=x8]] expecting 8x8
 [[!img a:b:c.png size=x4]]
 [[!img a:b:c:d:e:f:g:h:i:j.png size=x6]]
-$maybe_svg_img
+[[!img bluesquare.svg size=42x]] expecting 42x
+[[!img bluesquare.svg size=x43]] expecting x43
+[[!img bluesquare.svg size=42x43]] expecting 42x43 because aspect rario not preserved
 $maybe_pdf_img
+
+# bad ideas
+[[!img really-svg.png size=666x]]
+[[!img really-svg.bmp size=666x]]
+[[!img really-svg.pdf size=666x]]
+[[!img really-pdf.jpeg size=666x]]
+[[!img really-pdf.jpg size=666x]]
+[[!img really-pdf.png size=666x]]
+[[!img really-pdf.svg size=666x]]
 EOF
 );
 ok(utime(333333333, 333333333, "t/tmp/in/imgconversions.mdwn"));
 
-ok(! system(@command));
+ok(! system(@command, '--set-yaml', 'img_allowed_formats=[jpeg, png, svg, pdf]'));
 
 sub size($) {
        my $filename = shift;
@@ -102,13 +116,9 @@ my $outhtml = readfile("$outpath.html");
 is(size("$outpath/10x-redsquare.png"), "10x10");
 ok(! -e "$outpath/30x-redsquare.png");
 ok($outhtml =~ /width="30" height="30".*expecting 30x30/);
-
-SKIP: {
-       skip "SVG support not installed (try libmagickcore-extra)", 1
-               unless $SVGS_WORK;
-       # if this fails, you need libmagickcore-6.q16-2-extra installed
-       is(size("$outpath/10x-bluesquare.png"), "10x10");
-}
+ok($outhtml =~ /width="42".*expecting 42x/);
+ok($outhtml =~ /height="43".*expecting x43/);
+ok($outhtml =~ /width="42" height="43".*expecting 42x43/);
 
 SKIP: {
        skip "PDF support not installed (try ghostscript)", 2
@@ -122,6 +132,29 @@ is(size("$outpath/x8-hello:world.png"), "8x8");
 is(size("$outpath/x4-a:b:c.png"), "4x4");
 is(size("$outpath/x6-a:b:c:d:e:f:g:h:i:j.png"), "6x6");
 
+is(size("$outpath/11x-redsquare.jpg"), "11x11");
+is(size("$outpath/12x-redsquare.jpeg"), "12x12");
+like($outhtml, qr{src="(\./)?imgconversions/11x-redsquare\.jpg" width="11" height="11"});
+like($outhtml, qr{src="(\./)?imgconversions/12x-redsquare\.jpeg" width="12" height="12"});
+
+# We do not misinterpret images
+my $quot = qr/(?:"|&quot;)/;
+like($outhtml, qr/${quot}really-svg\.png${quot} does not seem to be a valid png file/);
+ok(! -e "$outpath/666x-really-svg.png");
+ok(! -e "$outpath/666x-really-svg.bmp");
+like($outhtml, qr/${quot}really-pdf\.jpeg${quot} does not seem to be a valid jpeg file/);
+ok(! -e "$outpath/666x-really-pdf.jpeg");
+like($outhtml, qr/${quot}really-pdf\.jpg${quot} does not seem to be a valid jpeg file/);
+ok(! -e "$outpath/666x-really-pdf.jpg");
+like($outhtml, qr/${quot}really-pdf\.png${quot} does not seem to be a valid png file/);
+ok(! -e "$outpath/666x-really-pdf.png");
+
+# disable support for uncommon formats and try again
+ok(! system(@command, "--rebuild"));
+ok(! -e "$outpath/10x-bluesquare.png");
+ok(! -e "$outpath/12x-twopages.png");
+ok(! -e "$outpath/16x-p1-twopages.png");
+
 # now let's remove them again
 
 if (1) { # for easier testing
diff --git a/t/img/redsquare.jpg b/t/img/redsquare.jpg
new file mode 100644 (file)
index 0000000..565d7f3
Binary files /dev/null and b/t/img/redsquare.jpg differ
index 0de32811b7a88250e62b72b05eddf1e5d655467a..b5122b15f524eae31f5293132c459ce189ad72ba 100644 (file)
@@ -19,3 +19,4 @@
 <pre>
 <TMPL_VAR diff>
 </pre>
+</div>