Clarifying descriptions as suggested in PR review

This commit is contained in:
Drayton Munster 2022-03-25 22:25:16 -04:00
parent 3903ed000c
commit bc1545c717
4 changed files with 7 additions and 6 deletions

View file

@ -58,7 +58,7 @@ By default the server persists backup data in the OS temporary directory (`/tmp/
rest-server --path /user/home/backup --no-auth rest-server --path /user/home/backup --no-auth
``` ```
To authenticate users (for access to the rest-server), the server supports using a `.htpasswd` file to specify users. By default, the server looks for this file at the root of the persistence directory. You can create such a file by executing the following command (note that you need the `htpasswd` program from Apache's http-tools). In order to append new user to the file, just omit the `-c` argument. Only bcrypt and SHA encryption methods are supported, so use -B (very secure) or -s (insecure by today's standards) when adding/changing passwords. To authenticate users (for access to the rest-server), the server supports using a `.htpasswd` file to specify users. By default, the server looks for this file at the root of the persistence directory, but this can be changed using the `--htpasswd-file` option. You can create such a file by executing the following command (note that you need the `htpasswd` program from Apache's http-tools). In order to append new user to the file, just omit the `-c` argument. Only bcrypt and SHA encryption methods are supported, so use -B (very secure) or -s (insecure by today's standards) when adding/changing passwords.
```sh ```sh
htpasswd -B -c .htpasswd username htpasswd -B -c .htpasswd username

View file

@ -1,6 +1,7 @@
Feature: Allow configurable location for .htpasswd file (in present tense) Enhancement: Allow configurable location for .htpasswd file
Added the ability for a user to change the location of the .htpasswd file with the --htpasswd-file argument. It is now possible to change the location of the .htpasswd file using the
--htpasswd-file option.
https://github.com/restic/restic/issues/187 https://github.com/restic/restic/issues/187
https://github.com/restic/restic/pull/188 https://github.com/restic/restic/pull/188

View file

@ -100,7 +100,7 @@ func TestGetHandler(t *testing.T) {
t.Errorf("NoAuth=true: expected no error, got %v", err) t.Errorf("NoAuth=true: expected no error, got %v", err)
} }
// With NoAuth = true and custom .htpasswd // With NoAuth = false and custom .htpasswd
htpFile, err := ioutil.TempFile(dir, "custom") htpFile, err := ioutil.TempFile(dir, "custom")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)

2
mux.go
View file

@ -67,7 +67,7 @@ func NewHandler(server *Server) (http.Handler, error) {
if err != nil { if err != nil {
return nil, fmt.Errorf("cannot load %s (use --no-auth to disable): %v", server.HtpasswdPath, err) return nil, fmt.Errorf("cannot load %s (use --no-auth to disable): %v", server.HtpasswdPath, err)
} }
log.Printf("Loaded htpasswd file: %s", server.HtpasswdPath) log.Printf("Loaded htpasswd file %s", server.HtpasswdPath)
} }
const GiB = 1024 * 1024 * 1024 const GiB = 1024 * 1024 * 1024