Should have committed earlier

Lots of changes:
- Article about IPC
- New TUWF release
- New ncdu release
- Atom feeds for the bug tracker
- Bug tracker switch to sqlite
This commit is contained in:
Yorhel 2016-06-18 15:18:24 +02:00
parent 3b837d8564
commit 7cf772d968
33 changed files with 978 additions and 159 deletions

View file

@ -12,6 +12,9 @@ BEGIN { ($ROOT = abs_path $0) =~ s{index\.cgi$}{}; }
my @changes = (
[ '2015-09-27', '/tuwf', 'TUWF 1.0 released' ],
[ '2015-04-05', '/ncdu', 'ncdu 1.11 released' ],
[ '2014-07-29', '/doc/easyipc', 'New article: The Sorry State of Convenient IPC' ],
[ '2014-06-25', '/doc', 'Uploaded my masters thesis' ],
[ '2014-04-23', '/ncdc', 'ncdc 1.19.1 released' ],
[ '2014-02-11', '/ncdc', 'ncdc 1.19 released' ],
@ -113,6 +116,7 @@ TUWF::register(
qr{doc/sqlaccess} => sub { podpage(shift, 'sqlaccess', 'doc', '', 'Multi-threaded Access to an SQLite3 Database', 1) },
qr{doc/commvis} => sub { podpage(shift, 'doc-commvis', 'doc', '', 'A Distributed Communication System for Modular Applications', 1) },
qr{doc/dcstats} => sub { podpage(shift, 'doc-dcstats', 'doc', '', 'Some Measurements on Direct Connect File Lists', 1) },
qr{doc/easyipc} => sub { podpage(shift, 'doc-easyipc', 'doc', '', 'The Sorry State of Convenient IPC', 1) },
qr{dump} => sub { podpage(shift, 'dump', 'dump', '', 'Code dump') },
qr{demo} => sub { podpage(shift, 'dump-demo', 'dump', 'demo', 'Demos') },
qr{dump/awshrink} => sub { podpage(shift, 'dump-awshrink', 'dump', 'awshrink', 'AWStats Data File Shrinker') },
@ -121,18 +125,20 @@ TUWF::register(
qr{dump/insbench} => sub { podpage(shift, 'dump-insbench', 'dump', 'insbench', 'Insertion Performance Benchmarks') },
qr{(?:($feedreg)/)?feed\.atom} => \&atom,
qr{(ncdc|ncdu|globster|yxml)/bug} => \&bug_list,
qr{(ncdc|ncdu|globster|yxml)/bug/feed\.atom} => \&bug_atom,
qr{(ncdc|ncdu|globster|yxml)/bug/post} => \&bug_post,
qr{(ncdc|ncdu|globster|yxml)/bug/new} => \&bug_new,
qr{(ncdc|ncdu|globster|yxml)/bug/([1-9][0-9]*)} => \&bug_item,
);
TUWF::set(
logfile => '/home/yorhel/tuwf.log',
logfile => '/var/log/apache2/tuwf.log',
error_404_handler => \&notfound,
mail_from => 'Yorhels Bug Tracker <projects@yorhel.nl>',
# this is a fairly static site, allow some aggressive caching
pre_request_handler => sub { $_[0]->resHeader('Cache-Control', 's-max-age=86400, max-age=3600'); 1; },
cookie_defaults => { domain => 'dev.yorhel.nl', path => '/' },
cookie_defaults => { domain => 'dev.yorhel.nl', path => '/', secure => 1 },
db_login => [ undef, undef, undef ],
);
TUWF::run();
@ -194,28 +200,28 @@ sub atom {
$s->resHeader('Last-Modified' => strftime '%a, %d %b %Y %H:%M:%S GMT', gmtime $t);
$s->resHeader('Content-Type' => 'application/atom+xml');
xml;
tag feed => xmlns => 'http://www.w3.org/2005/Atom', 'xml:lang' => 'en', 'xml:base' => 'http://dev.yorhel.nl/';
tag feed => xmlns => 'http://www.w3.org/2005/Atom', 'xml:lang' => 'en', 'xml:base' => 'https://dev.yorhel.nl/';
tag title => $sub ? "\u$sub Project Announcements" : "Yorhel's Projects";
tag updated => strftime('%Y-%m-%dT%H:%M:%SZ', gmtime $t);
tag id => "http://dev.yorhel.nl/feed.atom";
tag link => rel => 'self', type => 'application/atom+xml', href => "http://dev.yorhel.nl/feed.atom", undef;
tag link => rel => 'alternate', type => 'text/html', href => 'http://dev.yorhel.nl/', undef;
tag id => "https://dev.yorhel.nl/feed.atom";
tag link => rel => 'self', type => 'application/atom+xml', href => "https://dev.yorhel.nl/feed.atom", undef;
tag link => rel => 'alternate', type => 'text/html', href => 'https://dev.yorhel.nl/', undef;
my $n = 0;
for(@changes) {
next if $sub && (!$_->[1] || $_->[1] !~ /^\/\Q$sub/);
last if $n++ >= 10;
tag 'entry';
tag id => 'http://dev.yorhel.nl'.($_->[1]||'/').'#'.$_->[0];
tag id => 'https://dev.yorhel.nl'.($_->[1]||'/').'#'.$_->[0];
tag title => $_->[2];
tag updated => $_->[0].'T12:00:00Z';
tag published => $_->[0].'T12:00:00Z';
tag 'author';
tag name => 'Yoran Heling';
tag uri => 'http://dev.yorhel.nl/';
tag uri => 'https://dev.yorhel.nl/';
tag email => 'projects@yorhel.nl';
end;
tag link => rel => 'alternate', type => 'text/html', href => 'http://dev.yorhel.nl'.($_->[1]||'/'), undef;
tag link => rel => 'alternate', type => 'text/html', href => 'https://dev.yorhel.nl'.($_->[1]||'/'), undef;
end 'entry';
}
end 'feed';
@ -226,18 +232,18 @@ sub notfound {
my $s = shift;
my $u = lc $s->reqPath;
($_->[0] eq $u || $_->[0] eq "$u/") && return $s->resRedirect($_->[1], 'perm') for (
[ 'bluecubes', '/demo' ],
[ 'ncdc/guide', '/ncdc/man' ],
[ 'dump', '/dump' ],
[ 'dump/index2', '/dump' ],
[ 'dump/pmdc2-parse', '/dump' ],
[ 'dump/cbbcode', '/dump' ],
[ 'dump/cechoserv', '/dump' ],
[ 'dump/cyapong', '/dump' ],
[ 'dump/awshrink', '/dump/awshrink' ],
[ 'dump/grenamr', '/dump/grenamr' ],
[ '/bluecubes', '/demo' ],
[ '/ncdc/guide', '/ncdc/man' ],
[ '/dump', '/dump' ],
[ '/dump/index2', '/dump' ],
[ '/dump/pmdc2-parse', '/dump' ],
[ '/dump/cbbcode', '/dump' ],
[ '/dump/cechoserv', '/dump' ],
[ '/dump/cyapong', '/dump' ],
[ '/dump/awshrink', '/dump/awshrink' ],
[ '/dump/grenamr', '/dump/grenamr' ],
);
return $s->resRedirect("/$u", 'perm') if $u =~ s/\/$//;
return $s->resRedirect("$u", 'perm') if $u =~ s/\/$//;
return $s->resRedirect("/$1/bug$2", 'perm') if $u =~ /^(ncd[uc])\/issue(.*)$/;
$s->resStatus(404);
$s->htmlHeader(title => '404', page => '404');
@ -254,9 +260,9 @@ sub _bug_init {
require "$ROOT/Bug.pm";
my($s, $p) = @_;
$s->resHeader('Cache-Control', 'no-cache');
$s->_load_module('TUWF::DB');
$s->{_TUWF}{db_login} = [ undef, undef, undef ];
$s->dbInit;
#$s->_load_module('TUWF::DB');
#$s->{_TUWF}{db_login} = [ undef, undef, undef ];
#$s->dbInit;
return TUWF::Bug->new(table => $p, admins => [ $ENV{ISSUE_CODE} ]);
}
@ -287,6 +293,13 @@ sub bug_list {
}
sub bug_atom {
my($s, $p) = @_;
my $is = _bug_init(@_);
$is->atomFeed(sub { "https://dev.yorhel.nl/$p/bug/".shift });
}
sub bug_new {
my($s, $p) = @_;
my $is = _bug_init(@_);
@ -312,13 +325,13 @@ sub bug_post {
}
# Announce this report to the ncdc hub, through the globster bot
eval {
$ENV{DBUS_SESSION_BUS_ADDRESS} = 'unix:path=/tmp/dbus-globster';
require Net::DBus;
my $msg = "Bug activity for $p: $l->{summary} -> http://dev.yorhel.nl/$p/bug/$l->{issue}";
Net::DBus->find->get_service("net.blicky.Globster")->get_object("/net/blicky/Globster/Hub/1")->SendChat(-1, $msg, 0);
1;
} || warn $@;
#eval {
# $ENV{DBUS_SESSION_BUS_ADDRESS} = 'unix:path=/tmp/dbus-globster';
# require Net::DBus;
# my $msg = "Bug activity for $p: $l->{summary} -> https://dev.yorhel.nl/$p/bug/$l->{issue}";
# Net::DBus->find->get_service("net.blicky.Globster")->get_object("/net/blicky/Globster/Hub/1")->SendChat(-1, $msg, 0);
# 1;
#} || warn $@;
}
@ -380,6 +393,7 @@ sub htmlPOD {
$p->html_header_before_title('<!--');
$p->html_header_after_title('-->');
$p->html_footer('');
$p->parse_characters(1);
$p->output_string(\$html);
$p->{podhtml_LOT} = {
'TUWF' => '/tuwf/man',
@ -398,8 +412,6 @@ sub htmlPOD {
$html =~ s{\[html\](.*)É}{(my $h = $1) =~ s/\&gt;/>/g; $h =~ s/\&lt;/</g; $h =~ s/\&amp;/\&/g; $h =~ s/\&quot;/"/g; $h}egs;
$html =~ s/\[yh-changes\]/$s->genChanges()/e;
$html =~ s/<pre>( +(?:method|signal|property)) /<pre class="interface">$1 /g;
#$html =~ s/ (method|signal|property [a-z]) ([a-zA-Z0-9]+)/ $1 <b>$2<\/b>/g;
#$html =~ s/ (method|signal|property) / <b>$1<\/b> /g;
lit $html;
}
@ -448,13 +460,12 @@ sub htmlHeader {
div class => 'notes';
txt 'Yoran Heling'; br;
a href => 'mailto:projects@yorhel.nl', 'projects@yorhel.nl';
br; a href => 'http://yorhel.nl', 'home';
br; a href => 'https://yorhel.nl', 'home';
txt ' - '; a href => 'http://g.blicky.net', 'git repos';
br; b '= donate =';
a href => 'https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=BBF8LGT2LLNFN&lc=US&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted', 'paypal';
txt ' - '; a href => 'bitcoin:1PhXZaKbPFhuz4KbRcfUL9VveB58psa8R', 'bitcoin';
br; b '= pgp =';
a href => 'http://yorhel.nl/key.asc', 'key';
a href => 'https://yorhel.nl/key.asc', 'key';
txt ' - '; a href => 'http://pgp.mit.edu:11371/pks/lookup?search=0x8c2739fa', 'mit';
br; i '7446 0D32 B808 10EB A9AF A2E9 6239 4C69 8C27 39FA';
end;