6263: Pass through environment variables needed by gitolite-shell.
authorTom Clegg <tom@curoverse.com>
Thu, 20 Aug 2015 05:51:17 +0000 (01:51 -0400)
committerTom Clegg <tom@curoverse.com>
Thu, 20 Aug 2015 06:18:56 +0000 (02:18 -0400)
services/arv-git-httpd/main.go
services/arv-git-httpd/server.go

index 452390cbc3246a2e1d9c64492917e26f2f6f6a94..98695c9a9df806164afc59c128e204cb52547cc9 100644 (file)
@@ -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)
index c3c36dac5a5cc6c5dd21d852f398f3a927115ba7..e3cd58299bca3be27c59a3df3af607734c0399b9 100644 (file)
@@ -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()