Merge branch '8784-dir-listings'
[arvados.git] / services / keepproxy / usage.go
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 package main
6
7 import (
8         "encoding/json"
9         "flag"
10         "fmt"
11         "os"
12 )
13
14 func usage() {
15         c := DefaultConfig()
16         c.Client.APIHost = "zzzzz.arvadosapi.com:443"
17         exampleConfigFile, err := json.MarshalIndent(c, "    ", "  ")
18         if err != nil {
19                 panic(err)
20         }
21         fmt.Fprintf(os.Stderr, `
22
23 Keepproxy forwards GET and PUT requests to keepstore servers.  See
24 http://doc.arvados.org/install/install-keepproxy.html
25
26 Usage: keepproxy [-config path/to/keepproxy.yml]
27
28 Options:
29 `)
30         flag.PrintDefaults()
31         fmt.Fprintf(os.Stderr, `
32 Example config file:
33     %s
34
35 Client.APIHost:
36
37     Address (or address:port) of the Arvados API endpoint.
38
39 Client.AuthToken:
40
41     Anonymous API token.
42
43 Client.Insecure:
44
45     True if your Arvados API endpoint uses an unverifiable SSL/TLS
46     certificate.
47
48 Listen:
49
50     Local port to listen on. Can be "address:port" or ":port", where
51     "address" is a host IP address or name and "port" is a port number
52     or name.
53
54 DisableGet:
55
56     Respond 404 to GET and HEAD requests.
57
58 DisablePut:
59
60     Respond 404 to PUT, POST, and OPTIONS requests.
61
62 DefaultReplicas:
63
64     Default number of replicas to write if not specified by the
65     client. If this is zero or omitted, the site-wide
66     defaultCollectionReplication configuration will be used.
67
68 Timeout:
69
70     Timeout for requests to keep services, with units (e.g., "120s",
71     "2m").
72
73 PIDFile:
74
75     Path to PID file. During startup this file will be created if
76     needed, and locked using flock() until keepproxy exits. If it is
77     already locked, or any error is encountered while writing to it,
78     keepproxy will exit immediately. If omitted or empty, no PID file
79     will be used.
80
81 Debug:
82
83     Enable debug logging.
84
85 `, exampleConfigFile)
86 }