gitweb: Enable running gitweb as PSGI app, via CGI::Emulate::PSGI
commit7ca4ca057f21fb5c764f6c1e1c9e3ae848c7336b
authorJakub Narebski <jnareb@gmail.com>
Tue, 8 May 2012 19:35:06 +0000 (8 21:35 +0200)
committerJakub Narebski <jnareb@gmail.com>
Tue, 8 May 2012 19:35:06 +0000 (8 21:35 +0200)
tree3a45cfd66c956e248de3ac0370920ff9a3b52ae4
parente43a1cc4bd5279bc09ad52c2feb9c92dd86968ed
gitweb: Enable running gitweb as PSGI app, via CGI::Emulate::PSGI

This commit makes it possible to run gitweb as a PSGI application
(see http://plackperl.org), using any of PSGI web servers.  This
includes ability to run gitweb from command line via Plack::Runner
module; just run "./gitweb.cgi --psgi" and point web browser
to http://0:5000

Gitweb uses CGI mode by default; to trigger PSGI mode one must either
pass `--psgi` or `--plackup` option to gitweb script, or the script
must be run with *.psgi filename (either copy/rename script, or make
symlink ending with *.psgi e.g. gitweb.psgi).

Besides running gitweb itself, converting its run_request() from CGI
to PSGI via CGI::Emulate::PSGI, gitweb as PSGI app also serves static
files: scripts, stylesheets and images via Plack::Middleware::Static.
Currently it assumes that positions and URLs of those assets are left
at their default values, namely that URLs end with "/static/<file>",
and that files can be found in "static/" directory relative to the
gitweb script itself.  This assumption should be relaxed in future.

Currently "git instaweb --httpd=plackup" doesn't (yet!) use this newly
introduced feature: it is left for future commit.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Documentation/gitweb.txt
gitweb/INSTALL
gitweb/README
gitweb/gitweb.perl