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