diff options
author | Eric Wong <e@80x24.org> | 2016-07-01 01:03:31 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-07-01 01:11:41 +0000 |
commit | 79bf257cbc4e188992f540d6b4ae1bd5cbcf26ee (patch) | |
tree | 1b89612dc673d58b363f25c2d038f0b796cf705b /examples | |
parent | bd3ed82913cd065636525a5dd8bab9edcb3e3cb1 (diff) | |
download | public-inbox-79bf257cbc4e188992f540d6b4ae1bd5cbcf26ee.tar.gz |
Might as well eat our own dogfood...
Diffstat (limited to 'examples')
-rw-r--r-- | examples/public-inbox.psgi | 14 | ||||
-rw-r--r-- | examples/unsubscribe.psgi | 3 |
2 files changed, 15 insertions, 2 deletions
diff --git a/examples/public-inbox.psgi b/examples/public-inbox.psgi index 4edbf5e3..a90a2bc3 100644 --- a/examples/public-inbox.psgi +++ b/examples/public-inbox.psgi @@ -11,6 +11,10 @@ use PublicInbox::WWW; PublicInbox::WWW->preload; use Plack::Builder; my $www = PublicInbox::WWW->new; + +# share the public-inbox code itself: +my $src = $ENV{SRC_GIT_DIR}; # '/path/to/public-inbox.git' + builder { eval { enable 'Deflater', @@ -40,5 +44,13 @@ builder { # format => '%t "%r" %>s %b %D'; enable 'Head'; - sub { $www->call(@_) }; + sub { + my ($env) = @_; + # share public-inbox.git code! + if ($src && $env->{PATH_INFO} =~ m!\A/public-inbox\.git/(.*)!) { + PublicInbox::GitHTTPBackend::serve($env, $src, $1); + } else { + $www->call($env); + } + }; } diff --git a/examples/unsubscribe.psgi b/examples/unsubscribe.psgi index beeab9f8..5b9b16cc 100644 --- a/examples/unsubscribe.psgi +++ b/examples/unsubscribe.psgi @@ -17,7 +17,8 @@ my $app = PublicInbox::Unsubscribe->new( # the archives runs as a different user. PublicInbox::Config->new('/home/pi/.public-inbox/config') }, - code_url => 'git://80x24.org/public-inbox.git', # change if you fork + # change if you fork + code_url => 'https://public-inbox.org/public-inbox.git', owner_email => 'BOFH@example.com', confirm => 0, |