Skip to content

deadc0de6/uad

Repository files navigation

Tests Status License: GPL v3

Donate

uad

uad (upload and download) is a very tiny web server allowing to upload and download files.

Usage

Very tiny web server allowing to upload and download files.

Usage:
  uad [flags] <path>...

Flags:
  -d, --debug               Debug mode
  -P, --from-parent         Paths get their names from parent dir
  -h, --help                help for uad
  -A, --host string         Host to listen to
  -m, --max-upload string   Max upload size (default "1G")
  -D, --no-downloads        Disable downloads
  -U, --no-uploads          Disable uploads
  -p, --port int            Port to listen to (default 6969)
  -s, --serve-subs          Serve all directories found in <path>
  -H, --show-hidden         Show hidden files
  -v, --version             version for uad

Every cli switch can be set using environment variable with UAD_ prefix. For example setting --show-hidden would need export UAD_SHOW_HIDDEN=true.

Install

Quick start:

## You need at least golang 1.16
$ go install -v github.com/deadc0de6/uad@latest
$ uad

Or pick a release from the release page and install it in your $PATH

Or use the docker image availabe on dockerhub

$ docker run -d --name uad -p 6969:6969 -v /tmp/uad-files:/files deadc0de6/uad

Or compile it from source

Compile from source

$ go mod tidy
$ make
$ ./uad --help

Reverse proxy

nginx for a sub domain

location / {
  client_max_body_size 1G;
  proxy_pass       http://127.0.0.1:6969/;
}

nginx for a subpath at /uad/ for example

location /uad/ {
  client_max_body_size 1G;
  proxy_pass       http://127.0.0.1:6969/;
}

If you specified a different --max-upload than the default (1G), you need to adapt the client_max_body_size.

Contribution

If you are having trouble using uad, open an issue.

If you want to contribute, feel free to do a PR.

License

This project is licensed under the terms of the GPLv3 license.