diff --git a/README.md b/README.md index 02fbf8a..bca3ad1 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/changelog/unreleased/issue-187 b/changelog/unreleased/issue-187 index e47b0fd..497c732 100644 --- a/changelog/unreleased/issue-187 +++ b/changelog/unreleased/issue-187 @@ -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 \ No newline at end of file +https://github.com/restic/restic/pull/188 diff --git a/cmd/rest-server/main_test.go b/cmd/rest-server/main_test.go index 90d4879..58af251 100644 --- a/cmd/rest-server/main_test.go +++ b/cmd/rest-server/main_test.go @@ -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) diff --git a/mux.go b/mux.go index fd3382c..43e73b8 100644 --- a/mux.go +++ b/mux.go @@ -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