2411: Add copyright notices to everything.
[arvados.git] / services / arv-git-httpd / usage.go
index a4a9900caabaa771812ea9c1a0c3cc91a320c5bb..8863da686085c6c790cc8046a5214479264e9174 100644 (file)
@@ -1,33 +1,44 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+// arvados-git-httpd provides authenticated access to Arvados-hosted
+// git repositories.
+//
+// See http://doc.arvados.org/install/install-arv-git-httpd.html.
 package main
 
 import (
-       "encoding/json"
        "flag"
        "fmt"
        "os"
+
+       "github.com/ghodss/yaml"
 )
 
 func usage() {
        c := defaultConfig()
        c.Client.APIHost = "zzzzz.arvadosapi.com:443"
-       exampleConfigFile, err := json.MarshalIndent(c, "    ", "  ")
+       exampleConfigFile, err := yaml.Marshal(c)
        if err != nil {
                panic(err)
        }
        fmt.Fprintf(os.Stderr, `
 
-arv-git-httpd provides authenticated access to Arvados-hosted git repositories.
+arvados-git-httpd provides authenticated access to Arvados-hosted git
+repositories.
 
 See http://doc.arvados.org/install/install-arv-git-httpd.html.
 
-Usage: arv-git-httpd [-config path/to/config.json]
+Usage: arvados-git-httpd [-config path/to/arvados/git-httpd.yml]
 
 Options:
 `)
        flag.PrintDefaults()
        fmt.Fprintf(os.Stderr, `
 Example config file:
-    %s
+
+%s
 
 Client.APIHost:
 
@@ -42,21 +53,29 @@ Client.Insecure:
     True if your Arvados API endpoint uses an unverifiable SSL/TLS
     certificate.
 
-Listen:
-
-    Local port to listen on. Can be "address:port" or ":port", where
-    "address" is a host IP address or name and "port" is a port number
-    or name.
-
 GitCommand:
 
     Path to git or gitolite-shell executable. Each authenticated
     request will execute this program with the single argument
     "http-backend".
 
+GitoliteHome:
+
+    Path to Gitolite's home directory. If a non-empty path is given,
+    the CGI environment will be set up to support the use of
+    gitolite-shell as a GitCommand: for example, if GitoliteHome is
+    "/gh", then the CGI environment will have GITOLITE_HTTP_HOME=/gh,
+    PATH=$PATH:/gh/bin, and GL_BYPASS_ACCESS_CHECKS=1.
+
+Listen:
+
+    Local port to listen on. Can be "address:port" or ":port", where
+    "address" is a host IP address or name and "port" is a port number
+    or name.
+
 RepoRoot:
 
-    Path to git repositories. Defaults to current working directory.
+    Path to git repositories.
 
 `, exampleConfigFile)
 }