]> Cypherpunks.ru repositories - gocheese.git/blob - usage.go
Download link for 3.0.0 release
[gocheese.git] / usage.go
1 /*
2 GoCheese -- Python private package repository and caching proxy
3 Copyright (C) 2019-2021 Sergey Matveev <stargrave@stargrave.org>
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, version 3 of the License.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 package main
19
20 import (
21         "fmt"
22         "os"
23 )
24
25 const (
26         DefaultBind             = "[::]:8080"
27         DefaultMaxClients       = 128
28         DefaultNoRefreshURLPath = "/norefresh/"
29         DefaultRefreshURLPath   = "/simple/"
30         DefaultGPGUpdateURLPath = "/gpgupdate/"
31         DefaultJSONURLPath      = "/pypi/"
32         DefaultPyPIURL          = "https://pypi.org/simple/"
33         DefaultJSONURL          = "https://pypi.org/pypi/"
34
35         Warranty = `This program is free software: you can redistribute it and/or modify
36 it under the terms of the GNU General Public License as published by
37 the Free Software Foundation, version 3 of the License.
38
39 This program is distributed in the hope that it will be useful,
40 but WITHOUT ANY WARRANTY; without even the implied warranty of
41 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
42 GNU General Public License for more details.
43
44 You should have received a copy of the GNU General Public License
45 along with this program.  If not, see <http://www.gnu.org/licenses/>.`
46 )
47
48 func usage() {
49         fmt.Fprintf(os.Stderr, `Usage: gocheese [OPTIONS ...] /path/to/packages
50
51 Network transport options:
52   -ucspi          -- Work as UCSPI-TCP service instead of listening
53   -bind HOST:PORT -- TCP address to bind to (default: %s)
54   -maxclients N   -- Maximal amount of simultaneous clients (default: %d)
55
56 TLS enabling options:
57   -tls-cert PEM -- Path to TLS X.509 certificate
58   -tls-key PEM  -- Path to TLS X.509 private key
59
60 HTTP endpoints:
61   -norefresh URLPATH -- Non-refreshing Simple API path (default: %s)
62   -refresh URLPATH   -- Auto-refreshing Simple API path (default: %s)
63   -gpgupdate URLPATH -- GPG forceful refreshing path (default: %s)
64   -json URLPATH      -- JSON API path (default: %s)
65
66 Upstream PyPI:
67   -pypi URL      -- Upstream Simple API (default: %s)
68   -pypi-json URL -- Enable and use specified JSON API (default: %s)
69                     Disabled if empty.
70   -pypi-cert-hash HEX(SHA256(SPKI)) -- Authenticate upstream by its
71                                        X.509 certificate's hash
72 Password management:
73   -passwd PATH      -- Path to readable FIFO for loading passwords
74   -passwd-list PATH -- Path to writeable FIFO for listing logins
75   -passwd-check     -- Verify passwords format from stdin, then exit
76
77 Other options:
78   -log-timestamped -- Prepend timestamp to log messages
79   -fsck            -- Run integrity check of all packages
80   -version         -- Print version information
81   -warranty        -- Print warranty information
82
83 GOCHEESE_NO_SYNC=1 environment variable disable filesystem fsyncs.
84 `,
85                 DefaultBind,
86                 DefaultMaxClients,
87                 DefaultNoRefreshURLPath,
88                 DefaultRefreshURLPath,
89                 DefaultGPGUpdateURLPath,
90                 DefaultJSONURLPath,
91                 DefaultPyPIURL,
92                 DefaultJSONURLPath,
93         )
94 }