diff --git a/.gitignore b/.gitignore index a5199f6..cae0190 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules/ -.idea \ No newline at end of file +.idea +package-lock.json \ No newline at end of file diff --git a/README.md b/README.md index 011cbcc..15c3f3c 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,22 @@ Or We can run node-file-manager in terminal directly. We can specify prot add data root dir by `-p` and `-d`, default with 5000 and scripts directory. Then, we can view localhost:8080/ in our browr. + +# HTTP Basic Auth +The app is protected with simple http basic auth, so it's recommended to use it just over TLS (HTTPS). Let's Encrypt is your friend. ;) + +## Setup +If you use linux you can simply use `htpasswd` comming with `apache2-utils` (on Debian/Ubuntu) + +On Debian/Ubuntu do: +```bash +sudo apt-get update +sudo apt-get -y install apache2-utils +``` + +## Add User +The following command creates a new `htpasswd` file in the current folder with the user `peter`. After creating a new file copy it into the `lib` dir of the app or append the content of the new file to the existing one. +```bash +htpasswd -c ./htpasswd peter +cp ./htpasswd node-file-manager/lib +``` \ No newline at end of file