-
Notifications
You must be signed in to change notification settings - Fork 51
New instructions + minor URI fix #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well we are talking about the "file browser UI location" and "listed files location". I would say lets adjust the wording to keep it consistent over the whole doc. |
||
|
||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. up until here, we can just do it in one step of: "clone the repo under also I would argue that choosing directory name |
||
5. Create the location for the files to be shared & browsable (E.G. `/var/www/isos`) | ||
6. Copy the files to the location | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. technically seen, you don't need to copy. for many use cases copying (probably gigabytes of data) is not an option. so either copy or using a symlink (which is described a at the end of this doc). |
||
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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is owning required? I think being able to read files and list the directories should be enough. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It only must be readable by 7. Make sure both the UI and shared files are at least readable by the nginx process[...] with `chmod +r -R ...`, and directories are browseable: `chmod +x ...`. Or make `www-data` own the files and directories: `chown -R www-data: ...` There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is definitely better, we just need someone to update the PR :) |
||
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 `<INSTALLDIR>/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/). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that in your use case a direct installation was probably a better choice, however in all these years I have been using this as an docker image (and that should remain the main focus). So it would be a good point to highlight that there are multiple options on how to use this and one is using the docker image and other is this direct installation.
Lets add a title called
## Usage
under which we will have the### Using with Docker
and then this part under### Direct Installation
after that.