1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-28 17:51:24 +00:00
dockerfiles/aria2/README.md

127 lines
2.8 KiB
Markdown
Raw Normal View History

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