Skip to content

Commit

Permalink
Clarifying descriptions as suggested in PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
dwmunster committed Mar 26, 2022
1 parent 3903ed0 commit bc1545c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

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
htpasswd -B -c .htpasswd username
Expand Down
7 changes: 4 additions & 3 deletions changelog/unreleased/issue-187
Original file line number Diff line number Diff line change
@@ -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/pull/188
https://github.com/restic/restic/pull/188
2 changes: 1 addition & 1 deletion cmd/rest-server/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func TestGetHandler(t *testing.T) {
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")
if err != nil {
t.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func NewHandler(server *Server) (http.Handler, error) {
if err != nil {
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
Expand Down

0 comments on commit bc1545c

Please # to comment.