ISO-Share/README.md

53 lines
2.3 KiB
Markdown
Raw Permalink Normal View History

2024-02-06 16:47:00 +00:00
# ISO-Share
2016-02-12 07:58:41 +00:00
This web application is a very simple file browser which can be used
effectively together with [nginx's autoindex module](http://nginx.org/en/docs/http/ngx_http_autoindex_module.html).
![nginx file browser in action - light theme](assets/screenshot-light.jpg)
2024-04-03 19:55:03 +00:00
![nginx file browser in action - dark theme](assets/screenshot-dark.jpg)
2016-02-12 15:23:15 +00:00
2016-02-15 10:54:36 +00:00
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
## Using with docker
2016-02-12 08:19:03 +00:00
Mainly for demonstration purposes a docker image is also available [here](https://hub.docker.com/r/mohamnag/nginx-file-browser/).
In order to use this docker image, the volume which has to be served should
2022-04-08 11:51:48 +00:00
be mounted under `/opt/www/files/` and port `80` (root) or `8080` (rootless)) of container shall be mapped
2016-02-12 08:19:03 +00:00
to a proper port on host. A proper run would look like:
2022-04-08 11:51:48 +00:00
root
```
$ docker run -p 8080:80 -v /path/to/my/files/:/opt/www/files/ mohamnag/nginx-file-browser
```
rootless:
2016-02-12 08:19:03 +00:00
```
2022-04-01 08:38:31 +00:00
$ docker run -p 8080:8080 -v /path/to/my/files/:/opt/www/files/ mohamnag/nginx-file-browser
2016-02-15 10:54:36 +00:00
```
With container up and running you can point your browser to IP of docker host with given port to view the files. For example with above run command assuming docker host having IP with `192.168.0.200` we have to navigate to this URL:
`http://192.168.0.200:8080`
## Symlinks
> Be very careful with symlinks, they can expose very important files of system to outside world!
If you have symlinks inside files dir that you want to be able to browse too, the alias path where `/files` is served by nginx has to be changed to match the same path outside your docker container. Lets say I have a directory with path `/home/myuser/files-to-serve/`. Which has two directories named `dir1` and `dir2`. where `dir1` is nothing more than a symlink to `dir2`. In order to be able to browse `dir1` (inside `dir2`) on file browser, following have to be done:
Inside `default.conf` this line
```
alias /opt/www/files/;
```
shall be changed to
```
alias /home/myuser/files-to-serve/;
```
2018-12-10 18:36:56 +00:00
And the mounting point is now `/home/myuser/files-to-serve/` instead of `/opt/www/files/`.
2024-02-08 16:05:05 +00:00
2024-09-11 09:30:32 +00:00
## Attribution
This is a fork from [mohamnag/nginx-file-browser](https://github.com/mohamnag/nginx-file-browser)