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