8784: Fix test for latest firefox.
[arvados.git] / services / keepstore / usage.go
1 package main
2
3 import (
4         "flag"
5         "fmt"
6         "os"
7         "sort"
8         "strings"
9
10         "github.com/ghodss/yaml"
11 )
12
13 func usage() {
14         c := DefaultConfig()
15         knownTypes := []string{}
16         for _, vt := range VolumeTypes {
17                 c.Volumes = append(c.Volumes, vt().Examples()...)
18                 knownTypes = append(knownTypes, vt().Type())
19         }
20         exampleConfigFile, err := yaml.Marshal(c)
21         if err != nil {
22                 panic(err)
23         }
24         sort.Strings(knownTypes)
25         knownTypeList := strings.Join(knownTypes, ", ")
26         fmt.Fprintf(os.Stderr, `
27
28 keepstore provides a content-addressed data store backed by a local filesystem or networked storage.
29
30 Usage: keepstore -config path/to/keepstore.yml
31        keepstore [OPTIONS] -dump-config
32
33 NOTE: All options (other than -config) are deprecated in favor of YAML
34       configuration. Use -dump-config to translate existing
35       configurations to YAML format.
36
37 Options:
38 `)
39         flag.PrintDefaults()
40         fmt.Fprintf(os.Stderr, `
41 Example config file:
42
43 %s
44
45 Listen:
46
47     Local port to listen on. Can be "address:port" or ":port", where
48     "address" is a host IP address or name and "port" is a port number
49     or name.
50
51 LogFormat:
52
53     Format of request/response and error logs: "json" or "text".
54
55 PIDFile:
56
57    Path to write PID file during startup. This file is kept open and
58    locked with LOCK_EX until keepstore exits, so "fuser -k pidfile" is
59    one way to shut down. Exit immediately if there is an error
60    opening, locking, or writing the PID file.
61
62 MaxBuffers:
63
64     Maximum RAM to use for data buffers, given in multiples of block
65     size (64 MiB). When this limit is reached, HTTP requests requiring
66     buffers (like GET and PUT) will wait for buffer space to be
67     released.
68
69 MaxRequests:
70
71     Maximum concurrent requests. When this limit is reached, new
72     requests will receive 503 responses. Note: this limit does not
73     include idle connections from clients using HTTP keepalive, so it
74     does not strictly limit the number of concurrent connections. If
75     omitted or zero, the default is 2 * MaxBuffers.
76
77 BlobSigningKeyFile:
78
79     Local file containing the secret blob signing key (used to
80     generate and verify blob signatures).  This key should be
81     identical to the API server's blob_signing_key configuration
82     entry.
83
84 RequireSignatures:
85
86     Honor read requests only if a valid signature is provided.  This
87     should be true, except for development use and when migrating from
88     a very old version.
89
90 BlobSignatureTTL:
91
92     Duration for which new permission signatures (returned in PUT
93     responses) will be valid.  This should be equal to the API
94     server's blob_signature_ttl configuration entry.
95
96 SystemAuthTokenFile:
97
98     Local file containing the Arvados API token used by keep-balance
99     or data manager.  Delete, trash, and index requests are honored
100     only for this token.
101
102 EnableDelete:
103
104     Enable trash and delete features. If false, trash lists will be
105     accepted but blocks will not be trashed or deleted.
106
107 TrashLifetime:
108
109     Time duration after a block is trashed during which it can be
110     recovered using an /untrash request.
111
112 TrashCheckInterval:
113
114     How often to check for (and delete) trashed blocks whose
115     TrashLifetime has expired.
116
117 Volumes:
118
119     List of storage volumes. If omitted or empty, the default is to
120     use all directories named "keep" that exist in the top level
121     directory of a mount point at startup time.
122
123     Volume types: %s
124
125     (See volume configuration examples above.)
126
127 `, exampleConfigFile, knownTypeList)
128 }