From 1f8c63ce7fdda22d80c0e039355cee77b89eb263 Mon Sep 17 00:00:00 2001
From: "Nephi.Aust" <29741794+Nephiaust@users.noreply.github.com>
Date: Mon, 8 Apr 2024 01:33:58 +0800
Subject: [PATCH 1/2] added 'https:' to Google font URI
---
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index d4178d3..9741f3a 100644
--- a/index.html
+++ b/index.html
@@ -5,7 +5,7 @@
File Browser
-
+
From 1fe23eb29f4463f906ef2c6e4734ed6bd30c6004 Mon Sep 17 00:00:00 2001
From: "Nephi.Aust" <29741794+Nephiaust@users.noreply.github.com>
Date: Mon, 8 Apr 2024 01:58:55 +0800
Subject: [PATCH 2/2] Added instructions on how to 'install & configure' web
app
---
README.md | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/README.md b/README.md
index e72a4f7..79c9939 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,39 @@ effectively together with [nginx's autoindex module](http://nginx.org/en/docs/ht
A sample nginx configuration is also included which mounts **file browser** under root (`/`) and mounts files to be listed under `/files` path. Hence is the `filesBaseUrl` under
+## Installation / Configuration
+
+The system has a default to use the location's root (E.G. the site's root location `www.example.net/`, and the physical of `/opt/www/`). This can be configured to move both the ***installation*** location and the location to be browseable.
+
+1. Clone the repo to the server
+2. Create an installation location (E.G. `/var/www/files/`)
+3. Copy the `css`, `image`, `js` directories to the installation location
+4. Copy the `index.html` to the installation location
+5. Create the location for the files to be shared & browsable (E.G. `/var/www/isos`)
+6. Copy the files to the location
+7. Make sure the files in the installation location & the location for the files to be shared are owned by the nginx process (E.G. `www-data:www-data` for Debian/Ubuntu based saystems)
+8. Edit the nginx configuration file for the site (E.G. `/etc/nginx/sites-enabled/default`)
+9. Create a location called files (see the example configuration below) and set the options appropriately
+```
+location /files {
+ root /var/www/files/;
+ index index.html index.htm;
+}
+```
+10. Create a location for the files listing to be read by the application
+```
+location /myfiles {
+ autoindex on;
+ autoindex_format json;
+}
+```
+11. Save the configuration and reload (or restart) the nginx process (E.G. `serivce nginx reload`)
+12. Before loading the page to verify its working the `main.js` javascript file needs to be updated.
+13. Edit the `main.js` file from the `/js/`
+14. Find the line containing `var filesBaseUrl = "/files";` (about line 217). Change the `/files` to match the location from step 10.
+15. Save the file
+16. Loading the site now (E.G. `www.example.net/files`) will now load and show (as seen in the example pictures above)
+
## Using with docker
Mainly for demonstration purposes a docker image is also available [here](https://hub.docker.com/r/mohamnag/nginx-file-browser/).