file download agent server written in golang.
- Download file from url
- Download file from local file
- Serve WebDAV server
go build -o fda .
chmod +x fda
Argument | Env | Description | Default |
---|---|---|---|
-host | FDA_HOST | Server host | 0.0.0.0 |
-port | FDA_PORT | Server port | 18080 |
-sign-key | FDA_SIGN_KEY | Sign key for server | - |
-dir | FDA_DIR | Download file dir | ./files |
-webdav-dir | FDA_WEBDAV_DIR | WebDAV root dir | same as dir |
-webdav-user | FDA_WEBDAV_USER | WebDAV username | anonymous |
-webdav-pass | FDA_WEBDAV_PASS | WebDAV password | md5(sign_key) |
-log-level | FDA_LOG_LEVEL | Log level: debug, info, warn, error | info |
-help, -h | - | Show help | - |
-version | - | Show version | - |
args has higher priority than env
- Show usage
./fda -h
- Args
./fda -host=127.0.0.1 -port=18080 -sign-key=<your_sign_key> -dir=./files
- Env
export FDA_HOST=127.0.0.1
export FDA_PORT=18080
export FDA_SIGN_KEY=<your_sign_key>
export FDA_DIR=./files
./fda
- Proxy
export HTTP_PROXY=http://<your_proxy_host>:<your_proxy_port>
export HTTPS_PROXY=http://<your_proxy_host>:<your_proxy_port>
./fda
- Use Task
task run
docker run -d --name file-download-agent -p 18080:18080 -e FDA_PORT=18080 junlongzzz/file-download-agent
services:
file-download-agent:
image: junlongzzz/file-download-agent
container_name: file-download-agent
restart: always
ports:
- 18080:18080
volumes:
- ./files:/app/files
environment:
- FDA_PORT=18080
- FDA_SIGN_KEY=<your_sign_key>
http://localhost:18080
http://localhost:18080/download
http://localhost:18080/webdav/