2 @documentencoding UTF-8
8 GoCheese is Python private package repository and caching proxy.
10 It serves two purposes:
13 @item hosting of private locally uploaded packages
14 (conforming to @url{https://www.python.org/dev/peps/pep-0503/, PEP-0503}
15 (Simple Repository API))
16 @item proxying and caching of missing packages from upstream
17 @url{https://pypi.org/, PyPI}
20 Initially it was created as a fork of
21 @url{https://github.com/c4s4/cheeseshop, cheeseshop},
22 but nearly all the code was rewritten. It has huge differences:
25 @item proxying and caching of missing packages
26 @item atomic packages store on filesystem
27 @item SHA256-checksummed packages: storing checksums, giving them back,
28 verifying stored files integrity, verifying checksum of uploaded
30 @item graceful HTTP-server shutdown
31 @item no YAML configuration, just command-line arguments
32 @item no package overwriting ability (as PyPI does)
35 Also it contains @file{pyshop2packages.sh} migration script for
36 converting @url{https://pypi.org/project/pyshop/, Pyshop} database into
37 GoCheese one, including private packages.
39 GoCheese is free software, licenced under
40 @url{https://www.gnu.org/licenses/gpl-3.0.html, GNU GPLv3}:
41 see the file COPYING for copying conditions.
45 * Password authentication: Passwords.
47 * Storage format: Storage.
53 To use it for download purposes, just configure your @file{pip.conf}:
57 index-url = http://gocheese.host:8080/simple/
60 @option{-refresh} URL behaves the same way as @option{-simple} one, but
61 is always refreshes package versions from PyPI when listing it. You can
62 use it to forcefully update known package versions.
64 You can upload packages to it with
65 @url{https://pypi.org/project/twine/, twine}:
69 --repository-url http://gocheese.host:8080/simple/ \
71 --password foo dist/tarball.tar.gz
74 If @command{twine} sends SHA256 checksum in the request, then uploaded
75 file is checked against it.
78 @unnumbered Password authentication
80 Password authentication is required for packages uploading.
81 You have to store your authentication data in @option{-passwd} file in
85 username:hashed-password
88 Empty lines and having @verb{|#|} at the beginning are skipped.
90 Supported hashing algorithms are:
94 @item @url{https://www.argon2i.com/, Argon2i} (recommended one!)
95 To get Argon2i hashed-password you can use any of following tools:
97 @item @url{https://github.com/balakhonova/argon2i,
98 go get github.com/balakhonova/argon2i} (Go)
99 @item @url{https://github.com/p-h-c/phc-winner-argon2} (C)
101 Example user @code{foo} with password @code{bar} can have the
102 following password file entry:
105 foo:$argon2i$v=19$m=32768,t=3,p=4$OGU5MTM3YjVlYzQwZjhkZA$rVn53v6Ckpf7WH0676ZQLr9Hbm6VH3YnL6I9ONJcIIU
109 You can use your operating system tools:
113 $ echo -n "password" | sha256
115 # GNU/Linux-based systems
116 $ echo -n "password" | sha256sum
118 Example user @code{foo} with password @code{bar} will have the
119 following password file entry:
122 foo:$sha256$fcde2b2edba56bf408601fb721fe9b5c338d10ee429ea04fae5511b68fbf8fb9
127 You can refresh passwords by sending @code{SIGHUP} signal to the working daemon:
130 $ pkill -HUP gocheese
131 $ kill -HUP `pidof gocheese`
134 Before refreshing it's recommended to check @option{-passwd} file with
135 @option{-passwd-check} option to prevent daemon failure.
138 @unnumbered TLS support
140 You can enable TLS support by specifying PEM-encoded X.509 certificate
141 and private key files. Go's TLS implementation supports TLS 1.3, HTTP/2
142 negotiation, Keep-Alives, modern ciphersuites and ECC.
144 For example generate some self-signed certificate using GnuTLS toolset:
147 $ certtool --generate-privkey --ecc --outfile prv.pem
148 $ cert_template=`mktemp`
149 $ echo cn=gocheese.host > $cert_template
151 --generate-self-signed \
152 --load-privkey=prv.pem \
153 --template $cert_template \
156 $ gocheese -tls-cert cert.pem -tls-key prv.pem [...]
160 @unnumbered Storage format
162 Root directory has the following hierarchy:
167 | +- public-package-0.1.tar.gz.sha256
168 | +- public-package-0.2.tar.gz
169 | +- public-package-0.2.tar.gz.sha256
172 | +- private-package-0.1.tar.gz
173 | +- private-package-0.1.tar.gz.sha256
177 Each directory is a package name. When you try to list non existent
178 directory contents (you are downloading package you have not seen
179 before), then GoCheese will download information about package's
180 versions with checksums and write them in corresponding @file{.sha256}
181 files. However no package package tarball is downloaded.
183 When you request for particular package version, then its tarball is
184 downloaded and verified against the checksum. For example in the root
185 directory above we have downloaded only @file{public-package-0.2}.
187 Private packages contain @file{.private} file, indicating that it must
188 not be asked in PyPI if required version is missing. You have to create