1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-21 17:56:53 +02:00
dockerfiles/aria2
2022-08-08 17:56:44 +08:00
..
data/etc update aria2 2022-08-08 17:56:44 +08:00
aria2.service add aria2.service 2016-03-19 06:14:20 +08:00
docker-compose.yml update aria2 2022-08-08 17:56:44 +08:00
Dockerfile update aria2 2022-08-08 17:56:44 +08:00
nginx.conf update aria2 2021-09-06 18:38:42 +08:00
playbook.yml update playbook 2016-04-07 08:14:41 +08:00
README.md update aria2 2022-08-08 17:56:44 +08:00

aria2

  • aria2 is a utility for downloading files.
  • yaaw is yet another aria2 web frontend.
  • AriaNg is a modern web frontend making aria2 easier to use.

directory tree

~/fig/aria2/
├── docker-compose.yml
└── data/
    ├── var/ -> /mnt/usb/
    └── etc/
        ├── default.conf
        └── aria2.conf

You may make var a symbolic link to /mnt/usb or somewhere else. To implement disk quota, you can even create a virtual disk.

docker-compose.yml

version: "3.8"

services:

  aria2:
    image: vimagick/aria2
    ports:
      - "6800:6800"
    volumes:
      - ./data/etc:/etc/aria2/
      - ./data/var:/data
    environment:
      - TOKEN=0d5e0e73-96f7-4936-b125-e8f5f2296b08
    restart: unless-stopped

  webui:
    image: vimagick/ariang
    ports:
      - "8080:80"
    restart: unless-stopped

aria2.conf

dir=/data
disable-ipv6=true
enable-rpc=true
max-download-limit=0
max-upload-limit=0
rpc-allow-origin-all=true
rpc-listen-all=true
rpc-listen-port=6800
rpc-secret=00000000-0000-0000-0000-000000000000
seed-ratio=0
seed-time=0

server

$ mkdir -p ~/fig/aria2/data/html
$ cd ~/fig/aria2/data
$ ln -s /mnt/usb disk
$ cd html
$ curl -sSL https://github.com/binux/yaaw/archive/master.tar.gz | tar xz --strip 1
####################################################################################
# wget https://github.com/mayswind/AriaNg/releases/download/1.2.4/AriaNg-1.2.4.zip #
# unzip AriaNg-1.2.4.zip                                                           #
####################################################################################
$ vim docker-compose.yml
$ docker-compose up -d

client

$ uuidgen
3c5323b8-79f7-49d4-8303-fcfe51488db5

$ http http://server:6800/jsonrpc \
       id=3c5323b8-79f7-49d4-8303-fcfe51488db5 \
       method=aria2.getGlobalStat \
       params:='["token:e6c3778f-6361-4ed0-b126-f2cf8fca06db"]'

$ curl http://server:6800/jsonrpc --data '
       {
         "id": "3c5323b8-79f7-49d4-8303-fcfe51488db5",
         "method": "aria2.getGlobalStat",
         "params": ["token:e6c3778f-6361-4ed0-b126-f2cf8fca06db"]
       }' | jq .

{
  "id": "3c5323b8-79f7-49d4-8303-fcfe51488db5",
  "jsonrpc": "2.0",
  "result": {
    "downloadSpeed": "0",
    "numActive": "0",
    "numStopped": "0",
    "numStoppedTotal": "0",
    "numWaiting": "0",
    "uploadSpeed": "0"
  }
}

$ firefox http://server:8080/
#
# Settings » JSON-RPC Path:
#   ws://token:e6c3778f-6361-4ed0-b126-f2cf8fca06db@server:6800/jsonrpc
#
# Firefox » Top-Right Corner:
#   Aria2 1.18.10
#   ↓0 KB/s / ↑0 KB/s
#