From b20aa99b4356a2afa092bb355a0db78b0b8f711f Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Thu, 20 Aug 2015 01:51:17 -0400 Subject: [PATCH] 6263: Pass through environment variables needed by gitolite-shell. --- services/arv-git-httpd/main.go | 2 +- services/arv-git-httpd/server.go | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/services/arv-git-httpd/main.go b/services/arv-git-httpd/main.go index 452390cbc3..98695c9a9d 100644 --- a/services/arv-git-httpd/main.go +++ b/services/arv-git-httpd/main.go @@ -19,7 +19,7 @@ func init() { flag.StringVar(&theConfig.Addr, "address", "0.0.0.0:80", "Address to listen on, \"host:port\".") flag.StringVar(&theConfig.GitCommand, "git-command", "/usr/bin/git", - "Path to git executable. Each authenticated request will execute this program with a single argument, \"http-backend\".") + "Path to git or gitolite-shell executable. Each authenticated request will execute this program with a single argument, \"http-backend\".") cwd, err := os.Getwd() if err != nil { log.Fatalln("Getwd():", err) diff --git a/services/arv-git-httpd/server.go b/services/arv-git-httpd/server.go index c3c36dac5a..e3cd58299b 100644 --- a/services/arv-git-httpd/server.go +++ b/services/arv-git-httpd/server.go @@ -18,8 +18,14 @@ func (srv *server) Start() error { Env: []string{ "GIT_PROJECT_ROOT=" + theConfig.Root, "GIT_HTTP_EXPORT_ALL=", + "SERVER_ADDR=" + theConfig.Addr, + }, + InheritEnv: []string{ + "PATH", + // Needed if GitCommand is gitolite-shell: + "GITOLITE_HTTP_HOME", + "GL_BYPASS_ACCESS_CHECKS", }, - InheritEnv: []string{"PATH"}, Args: []string{"http-backend"}, } mux := http.NewServeMux() -- 2.39.5