tagging version 3.20120202

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIVAwUATytJp8kQ2SIlEuPHAQgKeg/+MPL9KcL13f1DQUwu9TXEr7hSocn3NTa/
 LMvLJvrzqI5BGRP+jBGFG/Kn9yFt6S4gdCvpOwi1INxAanLQnaVoSLoie1teUbU3
 dxi8f3wGMBtEX+BiOi9gbjxF2v98D+Fh73O9H7newsEJiRDRor7U4EE1dWC8uidc
 d/9vhWkaDy1BlEahaU85v7RY94h5EnEzgD0Rm7wkSSr1aquQsr89OijC6SY0dEJe
 b6AunkRqsOGDrm6elSRFi6E5eStPhIu2t6GmyhpulWn5vr4PyqdWZ7jcWvDGYr+r
 v2iuses1fH8qWE1CQ6Y2XadK7Cj2IbGhaiLXp3TdbPgKnB7BS89cSWRKQ5SlvTlJ
 sUUPauhLDMqp1Cux6oUgs5T9ADTO922p1FzR3JuTkgwNLWH7UXTRuwVvtPz4aKqN
 QBmQeknTTQAxqi+DhgBK+CXM7LIt3d2TaoUFt6gl4kKt3FYzGfyh9ohhDSQniAa8
 C52InJ2X5bamz8/fIcELChg+wBT+naQrDW7V74kFKvWzIwnqfvseaF3zVqDgYLQy
 e12vL6GAdnO66VhzULU1NyH/XNvfyKEpwiKHPwCEK5wPTLweWBqjU0952GDBlUov
 PDDoQgwijnSCSxJOcEsAnnpkT16pw0VWHTSLrqkYYZBg7WGkZbhwk4cRVkqcsMK7
 JjKUdA9rK0E=
 =KLr6
 -----END PGP SIGNATURE-----

Merge tag '3.20120202' into trail3-integrated
master
Simon McVittie 2012-03-18 15:31:41 +00:00
commit 4e54fa1144
245 changed files with 4678 additions and 1299 deletions

View File

@ -16,7 +16,7 @@ perl -MCPAN -e 'install Bundle::IkiWiki'
=head1 CONTENTS
Text::Markdown
Text::Markdown::Discount
HTML::Scrubber
HTML::Template
HTML::Parser
@ -28,7 +28,7 @@ CGI::Session
Mail::Sendmail
CGI
Data::Dumper
YAML
YAML::XS
JSON
RPC::XML

View File

