Merge branch '8784-dir-listings'
[arvados.git] / services / arv-git-httpd / usage.go
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 // arvados-git-httpd provides authenticated access to Arvados-hosted
6 // git repositories.
7 //
8 // See http://doc.arvados.org/install/install-arv-git-httpd.html.
9 package main
10
11 import (
12         "flag"
13         "fmt"
14         "os"
15
16         "github.com/ghodss/yaml"
17 )
18
19 func usage() {
20         c := defaultConfig()
21         c.Client.APIHost = "zzzzz.arvadosapi.com:443"
22         exampleConfigFile, err := yaml.Marshal(c)
23         if err != nil {
24                 panic(err)
25         }
26         fmt.Fprintf(os.Stderr, `
27
28 arvados-git-httpd provides authenticated access to Arvados-hosted git
29 repositories.
30
31 See http://doc.arvados.org/install/install-arv-git-httpd.html.
32
33 Usage: arvados-git-httpd [-config path/to/arvados/git-httpd.yml]
34
35 Options:
36 `)
37         flag.PrintDefaults()
38         fmt.Fprintf(os.Stderr, `
39 Example config file:
40
41 %s
42
43 Client.APIHost:
44
45     Address (or address:port) of the Arvados API endpoint.
46
47 Client.AuthToken:
48
49     Unused. Normally empty, or omitted entirely.
50
51 Client.Insecure:
52
53     True if your Arvados API endpoint uses an unverifiable SSL/TLS
54     certificate.
55
56 GitCommand:
57
58     Path to git or gitolite-shell executable. Each authenticated
59     request will execute this program with the single argument
60     "http-backend".
61
62 GitoliteHome:
63
64     Path to Gitolite's home directory. If a non-empty path is given,
65     the CGI environment will be set up to support the use of
66     gitolite-shell as a GitCommand: for example, if GitoliteHome is
67     "/gh", then the CGI environment will have GITOLITE_HTTP_HOME=/gh,
68     PATH=$PATH:/gh/bin, and GL_BYPASS_ACCESS_CHECKS=1.
69
70 Listen:
71
72     Local port to listen on. Can be "address:port" or ":port", where
73     "address" is a host IP address or name and "port" is a port number
74     or name.
75
76 RepoRoot:
77
78     Path to git repositories.
79
80 `, exampleConfigFile)
81 }