A docker container that provides a http download server for files, a simple folder ui and indices for downloading (via aria2 or other download managers).
The container extends the official nginx docker container. Requests to folders are forwarded to the nodejs indexserver. The container processes are managed with s6-overlay.
- An easy UI to navigate the folders
- Easy download with aria2, just add
?aria2
to any folder url to get download instructions for aria2 (example) - To get a list of absolute urls for all nested files within a folder, just add
?raw
to any folder url - Basic Auth support
docker run -d \
-e BASEPATH=/ `#optional` \
-e BASIC_AUTH_ENABLED=false `#optional` \
-e BASIC_AUTH_USER=admin `#optional` \
-e BASIC_AUTH_PASSWORD=fileserver `#optional` \
-v /path/to/files:/public \
-p "80:80" \
--restart unless-stopped \
peterberweiler/fileserver
version: "3"
services:
fileserver:
image: peterberweiler/fileserver
container_name: fileserver
environment:
# all of these are optional
- BASEPATH=/
- BASIC_AUTH_ENABLED=false
- BASIC_AUTH_REALM=admin
- BASIC_AUTH_USER=admin
- BASIC_AUTH_PASSWORD=fileserver
volumes:
- /path/to/files:/public
ports:
- "80:80"
restart: unless-stopped
Variable | Default | Function |
---|---|---|
BASEPATH |
/ |
if your file server is behind another reverse proxy you need to set this to the path where it is reachable (for example /myfiles ) |
BASIC_AUTH_ENABLED |
false |
enables basic auth, for the indices and files (Reminder: when using http your username, password and traffic will not be encrypted) |
BASIC_AUTH_USER |
admin |
basic auth username |
BASIC_AUTH_PASSWORD |
fileserver |
basic auth password |
BASIC_AUTH_REALM |
admin |
basic auth realm, only needed if you have another basic auth server on the same url |
Parameter | Function |
---|---|
?raw |
returns a list of absolute urls for all files in the current directory and all children |
?aria2 |
returns download instructions for aria2c |
?depth=5 |
limits how many levels of sub folders should be included (can be combined with aria2 and raw) |
Query | Function |
---|---|
/movies?aria2 |
returns download instructions for the complete movies directory |
/documents/text?raw&depth=1 |
returns a list of absolute paths for all files in /documents/text and their direct children |
You can use it with aria2 like so:
curl http://localhost/media/?aria2 | aria2c -c -i -
This would download the complete media
folder into the current directory. For
more infos, check out the
aria2 documentation
In these examples the following /
folder is bound to /public
/
└─ media/
├─ movies/
| └─ cool-movie.mkv
|
└─ tv/
└─ cool-series/
├─ s01e01.mp4
└─ s01e02.mp4
http://localhost/media/movies/cool-movie.mkv
http://localhost/media/tv/cool-series/s01e01.mp4
http://localhost/media/tv/cool-series/s01e02.mp4
http://localhost/media/movies/cool-movie.mkv
http://localhost/media/movies/cool-movie.mkv
dir=movies
out=cool-movie.mkv
http://localhost/media/tv/cool-series/s01e01.mp4
dir=tv/cool-series
out=s01e01.mp4
http://localhost/media/tv/cool-series/s01e02.mp4
dir=tv/cool-series
out=s01e02.mp4