Skip to content

junlongzzz/file-download-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File Download Agent

file download agent server written in golang.

Features

  • Download file from url
  • Download file from local file
  • Serve WebDAV server

Build

go build -o fda .
chmod +x fda

Args and Env

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

Run

  • 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
task run

Docker

docker run -d --name file-download-agent -p 18080:18080 -e FDA_PORT=18080 junlongzzz/file-download-agent

Docker Compose

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>

Usage

http://localhost:18080
http://localhost:18080/download
http://localhost:18080/webdav/