GitXplorerGitXplorer
k

filestation

public
0 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
fd856427b8233647bd2cad076f8ac2de93bd1f55

use latest deno features

kkorki43 committed 3 years ago
Unverified
bdc885ad3d170e0459de88666d4d0b2938ef1017

removed docker image

kkorki43 committed 3 years ago
Unverified
438caf21796319e0cb2caa11e41668e0bf6536f9

release v1.1.0

kkorki43 committed 3 years ago
Unverified
a8fa28fcd7b4e5ad1f29e7665be2160a53995ee9

create changelog

kkorki43 committed 3 years ago
Unverified
dd7de3801f8a9cc2b5070f91661e55da40e11e4b

mention web ui in readme

kkorki43 committed 3 years ago
Unverified
ab8d951e2852233100882cb2621c4a22c20a94da

format

kkorki43 committed 3 years ago

README

The README file for this repository.

filestation

Very simple file sharing server written for Deno.

  • Upload files via POST
  • Delete files via DELETE
  • Download files via GET
  • List files (can be disabled)

The goal of this project is to be as minimal as possible. There is no authentication or folder support built in. You can just upload, download and delete files.

By default a list of available files is sent on /list. You can disable this behaviour by supplying the --no-list argument.

Deploy

Arguments:

  • --port, -p: Specify the port the server will listen on. (default: 3000)
  • --root, -r: The folder where files should be stored / read from. (default: files)
  • --index, -i: The file that will be sent on requests to /, relative to the root folder. (default: index.html)
  • --block, -b: Files that can't be deleted/uploaded. Can be defined multiple times. (default: index.html)
  • --verbose, -v: Show additional logging output. (default: false)
  • --list, --no-list: Enable/disable file listing. When this is enabled it will also block files with the name "list" from being uploaded. (default: true)
  • --path: Basepath if hosted "in a subfolder". (default: /)

You can run the file using Deno but it is recommended to run via docker.

# run using deno
deno run -q --allow-net --allow-write=myfolder --allow-read=myfolder src/mod.ts \
  -p 1080 --root myfolder -b mystaticfile -v

Docker

You can build a docker image using the provided Dockerfile. Clone the repository and run docker-compose up to use the default compose file.

The image includes the index file built from ./web/index.html. The index file is stored outside of the root folder to allow mounting a volume for persistent storage.

The docker image uses these arguments:

Option Value
port 80
index /app/files/index.html
root /app/files/root
block (none)
list true (default)
verbose false (default)
path / (default)

You can add your own index file by mounting to /app/files/index.html or by giving a different "command" to docker.

Also see ./examples/docker-compose.yml for an example of a setup behind a reverse proxy.

Usage

# upload
curl -F file=@myfile.txt’ filestation.local
# list
curl filestation.local/list
# download
curl filestation.local/myfile.txt
# delete
curl -X DELETE filestation.local/myfile.txt

Upload files by sending a POST request which contains a "file" property with the file. Download a file by seding a GET request to the filpath. Delete a file by sending a DELETE request to the filepath.

Web UI

The project in ./web is a minimal index file which is also used in the docker container. The page uses the fetch api to allow uploading, deleting and downloading files (the last two only if the list option is enabled).