1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-12-23 01:39:27 +02:00
dockerfiles/aria2/README.md

127 lines
2.8 KiB
Markdown
Raw Normal View History

2015-07-03 15:22:03 +02:00
aria2
=====
2016-03-05 15:42:38 +02:00
![](https://badge.imagelayers.io/vimagick/aria2:latest.svg)
2021-09-06 12:38:42 +02:00
- [aria2][1] is a utility for downloading files.
- [yaaw][2] is yet another aria2 web frontend.
- [AriaNg][3] is a modern web frontend making aria2 easier to use.
2015-06-10 17:41:53 +02:00
2015-06-10 18:19:01 +02:00
## directory tree
```
~/fig/aria2/
├── docker-compose.yml
2021-09-06 06:01:13 +02:00
└── data/
├── disk/ -> /mnt/usb/
2021-09-06 12:38:42 +02:00
├── default.conf
2021-09-06 06:01:13 +02:00
└── aria2.conf
2015-06-10 18:19:01 +02:00
```
2021-09-06 06:01:13 +02:00
> You may make `disk` a symbolic link to `/mnt/usb` or somewhere else.
2021-09-06 12:38:42 +02:00
> To implement disk quota, you can even create a [virtual disk][5].
2015-07-05 06:32:56 +02:00
2015-06-10 17:41:53 +02:00
## docker-compose.yml
2020-08-14 12:41:35 +02:00
```yaml
version: "3.8"
services:
aria2:
image: vimagick/aria2
ports:
- "6800:6800"
volumes:
2021-09-06 12:38:42 +02:00
- ./data/aria2.conf:/etc/aria2/aria2.conf
- ./data/disk:/data
2020-08-14 12:41:35 +02:00
environment:
- TOKEN=e6c3778f-6361-4ed0-b126-f2cf8fca06db
restart: unless-stopped
2021-09-06 12:38:42 +02:00
webui:
2021-09-07 05:26:11 +02:00
image: vimagick/ariang
2020-08-14 12:41:35 +02:00
ports:
- "8080:80"
restart: unless-stopped
2015-06-10 17:41:53 +02:00
```
2015-08-04 15:32:50 +02:00
## aria2.conf
2020-08-14 12:41:35 +02:00
```ini
2021-09-06 12:38:42 +02:00
dir=/data
2015-08-04 15:32:50 +02:00
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
```
2015-06-10 19:02:57 +02:00
## server
2015-06-10 17:41:53 +02:00
2020-08-14 12:41:35 +02:00
```bash
2021-09-06 12:38:42 +02:00
$ mkdir -p ~/fig/aria2/data/html
2021-09-06 06:01:13 +02:00
$ cd ~/fig/aria2/data
$ ln -s /mnt/usb disk
2021-09-06 12:38:42 +02:00
$ 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.2/AriaNg-1.2.2.zip #
# unzip AriaNg-1.2.2.zip #
####################################################################################
2015-07-03 15:22:03 +02:00
$ vim docker-compose.yml
2021-09-06 12:38:42 +02:00
$ docker-compose up -d
2015-06-10 19:02:57 +02:00
```
## client
2020-08-14 12:41:35 +02:00
```bash
2015-06-10 19:02:57 +02:00
$ uuidgen
3c5323b8-79f7-49d4-8303-fcfe51488db5
2021-09-06 12:38:42 +02:00
$ http http://server:6800/jsonrpc \
2015-06-10 19:02:57 +02:00
id=3c5323b8-79f7-49d4-8303-fcfe51488db5 \
2015-06-10 17:41:53 +02:00
method=aria2.getGlobalStat \
params:='["token:e6c3778f-6361-4ed0-b126-f2cf8fca06db"]'
2021-09-06 12:38:42 +02:00
$ curl http://server:6800/jsonrpc --data '
2015-06-10 19:02:57 +02:00
{
"id": "3c5323b8-79f7-49d4-8303-fcfe51488db5",
"method": "aria2.getGlobalStat",
"params": ["token:e6c3778f-6361-4ed0-b126-f2cf8fca06db"]
}' | jq .
2015-06-10 17:41:53 +02:00
{
2015-06-10 19:02:57 +02:00
"id": "3c5323b8-79f7-49d4-8303-fcfe51488db5",
"jsonrpc": "2.0",
"result": {
"downloadSpeed": "0",
"numActive": "0",
"numStopped": "0",
"numStoppedTotal": "0",
"numWaiting": "0",
"uploadSpeed": "0"
}
2015-06-10 17:41:53 +02:00
}
2015-07-03 15:22:03 +02:00
$ firefox http://server:8080/
2015-07-04 18:02:15 +02:00
#
# Settings » JSON-RPC Path:
2021-09-06 12:38:42 +02:00
# ws://token:e6c3778f-6361-4ed0-b126-f2cf8fca06db@server:6800/jsonrpc
2015-07-04 18:02:15 +02:00
#
# Firefox » Top-Right Corner:
# Aria2 1.18.10
# ↓0 KB/s / ↑0 KB/s
#
2015-06-10 17:41:53 +02:00
```
2015-06-10 19:02:57 +02:00
2021-09-06 12:38:42 +02:00
[1]: https://github.com/aria2/aria2
[2]: https://github.com/binux/yaaw
[3]: https://github.com/mayswind/AriaNg
[5]: http://souptonuts.sourceforge.net/quota_tutorial.html