git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[RFC/PATCH 4/5] gitweb.psgi: Allow passing arguments to Plack::Runner

From
Jakub Narebski <jnareb@gmail.com>
Date
Mar 3, 2012, 17:57 UTC
Message-ID
<1330797423-22926-5-git-send-email-jnareb@gmail.com>
In-Reply-To
<1330797423-22926-1-git-send-email-jnareb@gmail.com>

Command options after first '--' are passed literally to Plack::Runner as arguments, in addition to default ones used. This way you can select PSGI server, host, port, etc.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
Could be squashed with 4/5, now that I realized that it is that simple.
 gitweb/gitweb.perl |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 0dbdd15..6bd7b08 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1312,7 +1312,8 @@ sub run_psgi_app {
 
 		my $runner = Plack::Runner->new();
 		$runner->parse_options(qw(--env deployment),
-		                       qw(--host 127.0.0.1));
+		                       qw(--host 127.0.0.1),
+		                       @ARGV);
 		$runner->run($app);
 	}
 }
-- 
1.7.9
Previous: Jakub NarebskiNext: Jakub Narebski
Message 5 of 7 in “gitweb: Proof of concept of PSGI interface”
  1. 0/5 gitweb: Proof of concept of PSGI interfaceJakub Narebski, Mar 3, 2012
  2. 1/5 gitweb: Jump do DONE_REQUEST not DONE_GITWEB on errorJakub Narebski, Mar 3, 2012
  3. 2/5 gitweb: Prepare for splitting gitwebJakub Narebski, Mar 3, 2012
  4. 3/5 gitweb: Enable running gitweb as PSGI app, via CGI::Emulate::PSGIJakub Narebski, Mar 3, 2012
  5. 4/5 gitweb.psgi: Allow passing arguments to Plack::RunnerJakub Narebski, Mar 3, 2012
  6. 5/5 git-instaweb: Use new PSGI interface mode of gitwebJakub Narebski, Mar 3, 2012
  7. 6/5 gitweb.psgi: Use installed static files, if they are availableJakub Narebski, Mar 8, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.