package Commods;
use IO::File;
+use IO::Pipe;
use HTTP::Request::Common ();
use POSIX;
use LWP::UserAgent;
&pipethrough_run_gzip &http_useragent &version_core
&http_useragent_string_map
&cgipostform &yarrgpostform &cgi_get_caller
- &set_ctype_utf8 $masterinfoversion);
+ &set_ctype_utf8 $masterinfoversion
+ &source_tarball);
%EXPORT_TAGS = ( );
@EXPORT_OK = qw();
return $ua;
}
+sub source_tarball ($$) {
+ my ($sourcebasedir,$spitoutfn) = @_;
+
+ my $pipe= new IO::Pipe or die $!;
+ my $pid= fork(); defined $pid or die $!;
+ if (!$pid) {
+ $ENV{'YPPSC_YARRG_SRCBASE'}= $sourcebasedir;
+ $pipe->writer();
+ exec '/bin/sh','-c','
+ cd -P "$YPPSC_YARRG_SRCBASE"
+ (
+ git-ls-files -z;
+ git-ls-files -z --others --exclude-from=.gitignore;
+ if test -d .git; then find .git -print0; fi
+ ) | (
+ cpio -Hustar -o --quiet -0 -R 1000:1000 || \
+ cpio -Hustar -o --quiet -0
+ ) | gzip
+ ';
+ die $!;
+ }
+ $pipe->reader();
+
+ my ($d, $l);
+ while ($l= read $pipe, $d, 65536) {
+ $spitoutfn->($d);
+ }
+ waitpid $pid,0;
+ defined $l or die "read pipe $!";
+ $pipe->error and die "pipe error $!";
+ close $pipe;
+ # deliberately ignore errors
+}
+
1;
# This script is invoked when the yarrg client uploads to
# the chiark database.
-# This is part of ypp-sc-tools, a set of third-party tools for assisting
-# players of Yohoho Puzzle Pirates.
+# This is part of the YARRG website. YARRG is a tool and website
+# for assisting players of Yohoho Puzzle Pirates.
#
# Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# GNU Affero General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
my $re_any= "^(.*)\$";
-parse_info_serverside();
-
sub fail ($) {
my ($msg) = @_;
addlog("failing $msg");
my %o;
+if (param('get_source')) {
+ header('application/octet-stream');
+ source_tarball('..', sub { print $_[0] or die $!; });
+ exit 0;
+}
+
+parse_info_serverside();
+
my $midtmp= "_mid-pid$$.hold";
open MIDTMP, ">$midtmp" or die "$midtmp $!";
stat MIDTMP or die $!;
# creates or updates OCEAN-Oceanname.db
# from source-info.txt
-# This is part of ypp-sc-tools, a set of third-party tools for assisting
-# players of Yohoho Puzzle Pirates.
+# This is part of the YARRG website. YARRG is a tool and website
+# for assisting players of Yohoho Puzzle Pirates.
#
# Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# GNU Affero General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
# This script is invoked when the yarrg wants to send an update to the
# dictionary server. See README.privacy.
-# This is part of ypp-sc-tools, a set of third-party tools for assisting
-# players of Yohoho Puzzle Pirates.
+# This is part of the YARRG website. YARRG is a tool and website
+# for assisting players of Yohoho Puzzle Pirates.
#
# Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# GNU Affero General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
# are used without permission. This program is not endorsed or
# sponsored by Three Rings.
-
# upload testing runes:
#
# YPPSC_YARRG_DICT_UPDATE=./ YPPSC_YARRG_DICT_SUBMIT=./ ./yarrg --ocean midnight --pirate aristarchus --find-island --same --raw-tsv >raw.tsv
use Commods;
+if (param('get_source')) {
+ header('application/octet-stream');
+ source_tarball('..', sub { print $_[0] or die $!; });
+ exit 0;
+}
+
my $aadepth=2;
#---------- pixmaps ----------
#!/usr/bin/perl -w
+# This is part of the YARRG website. YARRG is a tool and website
+# for assisting players of Yohoho Puzzle Pirates.
+#
+# Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
+# are used without permission. This program is not endorsed or
+# sponsored by Three Rings.
+
use strict (qw(vars));
use CommodsDatabase;
# ./update-master-info -b -d ~ftp/users/ijackson/yarrg/ -a
# ./update-master-info -b -d ~ftp/users/ijackson/yarrg/ -O ...
-# This is part of ypp-sc-tools, a set of third-party tools for assisting
-# players of Yohoho Puzzle Pirates.
+# This is part of the YARRG website. YARRG is a tool and website
+# for assisting players of Yohoho Puzzle Pirates.
#
# Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# GNU Affero General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
YARRG is Free Software - you may share and modify it. See the
licences for details. Not only the client but also the website code
-is Free. The yarrg client, support files, and so forth are under
-the GNU GPL (v3 or later); the website is under the GNU Affero GPL (v3
-or later).
+is Free. The yarrg client, support files, and so forth are under the
+GNU GPL (v3 or later); the website and database backend is under the
+GNU Affero GPL (v3 or later).
<p>
an up-to-date of its actually-running source code. So this link
gives you the source code for the pages you are now looking at.
-<h3>YARRG lookup website instances</h3>
+<h3>YARRG website code instances</h3>
+
+<h4>Lookup website</h4>
<ul>
- <li><a href="http://yarrg.chiark.net/">Main released site</a>
- <li><a href="http://yarrg.chiark.net/test/data">Released code; testing database instance (updated with yarrg --test-servers)</a>
- <li><a href="http://yarrg.chiark.net/test/code">Testing version of the site code</a>
- <li><a href="http://yarrg.chiark.net/test/both">Testing code running against the testing database instance</a>
+ <li><a href="http://yarrg.chiark.net/">Main released site</a>,
+ with <a href="http://yarrg.chiark.net/source.tar.gz">source code</a>
+ <li><a href="http://yarrg.chiark.net/test/data">Released code; testing database instance (updated with yarrg --test-servers)</a> (source code as above)
+ <li><a href="http://yarrg.chiark.net/test/code">Testing version of the site code</a>,
+ with <a href="http://yarrg.chiark.net/test/source.tar.gz">source code</a>
+ <li><a href="http://yarrg.chiark.net/test/both">Testing code running against the testing database instance</a> (source code as above)
</ul>
-Each of these allows you to download its own source code so you
-can get both the testing and the main version of the website.
-
<p>
You can add the form parameter <kbd>?debug=1</kbd> to each of the
-above to get a version of the site with debugging output enabled.
+website URLs above to get a version of the site with debugging output enabled.
+
+<h4>Database and dictionary update receiver</h4>
+
+On the live system there are different trees, potentially with
+different versions, for receiving updates and managing the database,
+to the ones for displaying the website. The database management trees
+are normally accessed only via the upload client but you may also
+download their source directly:
+
+ <ul>
+ <li><a href="http://upload.yarrg.chiark.net/commod-update-receiver?get_source=1">Main production instance</a>
+ <li><a href="http://upload.yarrg.chiark.net/test/commod-update-receiver?get_source=1">Testing database instance</a>
+ </ul>
<h3>Data</h3>
</%doc><%flags>
inherit => undef
</%flags><%perl>
-use IO::Pipe;
use CommodsWeb;
+use Commods;
$r->content_type('application/octet-stream');
$m->flush_buffer();
-$ENV{'YPPSC_YARRG_SRCBASE'}= sourcebasedir();
-my $pipe= new IO::Pipe or die $!;
-my $pid= fork(); defined $pid or die $!;
-if (!$pid) {
- $pipe->writer();
- exec '/bin/sh','-c','
- cd -P "$YPPSC_YARRG_SRCBASE"
- (
- git-ls-files -z;
- git-ls-files -z --others --exclude-from=.gitignore;
- if test -d .git; then find .git -print0; fi
- ) | (
- cpio -Hustar -o --quiet -0 -R 1000:1000 || \
- cpio -Hustar -o --quiet -0
- ) | gzip
- ';
- die $!;
-}
-$pipe->reader();
-
-my ($d, $l);
-while ($l= read $pipe, $d, 65536) {
- print $d;
+source_tarball(sourcebasedir(), sub {
+ print $_[0];
$m->flush_buffer();
-}
-waitpid $pid,0;
-defined $l or die "read pipe $!";
-$pipe->error and die "pipe error $!";
-close $pipe;
-# deliberately ignore errors
+})
</%perl>
# helper program for getting information from yppedia
-# This is part of ypp-sc-tools, a set of third-party tools for assisting
-# players of Yohoho Puzzle Pirates.
+# This is part of the YARRG website. YARRG is a tool and website
+# for assisting players of Yohoho Puzzle Pirates.
#
# Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
#
# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# GNU Affero General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Yohoho and Puzzle Pirates are probably trademarks of Three Rings and