@ -20,7 +20,7 @@ use Exporter q{import};
our @EXPORT = qw(hook debug error htmlpage template template_depends
deptype add_depends pagespec_match pagespec_match_list bestlink
htmllink readfile writefile pagetype srcfile pagename
displaytime will_render gettext ngettext urlto targetpage
displaytime strftime_utf8 will_render gettext ngettext urlto targetpage
add_underlay pagetitle titlepage linkpage newpagefile
inject add_link add_autofile
%config %links %pagestate %wikistate %renderedfiles
@ -305,9 +305,9 @@ sub getsetup () {
rebuild => 0,
},
umask => {
type => "integer",
example => "022",
description => "force ikiwiki to use a particular umask",
type => "string",
example => "public",
description => "force ikiwiki to use a particular umask (keywords public, group or private, or a number)",
advanced => 1,
safe => 0, # paranoia
rebuild => 0,
@ -587,7 +587,23 @@ sub checkconfig () {
unless exists $config{wikistatedir} && defined $config{wikistatedir};
if (defined $config{umask}) {
umask(possibly_foolish_untaint($config{umask}));
my $u = possibly_foolish_untaint($config{umask});
if ($u =~ m/^\d+$/) {
umask($u);
}
elsif ($u eq 'private') {
umask(077);
}
elsif ($u eq 'group') {
umask(027);
}
elsif ($u eq 'public') {
umask(022);
}
else {
error(sprintf(gettext("unsupported umask setting %s"), $u));
}
}
run_hooks(checkconfig => sub { shift->() });
@ -1132,9 +1148,19 @@ sub formattime ($;$) {
$format=$config{timeformat};
}
return strftime_utf8($format, localtime($time));
}
my $strftime_encoding;
sub strftime_utf8 {
# strftime doesn't know about encodings, so make sure
# its output is properly treated as utf8
return decode_utf8(POSIX::strftime($format, localtime($time)));
# its output is properly treated as utf8.
# Note that this does not handle utf-8 in the format string.
($strftime_encoding) = POSIX::setlocale(&POSIX::LC_TIME) =~ m#\.([^@]+)#
unless defined $strftime_encoding;
$strftime_encoding
? Encode::decode($strftime_encoding, POSIX::strftime(@_))
: POSIX::strftime(@_);
}
sub date_3339 ($) {
@ -2631,8 +2657,14 @@ sub match_link ($$;@) {
}
sub match_backlink ($$;@) {
my $ret=match_link($_[1], $_[0], @_);
$ret->influences($_[1] => $IkiWiki::DEPEND_LINKS);
my $page=shift;
my $testpage=shift;
my %params=@_;
if ($testpage eq '.') {
$testpage = $params{'location'}
}
my $ret=match_link($testpage, $page, @_);
$ret->influences($testpage => $IkiWiki::DEPEND_LINKS);
return $ret;
}

View File

@ -272,6 +272,7 @@ sub attachments_save {
my @attachments;
my $dir=attachment_holding_location($form->field('page'));
foreach my $filename (glob("$dir/*")) {
$filename=Encode::decode_utf8($filename);
next unless -f $filename;
my $destdir=$config{srcdir}."/".
linkpage(IkiWiki::possibly_foolish_untaint(
@ -345,6 +346,7 @@ sub attachment_list ($) {
my $dir=attachment_holding_location($page);
my $heldmsg=gettext("this attachment is not yet saved");
foreach my $file (glob("$dir/*")) {
$file=Encode::decode_utf8($file);
next unless -f $file;
my $base=IkiWiki::basename($file);
my $f=$loc.$base;

View File

@ -22,7 +22,6 @@ use warnings;
use strict;
use IkiWiki 3.00;
use Time::Local;
use POSIX ();
my $time=time;
my @now=localtime($time);
@ -123,10 +122,10 @@ sub format_month (@) {
}
# Find out month names for this, next, and previous months
my $monthabbrev=POSIX::strftime("%b", @monthstart);
my $monthname=POSIX::strftime("%B", @monthstart);
my $pmonthname=POSIX::strftime("%B", localtime(timelocal(0,0,0,1,$pmonth-1,$pyear-1900)));
my $nmonthname=POSIX::strftime("%B", localtime(timelocal(0,0,0,1,$nmonth-1,$nyear-1900)));
my $monthabbrev=strftime_utf8("%b", @monthstart);
my $monthname=strftime_utf8("%B", @monthstart);
my $pmonthname=strftime_utf8("%B", localtime(timelocal(0,0,0,1,$pmonth-1,$pyear-1900)));
my $nmonthname=strftime_utf8("%B", localtime(timelocal(0,0,0,1,$nmonth-1,$nyear-1900)));
my $archivebase = 'archives';
$archivebase = $config{archivebase} if defined $config{archivebase};
@ -182,7 +181,7 @@ EOF
my %dowabbr;
for my $dow ($week_start_day..$week_start_day+6) {
my @day=localtime(timelocal(0,0,0,$start_day++,$params{month}-1,$params{year}-1900));
my $downame = POSIX::strftime("%A", @day);
my $downame = strftime_utf8("%A", @day);
my $dowabbr = substr($downame, 0, 1);
$downame{$dow % 7}=$downame;
$dowabbr{$dow % 7}=$dowabbr;
@ -329,8 +328,8 @@ EOF
for (my $month = 1; $month <= 12; $month++) {
my @day=localtime(timelocal(0,0,0,15,$month-1,$params{year}-1900));
my $murl;
my $monthname = POSIX::strftime("%B", @day);
my $monthabbr = POSIX::strftime("%b", @day);
my $monthname = strftime_utf8("%B", @day);
my $monthabbr = strftime_utf8("%b", @day);
$calendar.=qq{\t<tr>\n} if ($month % $params{months_per_row} == 1);
my $tag;
my $mtag=sprintf("%02d", $month);

3
IkiWiki/Plugin/comments.pm 100755 → 100644
View File

@ -9,7 +9,6 @@ use warnings;
use strict;
use IkiWiki 3.00;
use Encode;
use POSIX qw(strftime);
use constant PREVIEW => "Preview";
use constant POST_COMMENT => "Post comment";
@ -460,7 +459,7 @@ sub editcomment ($$) {
}
$content .= " subject=\"$subject\"\n";
$content .= " date=\"" . decode_utf8(strftime('%Y-%m-%dT%H:%M:%SZ', gmtime)) . "\"\n";
$content .= " date=\"" . strftime_utf8('%Y-%m-%dT%H:%M:%SZ', gmtime) . "\"\n";
my $editcontent = $form->field('editcontent');
$editcontent="" if ! defined $editcontent;

View File

@ -35,10 +35,14 @@ use IkiWiki;
use File::chdir;
# GENERAL PLUGIN API CALLS
sub import {
hook(type => "genwrapper", id => "cvs", call => \&genwrapper);
hook(type => "checkconfig", id => "cvs", call => \&checkconfig);
hook(type => "getsetup", id => "cvs", call => \&getsetup);
hook(type => "genwrapper", id => "cvs", call => \&genwrapper);
hook(type => "rcs", id => "rcs_update", call => \&rcs_update);
hook(type => "rcs", id => "rcs_prepedit", call => \&rcs_prepedit);
hook(type => "rcs", id => "rcs_commit", call => \&rcs_commit);
@ -52,17 +56,6 @@ sub import {
hook(type => "rcs", id => "rcs_getmtime", call => \&rcs_getmtime);
}
sub genwrapper () {
return <<EOF;
{
int j;
for (j = 1; j < argc; j++)
if (strstr(argv[j], "New directory") != NULL)
exit(0);
}
EOF
}
sub checkconfig () {
if (! defined $config{cvspath}) {
$config{cvspath}="ikiwiki";
@ -132,39 +125,22 @@ sub getsetup () {
},
}
sub cvs_info ($$) {
my $field=shift;
my $file=shift;
local $CWD = $config{srcdir};
my $info=`cvs status $file`;
my ($ret)=$info=~/^\s*$field:\s*(\S+)/m;
return $ret;
sub genwrapper () {
return <<EOF;
{
int j;
for (j = 1; j < argc; j++)
if (strstr(argv[j], "New directory") != NULL)
exit(0);
}
EOF
}
sub cvs_runcvs(@) {
my @cmd = @_;
unshift @cmd, 'cvs', '-Q';
local $CWD = $config{srcdir};
open(my $savedout, ">&STDOUT");
open(STDOUT, ">", "/dev/null");
my $ret = system(@cmd);
open(STDOUT, ">&", $savedout);
return ($ret == 0) ? 1 : 0;
}
sub cvs_is_controlling {
my $dir=shift;
$dir=$config{srcdir} unless defined($dir);
return (-d "$dir/CVS") ? 1 : 0;
}
# VCS PLUGIN API CALLS
sub rcs_update () {
return unless cvs_is_controlling;
return unless cvs_is_controlling();
cvs_runcvs('update', '-dP');
}
@ -175,7 +151,7 @@ sub rcs_prepedit ($) {
# The file is relative to the srcdir.
my $file=shift;
return unless cvs_is_controlling;
return unless cvs_is_controlling();
# For cvs, return the revision of the file when
# editing begins.
@ -183,31 +159,13 @@ sub rcs_prepedit ($) {
return defined $rev ? $rev : "";
}
sub commitmessage (@) {
my %params=@_;
if (defined $params{session}) {
if (defined $params{session}->param("name")) {
return "web commit by ".
$params{session}->param("name").
(length $params{message} ? ": $params{message}" : "");
}
elsif (defined $params{session}->remote_addr()) {
return "web commit from ".
$params{session}->remote_addr().
(length $params{message} ? ": $params{message}" : "");
}
}
return $params{message};
}
sub rcs_commit (@) {
# Tries to commit the page; returns undef on _success_ and
# a version of the page with the rcs's conflict markers on failure.
# The file is relative to the srcdir.
my %params=@_;
return unless cvs_is_controlling;
return unless cvs_is_controlling();
# Check to see if the page has been changed by someone
# else since rcs_prepedit was called.
@ -250,9 +208,6 @@ sub rcs_add ($) {
my $parent=IkiWiki::dirname($file);
my @files_to_add = ($file);
eval q{use File::MimeInfo};
error($@) if $@;
until ((length($parent) == 0) || cvs_is_controlling("$config{srcdir}/$parent")){
push @files_to_add, $parent;
$parent = IkiWiki::dirname($parent);
@ -261,15 +216,8 @@ sub rcs_add ($) {
while ($file = pop @files_to_add) {
if (@files_to_add == 0) {
# file
my $filemime = File::MimeInfo::default($file);
if (defined($filemime) && $filemime eq 'text/plain') {
cvs_runcvs('add', $file) ||
warn("cvs add $file failed\n");
}
else {
cvs_runcvs('add', '-kb', $file) ||
warn("cvs add binary $file failed\n");
}
cvs_runcvs('add', cvs_keyword_subst_args($file)) ||
warn("cvs add $file failed\n");
}
else {
# directory
@ -283,7 +231,7 @@ sub rcs_remove ($) {
# filename is relative to the root of the srcdir
my $file=shift;
return unless cvs_is_controlling;
return unless cvs_is_controlling();
cvs_runcvs('rm', '-f', $file) ||
warn("cvs rm $file failed\n");
@ -293,7 +241,7 @@ sub rcs_rename ($$) {
# filenames relative to the root of the srcdir
my ($src, $dest)=@_;
return unless cvs_is_controlling;
return unless cvs_is_controlling();
local $CWD = $config{srcdir};
@ -309,7 +257,7 @@ sub rcs_recentchanges ($) {
my $num = shift;
my @ret;
return unless cvs_is_controlling;
return unless cvs_is_controlling();
eval q{use Date::Parse};
error($@) if $@;
@ -493,4 +441,74 @@ sub rcs_getmtime ($) {
error "rcs_getmtime is not implemented for cvs\n"; # TODO
}
# INTERNAL SUPPORT ROUTINES
sub commitmessage (@) {
my %params=@_;
if (defined $params{session}) {
if (defined $params{session}->param("name")) {
return "web commit by ".
$params{session}->param("name").
(length $params{message} ? ": $params{message}" : "");
}
elsif (defined $params{session}->remote_addr()) {
return "web commit from ".
$params{session}->remote_addr().
(length $params{message} ? ": $params{message}" : "");
}
}
return $params{message};
}
sub cvs_info ($$) {
my $field=shift;
my $file=shift;
local $CWD = $config{srcdir};
my $info=`cvs status $file`;
my ($ret)=$info=~/^\s*$field:\s*(\S+)/m;
return $ret;
}
sub cvs_is_controlling {
my $dir=shift;
$dir=$config{srcdir} unless defined($dir);
return (-d "$dir/CVS") ? 1 : 0;
}
sub cvs_keyword_subst_args ($) {
my $file = shift;
local $CWD = $config{srcdir};
eval q{use File::MimeInfo};
error($@) if $@;
my $filemime = File::MimeInfo::default($file);
# if (-T $file) {
if (defined($filemime) && $filemime eq 'text/plain') {
return ($file);
}
else {
return ('-kb', $file);
}
}
sub cvs_runcvs(@) {
my @cmd = @_;
unshift @cmd, 'cvs', '-Q';
local $CWD = $config{srcdir};
open(my $savedout, ">&STDOUT");
open(STDOUT, ">", "/dev/null");
my $ret = system(@cmd);
open(STDOUT, ">&", $savedout);
return ($ret == 0) ? 1 : 0;
}
1

View File

@ -231,7 +231,7 @@ sub cgi_editpage ($$) {
if ! $form->submitted && lc($page) ne $page;
}
elsif (lc $page eq lc $config{discussionpage}) {
@page_locs=$best_loc=$page="$from/".lc($page);
@page_locs=$best_loc="$from/".lc($page);
}
else {
my $dir=$from."/";

View File

@ -10,7 +10,8 @@ use IPC::Open2;
sub import {
hook(type => "getsetup", id => "graphviz", call => \&getsetup);
hook(type => "preprocess", id => "graph", call => \&graph);
hook(type => "needsbuild", id => "version", call => \&needsbuild);
hook(type => "preprocess", id => "graph", call => \&graph, scan => 1);
}
sub getsetup () {
@ -26,66 +27,117 @@ my %graphviz_programs = (
"dot" => 1, "neato" => 1, "fdp" => 1, "twopi" => 1, "circo" => 1
);
sub needsbuild {
my $needsbuild=shift;
foreach my $page (keys %pagestate) {
if (exists $pagestate{$page}{graph} &&
exists $pagesources{$page} &&
grep { $_ eq $pagesources{$page} } @$needsbuild) {
# remove state, will be re-added if
# the graph is still there during the rebuild
delete $pagestate{$page}{graph};
}
}
return $needsbuild;
}
sub render_graph (\%) {
my %params = %{(shift)};
my $src = "$params{type} g {\n";
$src .= "charset=\"utf-8\";\n";
my $src = "charset=\"utf-8\";\n";
$src .= "ratio=compress;\nsize=\"".($params{width}+0).", ".($params{height}+0)."\";\n"
if defined $params{width} and defined $params{height};
$src .= $params{src};
$src .= "}\n";
# Use the sha1 of the graphviz code as part of its filename.
# Use the sha1 of the graphviz code as part of its filename,
# and as a unique identifier for its imagemap.
eval q{use Digest::SHA};
error($@) if $@;
my $dest=$params{page}."/graph-".
IkiWiki::possibly_foolish_untaint(Digest::SHA::sha1_hex($src)).
".png";
my $sha=IkiWiki::possibly_foolish_untaint(Digest::SHA::sha1_hex($params{type}.$src));
$src = "$params{type} graph$sha {\n".$src;
my $dest=$params{page}."/graph-".$sha.".png";
will_render($params{page}, $dest);
if (! -e "$config{destdir}/$dest") {
my $map=$pagestate{$params{destpage}}{graph}{$sha};
if (! -e "$config{destdir}/$dest" || ! defined $map) {
# Use ikiwiki's function to create the image file, this makes
# sure needed subdirs are there and does some sanity checking.
writefile($dest, $config{destdir}, "");
my $pid;
my $sigpipe=0;
$SIG{PIPE}=sub { $sigpipe=1 };
$pid=open2(*IN, *OUT, "$params{prog} -Tpng");
$pid=open2(*IN, *OUT, "$params{prog} -Tpng -o '$config{destdir}/$dest' -Tcmapx");
# open2 doesn't respect "use open ':utf8'"
binmode (IN, ':utf8');
binmode (OUT, ':utf8');
print OUT $src;
close OUT;
my $png;
{
local $/ = undef;
$png = <IN>;
}
local $/ = undef;
$map=$pagestate{$params{destpage}}{graph}{$sha}=<IN>;
close IN;
waitpid $pid, 0;
$SIG{PIPE}="DEFAULT";
error gettext("failed to run graphviz") if $sigpipe;
if (! $params{preview}) {
writefile($dest, $config{destdir}, $png, 1);
}
else {
# in preview mode, embed the image in a data uri
# to avoid temp file clutter
eval q{use MIME::Base64};
error($@) if $@;
return "<img src=\"data:image/png;base64,".
encode_base64($png)."\" />";
}
error gettext("failed to run graphviz") if ($sigpipe || $?);
}
return "<img src=\"".urlto($dest, $params{destpage})."\" />\n";
return "<img src=\"".urlto($dest, $params{destpage}).
"\" usemap=\"#graph$sha\" />\n".
$map;
}
sub graph (@) {
my %params=@_;
$params{src} = "" unless defined $params{src};
# Support wikilinks in the graph source.
my $src=$params{src};
$src="" unless defined $src;
$src=IkiWiki::linkify($params{page}, $params{destpage}, $params{src});
return unless defined wantarray; # scan mode short-circuit
if ($src ne $params{src}) {
# linkify makes html links, but graphviz wants plain
# urls. This is, frankly a hack: Process source as html,
# throw out everything inside tags that is not a href.
my $s;
my $nested=0;
use HTML::Parser;
error $@ if $@;
my $p=HTML::Parser->new(api_version => 3);
$p->handler(start => sub {
my %attrs=%{shift()};
if (exists $attrs{href}) {
if ($s=~/href\s*=\s*"$/) {
$s.=$attrs{href};
}
elsif ($s=~/href\s*=\s*$/) {
$s.="\"$attrs{href}\"";
}
else {
$s.="href=\"$attrs{href}\"";
}
}
$nested++;
}, "attr");
$p->handler(end => sub {
$nested--;
});
$p->handler(default => sub {
$s.=join("", @_) unless $nested;
}, "text");
$p->parse($src);
$p->eof;
$params{src}=$s;
}
else {
$params{src}=$src;
}
$params{type} = "digraph" unless defined $params{type};
$params{prog} = "dot" unless defined $params{prog};
error gettext("prog not a valid graphviz program") unless $graphviz_programs{$params{prog}};

View File

@ -52,7 +52,7 @@ sub getsetup () {
sub checkconfig () {
eval q{use highlight};
if (highlight::DataDir->can('new')){
if (highlight::DataDir->can('new')) {
$data_dir=new highlight::DataDir();
$data_dir->searchDataDir("");
} else {

View File

@ -118,7 +118,6 @@ sub preprocess (@) {
error sprintf(gettext("failed to read %s: %s"), $outfile, $r) if $r;
}
else {
($dwidth, $dheight)=($w, $h);
$r = $im->Resize(geometry => "${w}x${h}");
error sprintf(gettext("failed to resize: %s"), $r) if $r;
@ -132,9 +131,10 @@ sub preprocess (@) {
$imglink = $file;
}
}
$dwidth = $im->Get("width") unless defined $dwidth;
$dheight = $im->Get("height") unless defined $dheight;
# always get the true size of the resized image
$dwidth = $im->Get("width");
$dheight = $im->Get("height");
}
}
else {

View File

@ -25,6 +25,13 @@ sub getsetup () {
safe => 1,
rebuild => 1,
},
nodiscount => {
type => "boolean",
example => 0,
description => "disable use of markdown discount?",
safe => 1,
rebuild => 1,
},
}
my $markdown_sub;
@ -50,6 +57,25 @@ sub htmlize (@) {
}
}
}
if (! defined $markdown_sub &&
(! exists $config{nodiscount} || ! $config{nodiscount})) {
eval q{use Text::Markdown::Discount};
if (! $@) {
$markdown_sub=sub {
my $t=shift;
# Workaround for discount binding bug
# https://rt.cpan.org/Ticket/Display.html?id=73657
return "" if $t=~/^\s*$/;
# Workaround for discount's eliding
# of <style> blocks.
# https://rt.cpan.org/Ticket/Display.html?id=74016
$t=~s/<style/<elyts/ig;
my $r=Text::Markdown::Discount::markdown($t);
$r=~s/<elyts/<style/ig;
return $r;
}
}
}
if (! defined $markdown_sub) {
eval q{use Text::Markdown};
if (! $@) {

View File

@ -31,13 +31,21 @@ sub pagetemplate (@) {
my @lines=IkiWiki::rcs_diff($params{rev}, $maxlines+1);
if (@lines) {
my $diff;
my $trunc=0;
if (@lines > $maxlines) {
$diff=join("", @lines[0..($maxlines-1)])."\n".
gettext("(Diff truncated)");
$diff=join("", @lines[0..($maxlines-1)]);
$trunc=1;
}
else {
$diff=join("", @lines);
}
if (length $diff > 102400) {
$diff=substr($diff, 0, 10240);
$trunc=1;
}
if ($trunc) {
$diff.="\n".gettext("(Diff truncated)");
}
# escape html
$diff = encode_entities($diff);
# escape links and preprocessor stuff

View File

@ -201,7 +201,7 @@ sub pagetemplate (@) {
if (defined $tags && %$tags) {
eval q{use HTML::Entities};
$template->param(categories =>
[map { category => HTML::Entities::encode_entities(tagname($_)) },
[map { category => HTML::Entities::encode_entities_numeric(tagname($_)) },
sort keys %$tags]);
}
}

View File

@ -35,10 +35,17 @@ EOF
}
"u != $uid";
} @{$config{untrusted_committers}}).
") exit(0);\n";
") {\n";
$ret.=<<"EOF";
/* Trusted user.
* Consume all stdin before exiting, as git may
* otherwise be unhappy. */
char buf[256];
while (read(0, &buf, 256) != 0) {}
exit(0);
}
asprintf(&s, "CALLER_UID=%i", u);
newenviron[i++]=s;
}

View File

@ -14,7 +14,10 @@ sub import {
sub gendump ($@) {
my $class=shift;
"#!/usr/bin/perl",
my $thisperl = eval q{use Config; $Config{perlpath}};
error($@) if $@;
"#!$thisperl",
"#",
(map { "# $_" } @_),
"use IkiWiki::Setup::Standard {",

View File

@ -11,10 +11,8 @@ sub loaddump ($$) {
my $class=shift;
my $content=shift;
eval q{use YAML::Any};
eval q{use YAML} if $@;
eval q{use YAML::XS};
die $@ if $@;
$YAML::Syck::ImplicitUnicode=1;
IkiWiki::Setup::merge(Load(encode_utf8($content)));
}
@ -35,12 +33,12 @@ sub dumpline ($$$$) {
my $type=shift;
my $prefix=shift;
eval q{use YAML::Old};
eval q{use YAML} if $@;
eval q{use YAML::XS};
die $@ if $@;
$YAML::UseHeader=0;
$YAML::XS::QuoteNumericStrings=0;
my $dump=Dump({$key => $value});
my $dump=decode_utf8(Dump({$key => $value}));
$dump=~s/^---\n//; # yaml header, we don't want
chomp $dump;
if (length $prefix) {
$dump=join("\n", map { $prefix.$_ } split(/\n/, $dump));

View File

@ -19,11 +19,14 @@ SED?=sed
# Additional configurable path variables.
W3M_CGI_BIN?=$(PREFIX)/lib/w3m/cgi-bin
SYSCONFDIR?=/etc/ikiwiki
MANDIR?=$(PREFIX)/share/man
tflag=$(shell if [ -n "$$NOTAINT" ] && [ "$$NOTAINT" != 1 ]; then printf -- "-T"; fi)
extramodules=$(shell if [ "$$PROFILE" = 1 ]; then printf -- "-d:NYTProf"; fi)
outprogs=ikiwiki.out ikiwiki-transition.out ikiwiki-calendar.out
scripts=ikiwiki-update-wikilist ikiwiki-makerepo
sysconfdir_scripts=ikiwiki-mass-rebuild ikiwiki-update-wikilist
PROBABLE_INST_LIB=$(shell \\
if [ "$(INSTALLDIRS)" = "perl" ]; then \\
@ -42,7 +45,7 @@ PROBABLE_INST_LIB=$(shell \\
ikiwiki.setup:
HOME=/home/me $(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.in -dumpsetup ikiwiki.setup
extra_build: $(outprogs) ikiwiki.setup docwiki
extra_build: $(outprogs) ikiwiki.setup docwiki sysconfdir
./mdwn2man ikiwiki 1 doc/usage.mdwn > ikiwiki.man
./mdwn2man ikiwiki-mass-rebuild 8 doc/ikiwiki-mass-rebuild.mdwn > ikiwiki-mass-rebuild.man
./mdwn2man ikiwiki-makerepo 1 doc/ikiwiki-makerepo.mdwn > ikiwiki-makerepo.man
@ -50,12 +53,15 @@ extra_build: $(outprogs) ikiwiki.setup docwiki
./mdwn2man ikiwiki-update-wikilist 1 doc/ikiwiki-update-wikilist.mdwn > ikiwiki-update-wikilist.man
./mdwn2man ikiwiki-calendar 1 doc/ikiwiki-calendar.mdwn > ikiwiki-calendar.man
$(MAKE) -C po
$(SED) -i.bkp "s/Version:.*/Version: $(VER)/" ikiwiki.spec
$(PERL) -pi.bkp -e "s/Version:.*/Version: $(VER)/" ikiwiki.spec
rm -f ikiwiki.spec.bkp
docwiki:
$(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.in -setup docwiki.setup -refresh
sysconfdir:
$(PERL) -pi -e "s|/etc/ikiwiki|$(SYSCONFDIR)|g" $(sysconfdir_scripts)
extra_clean:
$(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.in -setup docwiki.setup -clean
rm -f *.man $(outprogs) ikiwiki.setup plugins/*.pyc
@ -70,7 +76,7 @@ underlay_install:
for dir in `cd underlays && $(FIND) . -follow -type d`; do \
install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
for file in `$(FIND) underlays/$$dir -follow -maxdepth 1 -type f -not -name \\*.full.js -not -name \\*.full.css`; do \
cp -aL $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir 2>/dev/null || \
cp -pRL $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir 2>/dev/null || \
install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
done; \
done
@ -79,7 +85,7 @@ underlay_install:
install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/directives/ikiwiki/directive
for file in doc/ikiwiki/directive/*; do \
if [ -f "$$file" ]; then \
cp -aL $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/directives/ikiwiki/directive 2>/dev/null || \
cp -pRL $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/directives/ikiwiki/directive 2>/dev/null || \
install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/directives/ikiwiki/directive; \
fi \
done
@ -94,7 +100,7 @@ underlay_install:
elif echo "$$file" | grep -q base.css; then \
:; \
elif [ -f "$$file" ]; then \
cp -aL $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$file 2>/dev/null || \
cp -pRL $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$file 2>/dev/null || \
install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$file; \
fi \
done; \
@ -106,7 +112,7 @@ extra_install: underlay_install
install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$dir; \
done
for file in `cd doc/examples; $(FIND) . -type f ! -regex '.*discussion.*'`; do \
cp -aL doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file 2>/dev/null || \
cp -pRL doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file 2>/dev/null || \
install -m 644 doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file; \
done
@ -125,15 +131,15 @@ extra_install: underlay_install
install -m 755 $$file $(DESTDIR)$(PREFIX)/lib/ikiwiki/plugins; \
done
install -d $(DESTDIR)$(PREFIX)/share/man/man1
install -m 644 ikiwiki.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki.1
install -m 644 ikiwiki-makerepo.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki-makerepo.1
install -m 644 ikiwiki-transition.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki-transition.1
install -m 644 ikiwiki-update-wikilist.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki-update-wikilist.1
install -m 644 ikiwiki-calendar.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki-calendar.1
install -d $(DESTDIR)$(MANDIR)/man1
install -m 644 ikiwiki.man $(DESTDIR)$(MANDIR)/man1/ikiwiki.1
install -m 644 ikiwiki-makerepo.man $(DESTDIR)$(MANDIR)/man1/ikiwiki-makerepo.1
install -m 644 ikiwiki-transition.man $(DESTDIR)$(MANDIR)/man1/ikiwiki-transition.1
install -m 644 ikiwiki-update-wikilist.man $(DESTDIR)$(MANDIR)/man1/ikiwiki-update-wikilist.1
install -m 644 ikiwiki-calendar.man $(DESTDIR)$(MANDIR)/man1/ikiwiki-calendar.1
install -d $(DESTDIR)$(PREFIX)/share/man/man8
install -m 644 ikiwiki-mass-rebuild.man $(DESTDIR)$(PREFIX)/share/man/man8/ikiwiki-mass-rebuild.8
install -d $(DESTDIR)$(MANDIR)/man8
install -m 644 ikiwiki-mass-rebuild.man $(DESTDIR)$(MANDIR)/man8/ikiwiki-mass-rebuild.8
install -d $(DESTDIR)$(PREFIX)/sbin
install ikiwiki-mass-rebuild $(DESTDIR)$(PREFIX)/sbin
@ -150,10 +156,10 @@ extra_install: underlay_install
# These might fail if a regular user is installing into a home
# directory.
-install -d $(DESTDIR)/etc/ikiwiki
-install -m 0644 wikilist $(DESTDIR)/etc/ikiwiki
-install -m 0644 auto.setup $(DESTDIR)/etc/ikiwiki
-install -m 0644 auto-blog.setup $(DESTDIR)/etc/ikiwiki
-install -d $(DESTDIR)$(SYSCONFDIR)
-install -m 0644 wikilist $(DESTDIR)$(SYSCONFDIR)
-install -m 0644 auto.setup $(DESTDIR)$(SYSCONFDIR)
-install -m 0644 auto-blog.setup $(DESTDIR)$(SYSCONFDIR)
# The git/hg plugins want to chdir; so does Devel::Cover. Skip those tests
# to stop them hurting each other.

59
debian/changelog vendored
View File

@ -1,3 +1,62 @@
ikiwiki (3.20120202) unstable; urgency=low
* mdwn: Added nodiscount setting, which can be used to avoid using the
markdown discount engine, when maximum compatability is needed.
* Switch to YAML::XS to work around insanity in YAML::Mo. Closes: #657533
* cvs: Ensure text files are added in non-binary mode. (Amitai Schlair)
* cvs: Various cleanups and testing. (Amitai Schlair)
* calendar: Fix strftime encoding bug.
* shortcuts: Fixed a broken shortcut to wikipedia (accidentially
made into a shortcut to wikiMedia).
* Various portability improvements. (Amitai Schlair)
-- Joey Hess <joeyh@debian.org> Thu, 02 Feb 2012 21:42:40 -0400
ikiwiki (3.20120115) unstable; urgency=low
* Make backlink(.) work. Thanks, Giuseppe Bilotta.
* mdwn: Workaround discount's eliding of <style> blocks.
* attachment: Fix utf-8 display bug.
-- Joey Hess <joeyh@debian.org> Sun, 15 Jan 2012 16:19:25 -0400
ikiwiki (3.20120109) unstable; urgency=low
* mdwn: Can use the discount markdown library, via the
Text::Markdown::Discount perl module. This is preferred if available
since it's the fastest currently supported markdown library, speeding up
ikiwiki's markdown rendering by a factor of 40.
(However, when multimarkdown is enabled, Text::Markdown::Multimarkdown
is still used.)
* On Debian, depend on libtext-markdown-discount.
-- Joey Hess <joeyh@debian.org> Mon, 09 Jan 2012 11:49:14 -0400
ikiwiki (3.20111229) unstable; urgency=low
* Consume all stdin when rcs_receive short-circuits,
to avoid git SIGPIPE race.
* Add path and path_natural sort orders (smcv)
* Test coverage can be checked with `make coverage` (smcv)
* tag: encode categories using numeric values. (tango)
-- Joey Hess <joeyh@debian.org> Thu, 29 Dec 2011 12:00:53 -0400
ikiwiki (3.20111107) unstable; urgency=low
* img: Bugfix to width/height tags for scaled down image when only
one dimension was provided. Thanks, Per Carlson.
* editpage: Fix FormattingHelp link on Discussion pages.
* The umask setting can now be set to private, group, or public,
avoiding the need to enter octal correctly which is particularly
difficult in yaml setup files. (smcv)
* graphviz: Support urls embedded in the graph, by having graphviz
generate an imagemap.
* graphviz: Support wikilinks embedded in the graph.
(Sponsored by The TOVA Company.)
-- Joey Hess <joeyh@debian.org> Wed, 30 Nov 2011 16:31:48 -0400
ikiwiki (3.20111106) unstable; urgency=low
* searchquery.tmpl: Track escaping change in upstream template.

11
debian/control vendored
View File

@ -3,27 +3,26 @@ Section: web
Priority: optional
Build-Depends: perl, debhelper (>= 7.0.50)
Build-Depends-Indep: dpkg-dev (>= 1.9.0), libxml-simple-perl,
libtext-markdown-perl | markdown,
libtext-markdown-discount-perl,
libtimedate-perl, libhtml-template-perl,
libhtml-scrubber-perl, wdg-html-validator,
libhtml-parser-perl, liburi-perl (>= 1.36), perlmagick, po4a (>= 0.34),
libfile-chdir-perl, libyaml-perl, python-support
libfile-chdir-perl, libyaml-libyaml-perl, python-support
Maintainer: Joey Hess <joeyh@debian.org>
Uploaders: Josh Triplett <josh@freedesktop.org>
Standards-Version: 3.9.2
Homepage: http://ikiwiki.info/
Vcs-Git: git://git.ikiwiki.info/
Vcs-Browser: http://git.ikiwiki.info/?p=ikiwiki
Package: ikiwiki
Architecture: all
Depends: ${misc:Depends}, ${perl:Depends}, ${python:Depends},
libtext-markdown-perl | markdown,
libtext-markdown-discount-perl,
libhtml-scrubber-perl, libhtml-template-perl,
libhtml-parser-perl, liburi-perl (>= 1.36), libyaml-perl, libjson-perl
libhtml-parser-perl, liburi-perl (>= 1.36), libyaml-libyaml-perl, libjson-perl
Recommends: gcc | c-compiler,
libc6-dev | libc-dev,
subversion | git-core (>= 1:1.5.0) | git (>= 1:1.7) | tla | bzr (>= 0.91) | mercurial | monotone (>= 0.38) | darcs,
git (>= 1:1.7) | git-core (>= 1:1.5.0) | subversion | tla | bzr (>= 0.91) | mercurial | monotone (>= 0.38) | darcs,
libxml-simple-perl, libnet-openid-consumer-perl, libcrypt-ssleay-perl,
liblwpx-paranoidagent-perl, libtimedate-perl,
libcgi-formbuilder-perl (>= 3.05), libcgi-session-perl (>= 4.14-1),

18
debian/copyright vendored
View File

@ -271,3 +271,21 @@ License: GPL-2+
The full text of the GPL is distributed as doc/GPL in ikiwiki's source,
and is distributed in /usr/share/common-licenses/GPL-2 on Debian systems.
License: Expat
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,5 +1,5 @@
I can't check the last changes in Ikiwiki using
[gitweb](http://git.ikiwiki.info/?p=ikiwiki). It looks like XML
gitweb. It looks like XML
validation problem with HTML entity.
When I click a appropriate link on a [[git]] page, then I can only
@ -12,8 +12,8 @@ see the following error message. --[[Paweł|ptecza]]
> as the diff links in RecentChanges, both seem to be working. --[[Joey]]
>> Hm. It's strange. I really could see the error message like above
>> when I sent my report. It seems that <http://git.ikiwiki.info/?p=ikiwiki>
>> URL works now. So, we should be happy that it was self-fixed bug ;)
>> when I sent my report. It seems that
>> works now. So, we should be happy that it was self-fixed bug ;)
>> --[[Paweł|ptecza]]
>>> If it happens again, maybe take a full dump of the page? [[done]]

View File

@ -0,0 +1,73 @@
Hello,
I studied this [[guy's problem|forum/Encoding_problem_in_french_with_ikiwiki-calendar]] and I propose here a (dirty) hack to correct it.
Bug summary: when using the [[calendar plugin|plugins/calendar]] in French (`LANG=fr_FR.UTF-8`), "Décembre" (French for "December") is rendered as "Décembre".
I managed to track this problem down to an encoding problem of `POSIX::strftime` in `Ikiwiki/Plugin/calendar.pm`. I used [[this guy's solution|http://www.perlmonks.org/?node_id=857018]] to solve the problem (the diff is printed below).
The problem is that I do not know Perl, encoding is one of the thing I would be happy not to dive into, and it is the first time I contribute to Ikiwiki: I copied and made a few changes to the code I found without understanding it. So I am not sure that my code is neat, or works in every situation. Feel free to (help me to) improve it!
Cheers,
Louis
> Yes, this seems basically right. I've applied a modified version of this.
> [[done]]
> --[[Joey]]
diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm
index c7d2b7c..1345939 100644
--- a/IkiWiki/Plugin/calendar.pm
+++ b/IkiWiki/Plugin/calendar.pm
@@ -22,7 +22,14 @@ use warnings;
use strict;
use IkiWiki 3.00;
use Time::Local;
-use POSIX ();
+
+use POSIX qw/setlocale LC_TIME strftime/;
+use Encode;
+my ($strftime_encoding)= setlocale(LC_TIME)=~m#\.([^@]+)#;
+sub strftime_utf8 {
+# try to return an utf8 value from strftime
+ $strftime_encoding ? Encode::decode($strftime_encoding, &strftime) : &strftime;
+}
my $time=time;
my @now=localtime($time);
@@ -123,10 +130,10 @@ sub format_month (@) {
}
# Find out month names for this, next, and previous months
- my $monthabbrev=POSIX::strftime("%b", @monthstart);
- my $monthname=POSIX::strftime("%B", @monthstart);
- my $pmonthname=POSIX::strftime("%B", localtime(timelocal(0,0,0,1,$pmonth-1,$pyear-1900)));
- my $nmonthname=POSIX::strftime("%B", localtime(timelocal(0,0,0,1,$nmonth-1,$nyear-1900)));
+ my $monthabbrev=strftime_utf8("%b", @monthstart);
+ my $monthname=strftime_utf8("%B", @monthstart);
+ my $pmonthname=strftime_utf8("%B", localtime(timelocal(0,0,0,1,$pmonth-1,$pyear-1900)));
+ my $nmonthname=strftime_utf8("%B", localtime(timelocal(0,0,0,1,$nmonth-1,$nyear-1900)));
my $archivebase = 'archives';
$archivebase = $config{archivebase} if defined $config{archivebase};
@@ -182,7 +189,7 @@ EOF
my %dowabbr;
for my $dow ($week_start_day..$week_start_day+6) {
my @day=localtime(timelocal(0,0,0,$start_day++,$params{month}-1,$params{year}-1900));
- my $downame = POSIX::strftime("%A", @day);
+ my $downame = strftime_utf8("%A", @day);
my $dowabbr = substr($downame, 0, 1);
$downame{$dow % 7}=$downame;
$dowabbr{$dow % 7}=$dowabbr;
@@ -329,8 +336,8 @@ EOF
for (my $month = 1; $month <= 12; $month++) {
my @day=localtime(timelocal(0,0,0,15,$month-1,$params{year}-1900));
my $murl;
- my $monthname = POSIX::strftime("%B", @day);
- my $monthabbr = POSIX::strftime("%b", @day);
+ my $monthname = strftime_utf8("%B", @day);
+ my $monthabbr = strftime_utf8("%b", @day);
$calendar.=qq{\t<tr>\n} if ($month % $params{months_per_row} == 1);
my $tag;
my $mtag=sprintf("%02d", $month);

View File

@ -1,4 +1,4 @@
The final `</div>` in [`recentchanges.tmpl`][tmpl] gets wrapped in a
The final `</div>` in `recentchanges.tmpl` gets wrapped in a
`<p>` tag for some reason, resulting in the following invalid XHTML at
the end of the [[RecentChanges]] page
@ -17,7 +17,6 @@ plugin should be disabled on [[RecentChanges]]?
See the [validator output][validate] for more details.
[tmpl]: http://git.ikiwiki.info/?p=ikiwiki;a=blob_plain;f=templates/recentchanges.tmpl;hb=HEAD
[validate]: http://validator.w3.org/check?uri=http://ikiwiki.info/recentchanges/
- - -

View File

@ -0,0 +1,93 @@
Can't appear to get 'wiki' functions (i.e. editing) running when ikiwiki is running on a port other than the default (port 80). Somewhere in the processing it considers the base URL to exclude the port number and the websever throws back an error finding the page.
For example if you run on 'http://my.gear.xxx:8080/' then after clicking login (using default password auth) it will process and try to redirect you to 'http://my.gear.xxx/cgi-bin/ikiwiki.cgi'. I'm assuming that somewhere we've used the 'path' and the 'host' and dropped the remainder. I can figure out where this is yet but I'll post back if I get lucky.
-- fergus
NB: both the 'url' and the 'cgiurl' include the port and removing the port element provides the expected functionality.
---
> I tried to reproduce this by making my laptop's web server use port
> 8080. Set up ikiwiki to use that in cgiurl and url, and had
> no problem with either openid or password auth login.
>
> Ikiwiki has had some changes in this area in the past year; you don't say
> what version you were using. It could also be a problem with your web
> server, conceviably, if didn't correctly communicate the port to the cgi
> program. --[[Joey]]
---
>> I did think of that so threw a 'printenv' script to check the port was arriving
right.
>>> SERVER_PORT=8181
>>> HTTP_HOST=zippy0.ie0.cobbled.net
[ ... ]
>>>> In apache, `HTTP_HOST` includes the port. This is not part of the CGI
>>>> spec it seems, but perl's `CGI` module seems to rely on it,
>>>> in `virtual_port`:
>>>>> my $vh = $self->http('x_forwarded_host') || $self->http('host');
>>>>> my $protocol = $self->protocol;
>>>>> if ($vh) {
>>>>> return ($vh =~ /:(\d+)$/)[0] || ($protocol eq 'https' ? 443 : 80);
>>>> The `CGI` module only looks at `SERVER_PORT` when there's no
>>>> `HTTP_HOST`. So this is either a bug in perl's CGI or thttpd.
>>>> --[[Joey]]
[ ... ]
---
>>>>> This is interesting. If HTTP_HOST is wrong then
>>>>> 0. the client header must be wrong (i.e. not including the PORT)
>>>>> 0. `perl`'s doing something bad[tm] (or at least lazy)
>>>>> 0. `apache` is adding it
>>>>> 0. `thttpd` is stripping it
>>>>> Quick hack shows that `thttpd` must be stripping the port
number from the `Host:` header. That can be fixed.
>>>>> Thanks for the assist. -- fergus
---
Patch for `thttpd-2.25b` for posterity and completeness
[[!format patch """
diff --git a/libhttpd.c b/libhttpd.c
index 73689be..039b7e3 100644
--- a/libhttpd.c
+++ b/libhttpd.c
@@ -2074,9 +2074,6 @@ httpd_parse_request( httpd_conn* hc )
cp = &buf[5];
cp += strspn( cp, " \t" );
hc->hdrhost = cp;
- cp = strchr( hc->hdrhost, ':' );
- if ( cp != (char*) 0 )
- *cp = '\0';
if ( strchr( hc->hdrhost, '/' ) != (char*) 0 || hc->hdrhost[0] == '.' )
{
httpd_send_err( hc, 400, httpd_err400title, "", httpd_err400form, "" );
"""]]
-- fergus
---
I've gone ahead and filed a bug on CGI.pm too:
<https://rt.cpan.org/Ticket/Display.html?id=72678> --[[Joey]]
---
That'll be an interesting discussion as I'd suggest that HTTP_ headers are defined in the CGI specification as client headers and thus what `thttpd` is doing is wrong (i.e. mangling the client's own representation). Whether a CGI client should trust HTTP_ header over the server is probably already settled by convention.
-- fergus

View File

@ -0,0 +1,3 @@
For an example of what I mean, go to [[TourBusStop]]. Click the Discussion link. Click the <code>FormattingHelp</code> link. You'll be sent to [TourBusStop/ikiwiki/formatting](/TourBusStop/ikiwiki/formatting/) which of course doesn't exist.
> A bug introduced in the last release. [[fixed|done]] --[[Joey]]

View File

@ -0,0 +1,25 @@
I have ikiwiki_3.20111229 installed on Debian Squeeze (Perl 5.10.1, UTF-8
locale). The attachment plugin mangles UTF8-encoded attachment filenames if
the name contains multibyte characters, e.g. "lää.png" becomes "lää.png".
Apparently glob returns byte strings which are subject to implicit
upgrading when concatenated with Perl strings. The following patch fixes
the problem for me:
----
diff -r -U 1 a/attachment.pm b/attachment.pm
--- a/attachment.pm 2012-01-13 23:07:29.000000000 +0200
+++ b/attachment.pm 2012-01-13 23:33:07.000000000 +0200
@@ -274,2 +274,3 @@
foreach my $filename (glob("$dir/*")) {
+ $filename=Encode::decode_utf8($filename);
next unless -f $filename;
@@ -347,2 +348,3 @@
foreach my $file (glob("$dir/*")) {
+ $file = Encode::decode_utf8($file);
next unless -f $file;
> Seems it only mangled display of the just-uploaded attachment's filename,
> the attachment was otherwise saved to disk with a valid UTF-8 name, and
> doing other stuff with it also was ok. In any case, I applied your patch,
> thanks. [[done]] --[[Joey]]

View File

@ -0,0 +1,24 @@
My setup matches w3mmode [[w3mmode/ikiwiki.setup]] exactly.
My doc/index.mdwn just has a line or two of plain text.
When I try to edit that page in w3m, it works fine until I push [Save Page].
Then I just get a page that only contains "403".
ikiwiki version is 3.20110715ubuntu1.
w3m is 0.5.3.
-- [[terry|tjgolubi]]
I made it work, though probably not completely, by renaming
~/.ikiwiki/wrappers/ikiwiki.cgi to ikiwiki2.cgi and replacing it with:
#!/bin/bash
/home/tjgolubi/.ikiwiki/wrappers/ikiwiki2.cgi $* | sed -e 's,http://localhost,file://,g'
I'm afraid that this hack may have bad side-effects, but I hope it points you to the cause/solution.
Of course, the next time I rerun ikiwiki --setup, it will overwrite my wrapper-wrapper.
-- [[terry|tjgolubi]]
I made a logfile of all the args, env, and stdin/stdout to/from my wrapper. If you're interested, I'll email it to you. I wasn't able to attach it here.
-- [[terry|tjgolubi]]

View File

@ -44,7 +44,7 @@ the error message like below:
>>>>>> $CGI::VERSION='3.15';
>>>>> I've just checked in a fix that should work, can you test it?
>>>>> [diff](http://git.ikiwiki.info/?p=ikiwiki;a=commitdiff;h=71f10579c00a8ddc20ada1a1efd33aac25a3da7e) --[[Joey]]
>>>>> 71f10579c00a8ddc20ada1a1efd33aac25a3da7e --[[Joey]]
>>>>>> I've patched `attachment.pm` module, but the bug still occurs.
>>>>>> However I can see a little progress. I changed invoking `error()`
@ -63,7 +63,7 @@ the error message like below:
>>>>>>> though. I've checked in a second try at dealing with things, can
>>>>>>> you try it? --[[Joey]]
>>>>>>>> Do you mean that [diff](http://git.ikiwiki.info/?p=ikiwiki;a=commitdiff;h=66f35e30dcea03c631a293e2341771277543b4ae)?
>>>>>>>> Do you mean that 66f35e30dcea03c631a293e2341771277543b4ae?
>>>>>>>> If so, then it causes "Internal Server Error" for me:
>>>>>>>> Can't use string ("test.txt") as a symbol ref while "strict refs" in use at /usr/share/perl5/IkiWiki/Plugin/attachment.pm line 144.

View File

@ -0,0 +1,57 @@
It seems `backlink(.)` doesn't work, that is, it doesn't match pages linked
to from the current page.
If I have two test pages, `foo`, which links to `bar`, then (on the `foo`
page):
* backlink(foo) lists 'bar'
* backlink(.) lists nothing
tested with 3.20120109.
— [[Jon]]
> The attached patch should fix it:
>> [[applied|done]] thanks --[[Joey]]
From 30512ac5f6a724bafb1095ab246e0648999f7b6c Mon Sep 17 00:00:00 2001
From: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Date: Fri, 13 Jan 2012 11:02:11 +0100
Subject: [PATCH] backlink(.) should behave like backlink(<current page>)
Since commit c4d4cad3befbbd444d094cbeb0b6ebba3910a025, the single dot in
a pagespec can be used to mean the current page. While this worked
correctly in link() it didn't work in backlink(). Fix this by explicitly
checking the testpage in backlink against . and replacing it with the
current location if necessary.
---
IkiWiki.pm | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 08e242a..bc56501 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -2647,8 +2647,14 @@ sub match_link ($$;@) {
}
sub match_backlink ($$;@) {
- my $ret=match_link($_[1], $_[0], @_);
- $ret->influences($_[1] => $IkiWiki::DEPEND_LINKS);
+ my $page=shift;
+ my $testpage=shift;
+ my %params=@_;
+ if ($testpage eq '.') {
+ $testpage = $params{'location'}
+ }
+ my $ret=match_link($testpage, $page, @_);
+ $ret->influences($testpage => $IkiWiki::DEPEND_LINKS);
return $ret;
}
--
1.7.8.rc2.253.gdbf3
> (you need to re-make IkiWiki for it to work)

View File

@ -0,0 +1,4 @@
This is possibly/probably due to my weird setup, which is that I have apache behind nginx, with the result that apache sees the client's IPv4 address as having been mapped to IPv6. i.e. <tt>::ffff:10.11.12.13</tt>. That being the case, I currently need to specify that (with the <tt>::ffff:</tt> prepended) if I want to whitelist (or more importantly blacklist) and IPv4 address.
It strikes me that this is liable to become more of a problem as people finally start using IPv6, so it might be worth ensuring that the code that compares IP addresses be able to treat the two formats (with and without the ffff's) as equivalent. --[[fil]]

View File

@ -1,4 +1,4 @@
On [Line #46 of the `bzr` plugin](http://git.ikiwiki.info/?p=ikiwiki;a=blob;f=IkiWiki/Rcs/bzr.pm;h=526036bf36e0ce5ec6fab47cb8a46991d2ebe0b2;hb=HEAD#l46) there's a mistalke. Instead of:
On Line #46 of the `bzr` plugin there's a mistalke. Instead of:
my @cmdline = ("bzr", $config{srcdir}, "update");

View File

@ -1,4 +1,4 @@
Example (from [here](http://git.ikiwiki.info/?p=ikiwiki;a=blobdiff;f=doc/todo/matching_different_kinds_of_links.mdwn;h=26c5a072bf3cb205b238a4e6fd0882583a0b7609;hp=1d7c78d9065d78307b43a1f58a53300cde4015fa;hb=9b4c83127fdef0ceb682c104db9bfb321b17022e;hpb=df4cc4c16ca230ee99b80c80043ba54fb95f6e71)):
Example:
<pre>
[[`\[[!taglink TAG\]\]`|plugins/tag]]
</pre>

View File

@ -28,7 +28,27 @@ reprocessed is done so in the same conditions as the original call.
>> upstream.
>> For what it's worth, I think that my post_scan hook mechanism would work
>> rather fine with your trail plugin. However, the case of the if
>> rather fine with your trail plugin.
>>> We discussed this on IRC, and I think it's actually more complicated
>>> than that: the branch to sort by newest inlined entry wants a
>>> "pagespecs now work" hook, whereas for trail I want a "sorting now
>>> works" hook:
>>>
>>> * scan
>>> * pagespecs now work (post-scan)
>>> * Giuseppe's version of inline can decide what each inline
>>> contains, and thus decide where they go in `inline(mtime)`
>>> order
>>> * pagespecs and sorting now work (pre-render)
>>> * my trail plugin can decide what each trail contains, and
>>> also sort them in the right order (which might be
>>> `inline(mtime)`, so might be undefined until pagespecs work)
>>> * render
>>>
>>> --[[smcv]]
>> However, the case of the if
>> directive is considerably more complicated, because the conditional
>> can introduce a much stronger feedback effect in the pre/post scanning
>> dependency. In fact, it's probably possible to build a couple of pages

View File

@ -78,3 +78,9 @@ Brian May
>>>>> explicitly removed", so if ikiwiki can preferentially find that
>>>>> installed, even with the above commit, `openid` won't be able to
>>>>> traverse a proxy. --[[schmonz]]
[[!template id=gitbranch branch=schmonz/proxies author="[[schmonz]]"]]
>>>>> I bollixed up my git, recloned, and reapplied the diffs, so
>>>>> that commit won't exist anymore. My proxy-related changes are
>>>>> now on a branch. --[[schmonz]]

View File

@ -0,0 +1,34 @@
When an `ikiwiki` instance is holding a lock, a web user clicking on "add comment" (for example) will have to wait for the lock to be released. However, all they are then presented with is a web form. Perhaps CGI requests that are read-only (such as generating a comment form, or perhaps certain types of edits) should ignore locks? Of course, I'd understand that the submission would need to wait for a lock. — [[Jon]]
> Ikiwiki has what I think of as the Big Wiki Lock (remembering the "Big
> Kernel Lock"). It takes the exclusive lock before loading any state,
> to ensure that any changes to that state are made safely.
>
> A few CGI actions that don't need that info loaded do avoid taking the
> lock.
>
> In the case of showing the comment form, the comments
> plugin needs CGI session information to be loaded, so it can check if
> the user is logged in, and so it can add XSRF prevention tokens based on
> the session ID. (Actually, it might be possible to rely on
> `CGI::Session`'s own locking of the sessions file, and have a hook that
> runs with a session but before the indexdb is loaded.)
>
> But, the comment form also needs to load the indexdb, in order to call
> `check_canedit`, which matches a pagespec, which can need to look things
> up in the indexdb. (Though the pagespecs that can do that are unlikely
> to be relevant when posting a comment.)
>
> I've thought about trying to get rid of the Big Wiki Lock from time to
> time. It's difficult though; if two ikiwikis are both making changes
> to the stored state, it's hard to see a way to reconcile them. (There
> could be a daemon that all changes are fed thru using a protocol, but
> that's really complicated, and it'd almost be better to have a single
> daemon that just runs ikiwiki; a major architectural change.)
>
> One way that *almost* seems it could work is to have a entry path
> that loads everything read-only, without a lock. And then in read-only
> mode, `saveindex` would be an error to run. However, both the commenting
> code and the page edit code currently have the same entry path for
> drawing the form as is used for handling the posted form, so they would
> need to be adapted to separate that into two code paths. --[[Joey]]

View File

@ -5,7 +5,7 @@ embedded as `<p><img ...></p>`. That's at least what I see on
hand, CSS is supposed to be used instead, I guess. (But how... I forgot
almost of my CSS foo again ;-) it seems.) --[[tschwinge]]
> [[!img logo/ikiwiki.png align=right]]The [img tag doesn't create P tags](http://git.ikiwiki.info/?p=ikiwiki;a=blob;f=IkiWiki/Plugin/img.pm;h=32023fa97af8ba8e63192cacaff10a4677d20654;hb=HEAD), but if you have surrounded the img directive with newlines, they will result in paragraph tags.
> [[!img logo/ikiwiki.png align=right]]The img tag doesn't create P tags, but if you have surrounded the img directive with newlines, they will result in paragraph tags.
>
> I've edited the URL you provided to demonstrate this -- hope you don't mind! I've also added an inline, right-aligned image to this page.[[!tag done]]
> -- [[Jon]]

View File

@ -23,3 +23,10 @@ Is this a problem on my site or does anyone else see this?
>> \[[!map pages="path/to/page/* and ! ...
>>
>> This told me that [[plugins/autoindex]] is the bad guy. Deactivating this plugin helps out. Don't know if this is worth fixing... I can live without that plugin. --bacuh
>>> The right fix would probably be for `do=create` to allow replacing a page
>>> in the transient underlay without complaining (like the behaviour that
>>> `do=edit` normally has). That wouldn't help you unless [[plugins/autoindex]]
>>> defaulted to making transient pages (`autoindex_commit => 0`), but if we
>>> can fix [[removal_of_transient_pages]] then maybe that default can change?
>>> --[[smcv]]

View File

@ -0,0 +1,55 @@
To make ikiwiki publish world-readable files (usually what you want)
regardless of your umask, you override the `umask` setting to 022
octal (which is 18 in decimal). So far so good.
However, because it's interpreted as a plain number in Perl, the
way you set it varies between formats. In `IkiWiki::Setup::Standard`
you can use either
umask => 022
or (less obviously) one of
umask => 18
umask => "18"
but if you use
umask => "022"
you get the less than helpful umask of 026 octal (22 decimal).
Similarly, in `IkiWiki::Setup::Yaml` (the default for
[ikiwiki-hosting](http://ikiwiki-hosting.branchable.com/)
you have to use one of
umask: 18
umask: "18"
and if you try to say 022 you'll get 22 decimal = 026 octal.
[[!tag patch]]
[[!template id=gitbranch branch=smcv/umask-keywords author="[[smcv]]"]]
Perhaps the best way to solve this would be to have keywords
for the few values of `umask` that are actually useful?
* `private` (= 077 octal = 63 decimal)
* `group` (= 027 octal = 23 decimal)
* `public` (= 022 octal = 18 decimal)
I don't think g+w is a good idea in any case, because as
documented on [[security]], if ikiwiki makes its `srcdir`
group-writeable then any member of the group can "cause
trouble" (escalate privileges to those of the wiki user?)
via a symlink attack. So I don't think we need keywords
for those.
--[[smcv]]
> I support this change, but your git repository does not seem to have
> that branch (or anything) in it today. --[[Joey]]
>> git pushes have a restrictive umask, ironically... fixed. --[[smcv]]
>>> [[done]] --[[Joey]]

View File

@ -20,7 +20,7 @@ But there is no error if I use `ikiwiki --rebuild` to regenerate the whole thing
> or give any information to reproduce the bug.
>
> My guess: A version older than 3.20100403, which included
> [this bugfix](http://git.ikiwiki.info/?p=ikiwiki;a=commitdiff;h=799b93d258bad917262ac160df74136f05d4a451),
> 799b93d258bad917262ac160df74136f05d4a451,
> which could lead to incorrect "syntax error in pagespec"
> that only happened some of the time.
>

View File

@ -0,0 +1,9 @@
When using the img directive while reducing the size of the image by only specifying either the width ("100x") or height ("x100"), the resulting HTML breaks/confuses IE (at least 8 and 9).
In those cases img plugin do generate HTML with the missing attribute as "empty". For example, if the new size is specified as "100x", the resulting HTML will be &lt;img&nbsp;...&nbsp;width="100"&nbsp;height=""/&gt;. When IE encounters such empty attributes, the image is sort of compressed into a one (1!) pixel high (or wide) image, which is **not** what you expected.
If we instead always get the resulting the width and height from the resized image, and uses those values in the img attrs, we make IE happy (and all other renders as well).
A patch (tested and deployed) is sitting waiting in my git repository.
> I've applied your patch. Thanks! [[done]] --[[Joey]]

View 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]] has some example stylesheets to change ikiwiki's look.
[[css_market]] and [[theme market|themes]] has some example stylesheets to change ikiwiki's look.

View File

@ -1 +0,0 @@
foo bar.

View File

@ -4,6 +4,7 @@ page fitting enough. Users of ikiwiki can ask questions here.
Note that for more formal bug reports or todo items, you can also edit the
[[bugs]] and [[todo]] pages.
## Current topics ##
[[!inline pages="forum/* and !forum/discussion and !forum/*/*"

View File

@ -0,0 +1,12 @@
When rebuilding, I see
building recentchanges/change_63476fba3a519d42ee56c7611250ada41111356d._change, which depends on templates/page.tmpl
building recentchanges/change_bd07c4308d5eea2cd27ad067a502318dc0e9c8bb._change, which depends on templates/page.tmpl
building recentchanges/change_6c2a66b022276951d79f29c1221d22fe1592f67f._change, which depends on templates/page.tmpl
building recentchanges/change_f08669f128d618d0da460234b2cee555b0818584._change, which depends on templates/page.tmpl
building recentchanges/change_b0347df66da5c515dc0d1d612ecdfbe203a0a674._change, which depends on templates/page.tmpl
building recentchanges/change_0bb246c481e9ede8686f6caa4de40b9e94642e40._change, which depends on templates/page.tmpl
building recentchanges/change_511846ca75fb2e87fb90582ead282d104a5e13fc._change, which depends on templates/page.tmpl
...
Are these accidentally committed gibberish? If so, how to remove them properly?

View File

@ -0,0 +1,10 @@
[[!comment format=mdwn
username="http://joey.kitenet.net/"
nickname="joey"
subject="comment 1"
date="2011-12-30T18:13:18Z"
content="""
They are little per-change pages that are inlined together to produce your RecentChanges page.
(They're not committed to git, only stored internally.)
"""]]

View File

@ -0,0 +1,10 @@
I upgraded my Debian server from 5 to 6, then I updated ikiwiki. Now I can't rebuild my Ikiwiki instance:
$ ikiwiki --setup ./pages.setup
Failed to load plugin IkiWiki::Plugin::scrubber: Can't locate IkiWiki/Plugin/scrubber.pm in @INC (@INC contains: /home/xyzfoobar/devel/ikiwiki/lib /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at (eval 77) line 2.
BEGIN failed--compilation aborted at (eval 77) line 2.
$ ikiwiki --version
ikiwiki version 3.20100815.7
What's the proper way to fix this?

View File

@ -0,0 +1,14 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawnZ0g2UAijV7RGrKtWPljCCAYHBJ3pwPvM"
nickname="Meng"
subject="comment 1"
date="2011-12-20T07:21:19Z"
content="""
If I try to create new setup file
$ ikiwiki --dumpsetup newpages.setup
Traceback (most recent call last):
File \"/usr/lib/ikiwiki/plugins/rst\", line 18, in <module>
from docutils.core import publish_parts;
ImportError: No module named docutils.core
"""]]

View File

@ -0,0 +1,10 @@
[[!comment format=mdwn
username="http://joey.kitenet.net/"
nickname="joey"
subject="comment 2"
date="2011-12-20T15:16:23Z"
content="""
Your setup file seems to refer to a \"scrubber\" plugin, which has never existed in ikiwiki. Perhaps a typo of \"htmlscrubber\"?
3.20100815.7 is an old version of ikiwiki. The current version avoids the rst docutils breakage. Installing python-docutils on Debian can work around that problem as well.
"""]]

View File

@ -0,0 +1,8 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawnZ0g2UAijV7RGrKtWPljCCAYHBJ3pwPvM"
nickname="Meng"
subject="comment 3"
date="2011-12-20T16:58:23Z"
content="""
Thanks. That was exactly the issue. When editing my setup file, I accidentally splitted `htmlscrubber` to `html` and `scrubber`.
"""]]

View File

@ -0,0 +1,17 @@
Hi,
I'd very much like to be able to list my blog posts on a daily basis (used for logging work) - rather than have the Calendar plugin return the first post only.
There was some effort to do this as detailed here.
[[http://ikiwiki.info/todo/Set_arbitrary_date_to_be_used_by_calendar_plugin/]]
I had a quick go at doing something similar on Debian Stable (Ikiwiki 3.0) but alas my Ikiwiki fu is not strong enough.
I'm not sure how I go about swapping the link on the day number to a link to, I guess, a dynamically generated page of links?
$linkcach{"$year/$mtag/$mday"}{$p} = ${p}
and a suitable whilst loop looks to be all that's needed...
Any pointers appreciated.

View File

@ -0,0 +1,83 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawnXybLxkPMYpP3yw4b_I6IdC3cKTD-xEdU"
nickname="Matt"
subject="comment 1"
date="2011-11-29T00:52:49Z"
content="""
So I ported the original patch mentioned to the latest Debian version. Well at least the bits that matter to me. See below.
In doing so I realized that it does quite work how I imagined it would; instead of generating a dynamic page for a particular day with a list of links it actually fills in the calendar with the details of the posts (making for some ugly formatting).
I'm hoping the tag generation pages will give me a clue how to alter this into what I want.
<pre>
diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm
index c7d2b7c..c931fe6 100644
--- a/IkiWiki/Plugin/calendar.pm
+++ b/IkiWiki/Plugin/calendar.pm
@@ -75,6 +75,8 @@ sub format_month (@) {
my %params=@_;
my %linkcache;
+ my @list;
+ my $detail = 1;
foreach my $p (pagespec_match_list($params{page},
\"creation_year($params{year}) and creation_month($params{month}) and ($params{pages})\",
# add presence dependencies to update
@@ -88,7 +90,7 @@ sub format_month (@) {
my $mtag = sprintf(\"%02d\", $month);
# Only one posting per day is being linked to.
- $linkcache{\"$year/$mtag/$mday\"} = $p;
+ $linkcache{\"$year/$mtag/$mday\"}{$p} = $IkiWiki::pagesources{$p};
}
my $pmonth = $params{month} - 1;
@@ -219,14 +221,38 @@ EOF
$tag='month-calendar-day-this-day';
}
else {
- $tag='month-calendar-day-link';
+ if ( $detail == 0 ) {
+ $tag='month-calendar-day-link';
+ }
+ else{
+ $tag='month-calendar-day';
+ }
}
$calendar.=qq{\t\t<td class=\"$tag $downame{$wday}\">};
- $calendar.=htmllink($params{page}, $params{destpage},
- $linkcache{$key},
- noimageinline => 1,
- linktext => $day,
- title => pagetitle(IkiWiki::basename($linkcache{$key})));
+ if ( $detail == 0 ) {
+ $calendar.=htmllink($params{page}, $params{destpage},
+ $linkcache{$key},
+ noimageinline => 1,
+ linktext => $day,
+ title => pagetitle(IkiWiki::basename($linkcache{$key})));
+ }
+ else {
+ my $day_label = qq{<span class=\"month-calendar-day-label\">$day</span>};
+ $calendar.=qq{$day_label\n};
+ my $srcpage; my $destpage;
+ while(($srcpage,$destpage) = each(%{$linkcache{$key}})) {
+ my $title = IkiWiki::basename(pagename($srcpage));
+ if (exists $pagestate{$srcpage}{meta}{title} ) {
+ $title = $pagestate{$srcpage}{meta}{title};
+ }
+ $calendar.=qq{\t\t<div class=\"$tag $downame{$wday}\">};
+ $calendar.=htmllink($params{page}, $params{destpage},
+ pagename($destpage),
+ linktext => $title);
+ push @list, pagename($linkcache{$key}{$srcpage});
+ $calendar.=qq{\t\t</div>};
+ }
+ }
$calendar.=qq{</td>\n};
}
else {
</pre>
"""]]

View File

@ -0,0 +1,12 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawnXybLxkPMYpP3yw4b_I6IdC3cKTD-xEdU"
nickname="Matt"
subject="comment 2"
date="2011-11-29T01:30:09Z"
content="""
To revert the changes made above it is necessary not only to switch the detail level back down but to also regenerate the side-bar index.html file
ikiwiki --setup blog.setup
should do it.
"""]]

View File

@ -0,0 +1,166 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawnXybLxkPMYpP3yw4b_I6IdC3cKTD-xEdU"
nickname="Matt"
subject="comment 3"
date="2011-11-30T20:42:55Z"
content="""
I got to grip with things to make a patch to do this. :-)
Here it is in case of use to anyone.
<pre>
From f0554c5b61e1915086d5cf071f095ff233c2590d Mon Sep 17 00:00:00 2001
From: Matt Ford <matt@dancingfrog.co.uk>
Date: Wed, 30 Nov 2011 19:40:10 +0000
Subject: [PATCH] Patch to allow daily archival generation and link to them in
the calendar
---
IkiWiki/Plugin/calendar.pm | 17 ++++++++++++++++-
ikiwiki-calendar.in | 34 +++++++++++++++++++++++++++++++---
templates/calendarday.tmpl | 5 +++++
templates/calendarmonth.tmpl | 2 +-
templates/calendaryear.tmpl | 2 +-
5 files changed, 54 insertions(+), 6 deletions(-)
create mode 100644 templates/calendarday.tmpl
diff --git a/IkiWiki/Plugin/calendar.pm b/IkiWiki/Plugin/calendar.pm
index c7d2b7c..9999c03 100644
--- a/IkiWiki/Plugin/calendar.pm
+++ b/IkiWiki/Plugin/calendar.pm
@@ -47,6 +47,13 @@ sub getsetup () {
safe => 1,
rebuild => 1,
},
+ archiveday => {
+ type => \"boolean\",
+ example => 1,
+ description => \"enable archiving on a daily basis (otherwise monthly)\",
+ safe => 1,
+ rebuild => 1,
+ },
archive_pagespec => {
type => \"pagespec\",
example => \"page(posts/*) and !*/Discussion\",
@@ -222,11 +229,19 @@ EOF
$tag='month-calendar-day-link';
}
$calendar.=qq{\t\t<td class=\"$tag $downame{$wday}\">};
- $calendar.=htmllink($params{page}, $params{destpage},
+ if (exists $pagesources{\"$archivebase/$params{year}/$params{month}/\".sprintf(\"%02d\",$day)}) {
+ $calendar.=htmllink($params{page}, $params{destpage},
+ \"$archivebase/$params{year}/$params{month}/\".sprintf(\"%02d\",$day),
+ noimageinline => 1,
+ linktext => \"$day\",
+ title => \"$key\");
+ }else{
+ $calendar.=htmllink($params{page}, $params{destpage},
$linkcache{$key},
noimageinline => 1,
linktext => $day,
title => pagetitle(IkiWiki::basename($linkcache{$key})));
+ }
$calendar.=qq{</td>\n};
}
else {
diff --git a/ikiwiki-calendar.in b/ikiwiki-calendar.in
index 037ef7d..af22bc5 100755
--- a/ikiwiki-calendar.in
+++ b/ikiwiki-calendar.in
@@ -30,21 +30,44 @@ IkiWiki::checkconfig();
my $archivebase = 'archives';
$archivebase = $config{archivebase} if defined $config{archivebase};
+my $archiveday = 0;
+$archiveday = $config{archiveday} if defined $config{archiveday};
+
if (! defined $pagespec) {
$pagespec=$config{archive_pagespec} || \"*\";
}
-sub writearchive ($$;$) {
+sub is_leap_year {
+ my $year=shift;
+ return ($year % 4 == 0 && (($year % 100 != 0) || $year % 400 == 0));
+}
+
+sub month_days {
+ my $month=shift;
+ my $year=shift;
+ my $days_in_month = (31,28,31,30,31,30,31,31,30,31,30,31)[$month-1];
+ if ($month == 2 && is_leap_year($year)) {
+ $days_in_month++;
+ }
+ return $days_in_month;
+}
+
+sub writearchive ($$;$;$) {
my $template=template(shift);
my $year=shift;
my $month=shift;
+ my $day=shift;
- my $page=defined $month ? \"$year/$month\" : $year;
+ my $page;
+ if (defined $year) {$page = \"$year\"};
+ if (defined $month) {$page = \"$year/$month\"};
+ if (defined $day) {$page = \"$year/$month/$day\"};
my $pagefile=newpagefile(\"$archivebase/$page\", $config{default_pageext});
$template->param(pagespec => $pagespec);
$template->param(year => $year);
$template->param(month => $month) if defined $month;
+ $template->param(day => $day) if defined $day;
if ($force || ! -e \"$config{srcdir}/$pagefile\") {
writefile($pagefile, $config{srcdir}, $template->output);
@@ -54,8 +77,13 @@ sub writearchive ($$;$) {
foreach my $y ($startyear..$endyear) {
writearchive(\"calendaryear.tmpl\", $y);
- foreach my $m (qw{01 02 03 04 05 06 07 08 09 10 11 12}) {
+ foreach my $m (map {sprintf(\"%02d\",$_)} (1..12)) {
writearchive(\"calendarmonth.tmpl\", $y, $m);
+ if ($archiveday ) {
+ foreach my $d (map {sprintf(\"%02d\",$_)} (1..month_days($m,$y))) {
+ writearchive(\"calendarday.tmpl\", $y, $m, $d);
+ }
+ }
}
}
diff --git a/templates/calendarday.tmpl b/templates/calendarday.tmpl
new file mode 100644
index 0000000..ac963b9
--- /dev/null
+++ b/templates/calendarday.tmpl
@@ -0,0 +1,5 @@
+[[!sidebar content=\"\"\"
+[[!calendar type=month month=<TMPL_VAR MONTH> year=<TMPL_VAR YEAR> pages=\"<TMPL_VAR PAGESPEC>\"]]
+\"\"\"]]
+
+[[!inline pages=\"creation_day(<TMPL_VAR DAY>) and creation_month(<TMPL_VAR MONTH>) and creation_year(<TMPL_VAR YEAR>) and <TMPL_VAR PAGESPEC>\" archive=\"yes\" show=0 feeds=no reverse=yes]]
diff --git a/templates/calendarmonth.tmpl b/templates/calendarmonth.tmpl
index 23cd954..c998c16 100644
--- a/templates/calendarmonth.tmpl
+++ b/templates/calendarmonth.tmpl
@@ -2,4 +2,4 @@
[[!calendar type=month month=<TMPL_VAR MONTH> year=<TMPL_VAR YEAR> pages=\"<TMPL_VAR PAGESPEC>\"]]
\"\"\"]]
-[[!inline pages=\"creation_month(<TMPL_VAR MONTH>) and creation_year(<TMPL_VAR YEAR>) and <TMPL_VAR PAGESPEC>\" show=0 feeds=no reverse=yes]]
+[[!inline pages=\"creation_month(<TMPL_VAR MONTH>) and creation_year(<TMPL_VAR YEAR>) and <TMPL_VAR PAGESPEC>\" archive=\"yes\" show=0 feeds=no reverse=yes]]
diff --git a/templates/calendaryear.tmpl b/templates/calendaryear.tmpl
index 714bd6d..b6e33c5 100644
--- a/templates/calendaryear.tmpl
+++ b/templates/calendaryear.tmpl
@@ -1 +1 @@
-[[!calendar type=year year=<TMPL_VAR YEAR> pages=\"<TMPL_VAR PAGESPEC>\"]]
+[[!calendar type=year year=<TMPL_VAR YEAR> pages=\"<TMPL_VAR PAGESPEC>\" archive=\"yes\"]]
--
1.7.7.3
:
</pre>
"""]]

View File

@ -0,0 +1 @@
I would like to have different favicons for different parts (folders) of my Ikiwiki site, like you can have different CSS files via the localstyle plugin. Is this possible? If not, could it be made possible?

View File

@ -0,0 +1,19 @@
[[!comment format=mdwn
username="http://smcv.pseudorandom.co.uk/"
nickname="smcv"
subject="comment 1"
date="2011-11-21T11:37:02Z"
content="""
You could use [[plugins/pagetemplate]] to override all of `page.tmpl`, but
that's using a sledgehammer to crack a nut.
Another way to do it would be to modify `IkiWiki/Plugins/favicon.pm`
to use `bestlink` to find the favicon, like [[plugins/localstyle]] does.
If you made it a config option (`localfavicon => 1` or something)
it could probably be included in ikiwiki as part of the official
[[plugins/favicon]] plugin?
Another way would be to have a new `localfavicon` plugin which overrides
the template variable from [[plugins/favicon]], using `last => 1` to
make sure it \"wins\".
"""]]

View File

@ -0,0 +1,4 @@
[[!meta author=tjgolubi]]
It would be nice, if configured for multimarkdown, for ikiwiki to recognize and use/remove meta information from multimarkdown documents.
Title, Author, and Date would be especially nice. -- [[tjgolubi]]

View File

@ -0,0 +1,5 @@
I find that users can't login my Ikiwiki instance using Google, or openID, but can use Ikiwiki user name and password to login.
Using the two formers get error
Error: ... is locked and cannot be edited

View File

@ -0,0 +1,10 @@
[[!comment format=mdwn
username="http://joey.kitenet.net/"
nickname="joey"
subject="comment 1"
date="2011-12-22T16:15:34Z"
content="""
That error message means that the user has logged in, but the lockedit plugin has been configured, via `locked_pages` to not let some pages be edited by them.
Inability to log in with openid is a separate problem, I can only guess as you didn't say how it fails when you try to log in by openid, but perhaps you need to install the Net::OpenID::Consumer perl module from cpan.
"""]]

View File

@ -0,0 +1,7 @@
Unfortunately debian stable / squeeze repos are still on version 3.20100815.7
Do you think squeeze will update to a newer version soon? I am lacking support of the gallery plugin and 1 more that I forgot right now ;)
Is everyone else upgrading by directly installing via dpkg (no updates, but yeah)?
Regards

View File

@ -0,0 +1,12 @@
[[!comment format=mdwn
username="http://joey.kitenet.net/"
nickname="joey"
subject="comment 1"
date="2012-01-16T14:52:22Z"
content="""
Nothing wrong with 3.20100815.7 unless you need newer features.
At Branchable we run Debian stable and backport the current ikiwiki to run on it. This is quite easy to do, it just builds and works. (Edit debian/control and s/markdown-discount/markdown/)
It's probably time someone released a backport. I have historically not done that myself though.
"""]]

View File

@ -0,0 +1,8 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawndsaC4GaIBw49WNdbk2Faqfm_mrtQgul8"
nickname="Christian"
subject="thats cool"
date="2012-01-16T15:31:22Z"
content="""
thanks
"""]]

View File

@ -0,0 +1,12 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawndsaC4GaIBw49WNdbk2Faqfm_mrtQgul8"
nickname="Christian"
subject="Great! It worked!"
date="2012-01-17T01:18:06Z"
content="""
Thanks Joey, also for the replacement hint, had to install one or two dependencies and it worked like a charm. Version from the day before yesterday now. (Awesome!)
I have not upgraded the mypage.setup file, yet. I included \"headinganchors\" which does not seem to work right now. The page compiles without errors but contains no anchors when viewed in browser. Hm..
Great job thanks again!
"""]]

View File

@ -0,0 +1,12 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawndsaC4GaIBw49WNdbk2Faqfm_mrtQgul8"
nickname="Christian"
subject="updating setup file"
date="2012-01-17T01:30:32Z"
content="""
just for the record - I created a new wiki and the setup file is then automatically in YAML format. I think I am going to just transfer the settings from the \"old\" setup file to the new one.
If anyone has an idea why the headinganchors don't work, pls let me know.
As for the rest - insanely cool piece of software - great
"""]]

View File

@ -0,0 +1,24 @@
Hi,
today I encountered a strange behaviour of ikiwiki that I'm trying to understand...
I linked to a subpage using
\[[somename|/path/from/root/dir/filename]]
and saved the file. Then I added it to the repo, committed it, and ran
ikiwiki --setup setupfile.setup
Afterwards some older links of the same style were displayed correctly, but one new link remained black - i.e. with no question mark to it. I figure that means ikiwiki has recognized the syntax but did not create a link in the html file.
I messed around a bit, recompiling many times did not work. After a while I opened the file via the web editing formular and saved it from there ("Save Page").
After that the link was there.
I dont know why. My question is - what does ikiwiki do differently when saved from the web form than when saving an editor and then running ikiwiki --setup setupfile.setup.
Btw. my version is still 3.20100815.7 since I'm on squeeze and like to stick with the repo versions.
Thanks in advance,
Chris

View File

@ -0,0 +1,9 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawnam4a8RtFwaWkKOX2BkA5I7cpGHcFw8E0"
nickname="Christian"
subject="comment 1"
date="2011-12-03T17:17:57Z"
content="""
with \"no question mark to it\" means \"being no link (target exists) AND with no question mark to it\"
thx
"""]]

View File

@ -0,0 +1,13 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawnam4a8RtFwaWkKOX2BkA5I7cpGHcFw8E0"
nickname="Christian"
subject="comment 3"
date="2011-12-03T17:25:58Z"
content="""
One more thing: my syntax with the above post is not correct - the linking syntax was/is
\[[somename|path/from/website/root/dir/filename]]
ie. I got one slash too much above.
"""]]

View File

@ -0,0 +1,9 @@
Hi,
I'm planning on abusing ikiwiki as a mini-CMS for a static website and think it's exactly the right system for it. Great stuff btw.
But I still got a problem that I can't solve at the moment. For the static website (with commenting enabled tho) I want no one else to edit the pages, i.e. I want to turn off the editing function for everyone except me.
That works with the lockedit plugin so far, and I can also hide the edit and preferences links on the pages. But if someone manually enters the link to the edit page he/she can still create an account (I have disabled openid and plan to use passwordauth only). The account can then not be used to edit pages but still, everyone can create accounts in userdb over and over. Is there a way to solve that? I just don't see it right now.
Best regards,
Chris

View File

@ -0,0 +1,8 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawnam4a8RtFwaWkKOX2BkA5I7cpGHcFw8E0"
nickname="Christian"
subject="comment on my own question"
date="2011-11-30T15:15:21Z"
content="""
REALLY great was what I wanted to say - all the essentials are there, including commenting and search function. What else can you want <3
"""]]

View File

@ -0,0 +1,12 @@
[[!comment format=mdwn
username="http://smcv.pseudorandom.co.uk/"
nickname="smcv"
subject="comment 2"
date="2011-11-30T16:09:16Z"
content="""
Not currently possible, but you can configure [[plugins/passwordauth]] to
require an `account_creation_password`, and not tell anyone else what
it is; or you could use [[plugins/httpauth]] for authenticated editing.
(My mostly-static ikiwiki sites only allow [[plugins/httpauth]] over
HTTPS.)
"""]]

View File

@ -0,0 +1,8 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawnam4a8RtFwaWkKOX2BkA5I7cpGHcFw8E0"
nickname="Christian"
subject="thx"
date="2011-11-30T18:50:50Z"
content="""
thank you for your quick reply, smcv!
"""]]

View File

@ -0,0 +1,20 @@
Hi!
I'm using the ikiwiki calendar plugin.
My website is in french (locale fr_FR.UTF-8), and calendars that are generated by the plugin makes some encodi$
I don't know how the plugin generate translation for dates, but I've seen that there is no ikiwiki translation$
That's why I suppose (but I'm not sure) that it use date unix command to insert date into the html page, witho$
Could I have forgotten some options to make it nice or not?
Is someone could test it and verify if it works or not?
Thanks.
Zut
> This was discussed in [[bugs/Encoding_problem_in_calendar_plugin]]
> and is now fixed. --[[Joey]]

View File

@ -0,0 +1,5 @@
I installed a new wiki on my local machine. When I click on edit, I get the following error:
`Error: cannot write to /home/user/myiki2/.ikiwiki/lockfile: Permission denied`
I checked the permissions of that file and assured that they are the same as in my other working ikiwiki, but it doesn't help. Any idea?

View File

@ -0,0 +1,10 @@
[[!comment format=mdwn
username="https://launchpad.net/~tale"
nickname="tale"
subject="What are the permissions?"
date="2011-12-28T19:35:25Z"
content="""
What exactly are the permissions for the lockfile and the directory it is in?
What user is the ikiwiki running as?
"""]]

View File

@ -0,0 +1,23 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawk_MMtLPS7osC5MjX00q2ATjvvXPWqm0ik"
nickname="micheal"
subject="comment 2"
date="2011-12-28T23:06:06Z"
content="""
<code>
stat -c '%A %a %U %G %n' myiki2 myiki1
drwxr-xr-x 755 user user myiki2
drwxr-xr-x 755 user user myiki1
stat -c '%A %a %U %G %n' myiki2/.ikiwiki myiki1/.ikiwiki
drwxr-xr-x 755 user user myiki2/.ikiwiki
drwxr-xr-x 755 user user myiki1/.ikiwiki
stat -c '%A %a %U %G %n' myiki2/.ikiwiki/lockfile myiki1/.ikiwiki/lockfile
-rw-r--r-- 644 user user myiki2/.ikiwiki/lockfile
-rw-r--r-- 644 user user myiki1/.ikiwiki/lockfile
</code>
As you see, myiki2 has the same permissions as myiki1, but myiki1 works.
"""]]

View File

@ -0,0 +1,9 @@
I have the tag plugin enabled, and these additional lines in my setup file:
tagbase => "tags",
tag_autocreate => 1,
tag_autocreate_commit => 1,
However, when I use a !tag or !taglink directive, nothing gets autocreated in the tags/ directory. What am I doing wrong?
Edit: I'm using ikiwiki version 3.20100122ubuntu1 on Ubuntu 10.04.3 LTS... upgraded to ikiwiki_3.20110905_all from the debian repository and that solved my problem. Oops. :)

View File

@ -0,0 +1 @@
How to allow .markdown and .md (at the same time) as valid extensions for source files? The default is .mdwn.

View File

@ -0,0 +1,9 @@
Well, I simply don't see it.
I would like to change the "account registration" page, where it says user, password, repeat password, Account Creation Password, E-Mail.
I simply want it to ask a question like "Who's your daddy" or "What are we all working on" instead of "Account creation password".
I already grepped through the files of the source which I compiled ikiwiki from - I just can't find it. I'm a noob in cgi, it seems to be somewhat in there, but that could also be totally wrong.
Can you tell me where to look?

View File

@ -0,0 +1,14 @@
[[!comment format=mdwn
username="http://joey.kitenet.net/"
nickname="joey"
subject="comment 1"
date="2012-01-30T19:30:20Z"
content="""
Sure.. You're looking for the file `IkiWiki/Plugin/passwordauth.pm`
This line in particular is the text that gets modified and displayed to the user.
<pre>
name => \"account_creation_password\",
</pre>
"""]]

View File

@ -0,0 +1,21 @@
I put
# po plugin
po_master_language => 'en|English',
po_slave_languages => [ 'zh|Chinese']
in page.setup. And did
$ikiwiki --setup ./page.setup
but get errors:
Can't use string ("en|English") as a HASH ref while "strict refs" in use at /usr/share/perl5/IkiWiki/Plugin/po.pm line 162.
Line 162 of the file reads
delete $config{po_slave_languages}{$config{po_master_language}{code}};;
What's wrong? How to fix it?

View File

@ -0,0 +1,9 @@
[[!comment format=mdwn
username="intrigeri"
ip="88.80.28.70"
subject="Please upgrade"
date="2011-12-20T09:34:56Z"
content="""
You seem to be using an older version of ikiwiki. Either use a hash ref (see [old documentation](http://source.ikiwiki.branchable.com/?p=source.git;a=blobdiff;f=doc/plugins/po.mdwn;h=c36414c8e85f5bb11e2c3a7c3bd41e829abe15a6;hp=53327c1dae94ef5896119cc874133a9a3c1a9b4e;hb=862fc7c1ab1f7d709561bcb02fc8ede57b90a51b;hpb=e50df5ea7601b6a1fc03994650ddff728aba7b57)) or upgrade.
"""]]

View File

@ -0,0 +1,24 @@
I followed instructions at
http://ikiwiki.info/plugins/po/
and added to `configfile`
po_master_language => 'en|English',
po_slave_languages => [ 'zh|Chinese' ],
po_translatable_pages => '(* and !*/Discussion and !blog/*/comment_*)',
po_link_to => 'current'
and did
ikiwiki --setup configfile
But I don't seem to see any change in the newly built site.
How do I actually use po to create translation pages?
1) I have existing pages that's in English. How do I add translated versions of some of those pages in the slave language?
2) How do I add new pages with the primary language version and alternative versions in slave languages?
The documentation of po is not explicit with what are the concrete steps.

View File

@ -0,0 +1,5 @@
[[!meta author=tjgolubi]]
I want to configure IkiWiki to use Fletcher Penney's recent version of [[MultiMarkdown|http://fletcherpenney.net/multimarkdown]] instead of the default perl implementation.
I don't know perl, but I think I need to replace the mdwn.pm plugin with something that uses "open2".
Please help me get started. -- [[tjgolubi]]

View File

@ -0,0 +1,14 @@
Since ikiwiki doesn't have much of a chance of working in windows, how about we compromise by making an offline ikiwiki editor for Windows? In fact, it might be advantageous to use it in Linux, too...
It should be very simple: It would enter the source wiki and show the Markdown code by default, but would have an option to preview your page in another tab.
Basic features:
* wikilinks, maps, images, inlinepages, and other basic functions should all work in the preview
* perhaps use local.css to format preview
* See the DVCS history with diffs and all
* have a discussion tab to easily see what other people have said about the page
If we want to add some more bells and whistles, maybe we could throw in some buttons to insert markdown formatting (like in forums, mediawiki, or RES).
Any thoughts on this?

View File

@ -0,0 +1,8 @@
[[!comment format=mdwn
username="http://kerravonsen.dreamwidth.org/"
ip="202.173.183.92"
subject="comment 1"
date="2012-01-13T22:32:47Z"
content="""
It would probably be quite complex to write, and difficult to maintain. I don't think much of your chances of getting someone to write it. If you want to write it yourself, have fun doing so!
"""]]

View File

@ -0,0 +1,10 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawkr8GVPw30JBR34Btg-SKcS8gxEf7zpSJQ"
nickname="Lawrence"
subject="comment 2"
date="2012-01-14T03:14:38Z"
content="""
Eh, ok, lol. I know that implementing most of the wiki features over again could be difficult, and so would a Git diff reader, but it shouldn't be that hard to get Wikilinking or a markdown previewer working.
Could you point out some specific problems of this approach, so that it would help me out to do so?
"""]]

View File

@ -0,0 +1,12 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawkr8GVPw30JBR34Btg-SKcS8gxEf7zpSJQ"
nickname="Lawrence"
subject="comment 3"
date="2012-01-14T17:41:52Z"
content="""
Like, there's already a whole host of Markdown previewer apps that are pretty good. [Here's a](http://www.macworld.com/article/164744/2012/01/marked_excels_at_previewing_markdown_and_html_documents.html) popular one on Mac, and there are many more...
There's also a plugin for Emacs that does so, and even resolves wikilinks (in some way..).
But I'd have to say that I probably made a misleading title, WYSIWYG would probably be low on the list of needed features. And I'm just dumping an idea I have here in case anyone has any suggestions or comments, I'll probably do it myself in my free time.
"""]]

View File

@ -0,0 +1,8 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawndsaC4GaIBw49WNdbk2Faqfm_mrtQgul8"
nickname="Christian"
subject="just my 2 cents"
date="2012-01-17T11:10:09Z"
content="""
why?
"""]]

View File

@ -0,0 +1 @@
Is it possible to add a list of the n last visited pages on the bottom of each ikiwiki page (or maybe on a sidebar)?

View File

@ -0,0 +1,8 @@
[[!comment format=mdwn
username="http://kerravonsen.dreamwidth.org/"
ip="202.173.183.92"
subject="comment 1"
date="2011-11-27T11:09:55Z"
content="""
Only if you could do it with JavaScript or SSI; remember IkiWiki is a wiki *compiler* - all the pages are generated beforehand, their content remains the same no matter what your visitor is doing.
"""]]

View File

@ -0,0 +1,8 @@
[[!comment format=mdwn
username="https://www.google.com/accounts/o8/id?id=AItOawk_MMtLPS7osC5MjX00q2ATjvvXPWqm0ik"
nickname="micheal"
subject="comment 2"
date="2011-11-27T12:23:31Z"
content="""
How to to it with JavaScript OR SSI?
"""]]

View File

@ -1,3 +0,0 @@
Re [Let's just rely on backlinks for this?](http://git.ikiwiki.info/?p=ikiwiki;a=blobdiff;f=doc/ikiwiki/pagespec/discussion.mdwn;h=4eed3722ccc744595fc8380e68e69dc9e1ad6450;hp=f4fdd764ed61c34c09af9df046a1a134b7d0ffe6;hb=a4ce0468f6f562ad4ec749f156528aa5b3f2fe39;hpb=23a4ee6d15dbd9b8e8c6588a829dd30a26a8de32) and [2](http://git.ikiwiki.info/?p=ikiwiki;a=blobdiff;f=doc/ikiwiki/wikilink/discussion.mdwn;h=0677ff7ded6a86be7d010dfd97affdb6b266832a;hp=274c8aaf1d075adbf3b76496e1945348aefe836a;hb=4f4666c4ae5cdf5e04ac42cc52a97d90e978adb0;hpb=a4ce0468f6f562ad4ec749f156528aa5b3f2fe39):
I simply didn't notice there is an "add a new bug" form at [[bugs]], so I used the obvious way to create a page through the web-interface: to put first a wikilink pointing at the new page. --Ivan Z.

View File

@ -0,0 +1,27 @@
I copied ikiwiki from old host to new. Old is Debian GNU/Linux version 5.0.7, with ikiwiki 3.1415926~bpo50+1
New host is 5.0.8 with ikiwiki 3.20100815~bpo50+1
I have ikiwiki.setup and both GIT repos from old host, src and src.git, the latter is bare repo.
I suspect I have messed up things in the old host, since the src directory tree is much larger than the src.git.
tale@tugelbend:~/wiki$ du -sh src src.git/
8,3M src
2,6M src.git/
If I clone the src.git to the new host, I get after ikiwiki --setup web pages from year 2009. So I did the migration like this:
Copy the src directory to the new host to temp dir; git clone --bare /tmp/Foo/src ~/wiki/wiki.git
cd ~/wiki
git clone wiki.git wiki.src
cd ..
ikiwiki --setup ikiwiki.setup
I believe I have modified the ikiwiki.setup file correctly, I get no error messages and it makes the web page with the
same content as on old host. But when I git clone wiki.git a working copy for myself, and edit it, git commit -a ; git push
I am sad to see the web page is not updated.
How can I see what is wrong? The hook seems OK:
taleman@porixi:~/wiki$ ls -lh wiki.git/hooks/post-update
-rwsr-sr-x 1 taleman taleman 14K 23.12. 17:42 wiki.git/hooks/post-update
ikiwiki --setup created that and did not claim any errors.

View File

@ -0,0 +1,10 @@
[[!comment format=mdwn
username="http://joey.kitenet.net/"
nickname="joey"
subject="comment 2"
date="2011-12-25T00:07:28Z"
content="""
Try running the post-update hook by hand and see if it pulls the changes into ~/wiki/wiki.src and see if it updates the site.
Make sure `gitorigin_branch` is set in the setup file.
"""]]

View File

@ -0,0 +1,28 @@
[[!comment format=mdwn
username="https://launchpad.net/~tale"
nickname="tale"
subject="comment 2"
date="2011-12-27T16:18:31Z"
content="""
In both old and new host gitorigin_branch is empty string in ikiwiki.setup.
tale@tugelbend:~$ grep -i gitorigin ikiwiki.setup
gitorigin_branch => '',
The branches subdir is empty on both hosts:
tale@tugelbend:~$ LANG=C ls -lha wiki/src.git/branches/
total 8.0K
drwxr-xr-x 2 tale tale 4.0K Dec 24 2009 .
drwxr-xr-x 7 tale tale 4.0K Dec 24 2009 ..
tale@tugelbend:~$
I do not know what value I should assign to gitorigin_branch.
I tried
wiki.git/hooks/post-update
but nothing seems to happen. No output, web page stays the same. File timestamps are not updated
on the dest directory.
"""]]

View File

@ -0,0 +1,15 @@
[[!comment format=mdwn
username="https://launchpad.net/~tale"
nickname="tale"
subject="Editing via browser works"
date="2011-12-27T18:47:16Z"
content="""
I now set up virtual host in apache2 and fudged the ipnumber to correspond to hostnames the ikiwiki uses. I do not want to update DNS before I have checked the site works.
Now I can log in using OpenID and edit the wiki via browser. This time the web pages are updated and the changes I made appear in the wiki.
I cheched the gitorigin_branch setting was empty string even in 2009 when I got this wiki. I begin to suspect editing the wiki using a git checkout would not work even in the host the ikiwiki is currently running on, and maybe did not work in the host it was running on in 2009.
It looks to me like ikiwiki is working on this new host except git configuration is somehow messed up. It is possible I never did use git checkout on the old host.
"""]]

View File

@ -0,0 +1,16 @@
[[!comment format=mdwn
username="https://launchpad.net/~tale"
nickname="tale"
subject="Checked old host, git messed up there, too"
date="2011-12-27T18:59:38Z"
content="""
I did
git clone src.git
on the host ikiwiki is currently running on, and got an old version of the wiki, not the one that is diplayed on the web page.
So even there editing via browser works, but git checks out an old version and the changes I make do not get shown on the web page after git push.
This new host I set up is thus no worse, actually slighty better now because git clone at least gets me the sources the web pages are generated from.
How to figure out what is wrong with ikiwiki setup in the using git part?
"""]]

View File

@ -0,0 +1,22 @@
[[!comment format=mdwn
username="https://launchpad.net/~tale"
nickname="tale"
subject="branch = master, still no luck"
date="2011-12-28T03:22:57Z"
content="""
I learned from docs setting gitorigin_branch to empty string disables git pushing and pulling. So guessing
gitorigin_branch => 'master',
seemed a good idea.
However, now ikiwiki -setup gives:
taleman@porixi:~$ ikiwiki -setup ikiwiki.setup
successfully generated /var/www/ikiwiki/debian.fi/ikiwiki.cgi
successfully generated /home/taleman/wiki/wiki.git/hooks/post-update
fatal: 'master': unable to chdir or not a git archive
fatal: The remote end hung up unexpectedly
'git pull master' failed: at /usr/share/perl5/IkiWiki/Plugin/git.pm line 195.
taleman@porixi:~$
"""]]

View File

@ -0,0 +1,8 @@
[[!comment format=mdwn
username="https://launchpad.net/~tale"
nickname="tale"
subject="When is ikiwiki --setup run?"
date="2011-12-23T13:49:54Z"
content="""
Am I to run ikiwiki --setup after all the three steps?
"""]]

View File

@ -0,0 +1,8 @@
[[!comment format=mdwn
username="http://joey.kitenet.net/"
nickname="joey"
subject="comment 3"
date="2011-12-25T00:08:22Z"
content="""
You run ikiwiki -setup when you have all the files in place for ikiwiki and would like it to rebuild the site and generate the wrappers.
"""]]

View File

@ -0,0 +1,6 @@
I've installed the po plugin. I'm still trying to figure out how to use it.
I have a Ikiwiki instance with multiple existing pages in English.
How do I use po to create alternative pages in slave languages for these existing pages?

Some files were not shown because too many files have changed in this diff Show More