Merge branch '8784-dir-listings'
[arvados.git] / services / keep-web / 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.AnonymousTokens = []string{"xxxxxxxxxxxxxxxxxxxxxxx"}
17         c.Client.APIHost = "zzzzz.arvadosapi.com:443"
18         exampleConfigFile, err := json.MarshalIndent(c, "    ", "  ")
19         if err != nil {
20                 panic(err)
21         }
22         fmt.Fprintf(os.Stderr, `
23
24 Keep-web provides read-only HTTP access to files stored in Keep; see
25 https://godoc.org/github.com/curoverse/arvados/services/keep-web and
26 http://doc.arvados.org/install/install-keep-web.html
27
28 Usage: keep-web -config path/to/keep-web.yml
29
30 Options:
31 `)
32         flag.PrintDefaults()
33         fmt.Fprintf(os.Stderr, `
34 Example config file:
35     %s
36
37 Client.APIHost:
38
39     Address (or address:port) of the Arvados API endpoint.
40
41 Client.AuthToken:
42
43     Unused. Normally empty, or omitted entirely.
44
45 Client.Insecure:
46
47     True if your Arvados API endpoint uses an unverifiable SSL/TLS
48     certificate.
49
50 Listen:
51
52     Local port to listen on. Can be "address", "address:port", or
53     ":port", where "address" is a host IP address or name and "port"
54     is a port number or name.
55
56 AnonymousTokens:
57
58     Array of tokens to try when a client does not provide a token.
59
60 AttachmentOnlyHost:
61
62     Accept credentials, and add "Content-Disposition: attachment"
63     response headers, for requests at this hostname:port.
64
65     This prohibits inline display, which makes it possible to serve
66     untrusted and non-public content from a single origin, i.e.,
67     without wildcard DNS or SSL.
68
69 TrustAllContent:
70
71     Serve non-public content from a single origin. Dangerous: read
72     docs before using!
73
74 Cache.TTL:
75
76     Maximum time to cache collection data and permission checks.
77
78 Cache.MaxCollectionEntries:
79
80     Maximum number of collection cache entries.
81
82 Cache.MaxCollectionBytes:
83
84     Approximate memory limit for collection cache.
85
86 Cache.MaxPermissionEntries:
87
88     Maximum number of permission cache entries.
89
90 Cache.MaxUUIDEntries:
91
92     Maximum number of UUID cache entries.
93
94 `, exampleConfigFile)
95 }