]> Cypherpunks.ru repositories - gocheese.git/blob - doc/passwords.texi
More convenient trusted-host
[gocheese.git] / doc / passwords.texi
1 @node Passwords
2 @unnumbered Password authentication
3
4 Password authentication is required for packages uploading. Passwords
5 are dynamically changed through the FIFO file. You have to create it and
6 use in @option{-passwd} option. Optionally, to list currently present
7 logins use another FIFO and @option{-passwd-list} option:
8
9 @example
10 $ mkfifo passwd passwd-list
11 $ gocheese -passwd passwd -passwd-list passwd-list ...
12 @end example
13
14 Then you must feed it newline-separated records in following format:
15
16 @example
17 username:hashed-password[:ro]
18 @end example
19
20 Where @code{hashed-password} is in one of following algorithms:
21
22 @table @asis
23
24 @item @url{https://www.argon2i.com/, Argon2i} (recommended one!)
25     To get Argon2i hashed-password you can use any of following tools:
26
27     @itemize
28     @item @code{go install @url{https://github.com/balakhonova/argon2i,
29         github.com/balakhonova/argon2i@@latest}} (Go)
30     @item @url{https://github.com/p-h-c/phc-winner-argon2} (C)
31     @end itemize
32
33     Example user @code{foo} with password @code{bar} can have the
34     following password file entry:
35
36 @verbatim
37 foo:$argon2i$v=19$m=32768,t=3,p=4$OGU5MTM3YjVlYzQwZjhkZA$rVn53v6Ckpf7WH0676ZQLr9Hbm6VH3YnL6I9ONJcIIU
38 @end verbatim
39
40 @item SHA256
41     You can use your operating system tools:
42
43 @example
44 $ echo -n "password" | `command -v sha256 || echo sha256sum`
45 @end example
46
47     Example user @code{foo} with password @code{bar} will have the
48     following password file entry:
49
50 @verbatim
51 foo:$sha256$fcde2b2edba56bf408601fb721fe9b5c338d10ee429ea04fae5511b68fbf8fb9
52 @end verbatim
53
54 @end table
55
56 Optional @code{:ro} flag forbids user to upload packages, but allows
57 read-only access if @option{-auth-required} is enabled.
58
59 To add or update password entry:
60
61 @example
62 $ echo foo:$sha256$... > passwd
63 $ cat passwords.txt > passwd
64 @end example
65
66 To delete login entry use empty password:
67
68 @example
69 $ echo foo: > passwd
70 @end example
71
72 You can also check you passwords file with:
73
74 @example
75 $ gocheese -passwd-check < passwords.txt
76 $ echo $?
77 @end example