git_revert test: reinstate ikiwiki.setup, and make it work uninstalled

Previously it was relying on running with an installed ikiwiki
and being able to copy in recentchanges.mdwn and wikiicons/ from the
underlay in /usr. The underlay in ./underlays/basewiki can't be used
(yet) because ikiwiki doesn't allow following symlinks, even from
underlays.

I'd like to make ikiwiki follow symlinks whose destinations can be
verified to be safe (for example making it willing to expose
/usr/share/javascript to the web, but not /etc/passwd), at least from
underlays, but this is security-sensitive so I'm not going to rush
into it.
master
Simon McVittie 2016-12-24 12:27:21 +00:00
parent a9b876e1fa
commit 7c34df633d
4 changed files with 38 additions and 4 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
ikiwiki.setup /ikiwiki.setup
/Makefile /Makefile
Makefile.old Makefile.old
blib/* blib/*

1
debian/changelog vendored
View File

@ -1,6 +1,7 @@
ikiwiki (3.20161220) UNRELEASED; urgency=medium ikiwiki (3.20161220) UNRELEASED; urgency=medium
* Add CVE references for CVE-2016-10026 * Add CVE references for CVE-2016-10026
* Add missing ikiwiki.setup for the manual test for CVE-2016-10026
-- Simon McVittie <smcv@debian.org> Wed, 21 Dec 2016 13:03:07 +0000 -- Simon McVittie <smcv@debian.org> Wed, 21 Dec 2016 13:03:07 +0000

View File

@ -9,15 +9,17 @@ all:
mkdir -p git/doc/writable mkdir -p git/doc/writable
cd git && git init cd git && git init
cp index.mdwn git/doc/index.mdwn cp index.mdwn git/doc/index.mdwn
cp -a $(CURDIR)/../../../doc/wikiicons git/doc/
cp -a $(CURDIR)/../../../doc/recentchanges.mdwn git/doc/
echo "This is the first test page" > git/doc/writable/one.mdwn echo "This is the first test page" > git/doc/writable/one.mdwn
echo "This is the second test page" > git/doc/writable/two.mdwn echo "This is the second test page" > git/doc/writable/two.mdwn
cd git && git add doc && git commit -m 'Initial commit' cd git && git add . && git commit -m 'Initial commit'
$(ikiwiki) --setup ikiwiki.setup $(ikiwiki) --setup ikiwiki.setup
echo "This is the first test page, it was first" > git/doc/writable/one.mdwn echo "This is the first test page, it was first" > git/doc/writable/one.mdwn
cd git && git add doc && git commit -m 'First web commit' cd git && git add . && git commit -m 'First web commit'
$(ikiwiki) --setup ikiwiki.setup $(ikiwiki) --setup ikiwiki.setup
echo "This is the second test page, it came second" > git/doc/writable/two.mdwn echo "This is the second test page, it came second" > git/doc/writable/two.mdwn
cd git && git add doc && git commit -m 'Second web commit' cd git && git add . && git commit -m 'Second web commit'
$(ikiwiki) --setup ikiwiki.setup $(ikiwiki) --setup ikiwiki.setup
cd git && git mv doc/writable/one.mdwn doc/one.mdwn cd git && git mv doc/writable/one.mdwn doc/one.mdwn
cd git && git mv doc/writable/two.mdwn two.mdwn cd git && git mv doc/writable/two.mdwn two.mdwn

View File

@ -0,0 +1,31 @@
#!/usr/bin/perl
use Cwd qw(getcwd abs_path);
my $pwd;
my $src;
BEGIN {
$pwd = getcwd;
$src = abs_path("$pwd/../../..");
}
use IkiWiki::Setup::Standard {
wikiname => "ikiwiki_manual_test_git_revert",
srcdir => "$pwd/git/doc",
destdir => "$pwd/html",
templatedir => "$src/templates",
underlaydirbase => "$src/underlays",
underlaydir => "$src/underlays/basewiki",
verbose => 1,
syslog => 0,
usedirs => 0,
w3mmode => 1,
url => "file://$pwd/html",
cgiurl => 'file:///$LIB/ikiwiki-w3m.cgi/ikiwiki_manual_test_git_revert.cgi',
add_plugins => [qw{recentchanges anonok lockedit}],
locked_pages => '!writable/*',
anonok_pagespec => 'writable/*',
disable_plugins => [qw{passwordauth emailauth openid}],
rcs => 'git',
gitorigin_branch => '',
}