2015-07-03 15:22:03 +02:00
|
|
|
aria2
|
|
|
|
=====
|
|
|
|
|
|
|
|
- `aria2` is a utility for downloading files.
|
|
|
|
- `yaaw` is yet another aria2 web frontend.
|
2015-06-10 17:41:53 +02:00
|
|
|
|
2015-06-10 18:19:01 +02:00
|
|
|
## directory tree
|
|
|
|
|
|
|
|
```
|
|
|
|
~/fig/aria2/
|
|
|
|
├── docker-compose.yml
|
2015-07-03 15:22:03 +02:00
|
|
|
├── html/
|
|
|
|
│ ├── README.md
|
|
|
|
│ ├── TODO.md
|
|
|
|
│ ├── css/...
|
|
|
|
│ ├── img/...
|
|
|
|
│ ├── index.html
|
|
|
|
│ ├── js/...
|
|
|
|
│ └── offline.appcache
|
2015-07-05 06:32:56 +02:00
|
|
|
├── data -> /home/aria2/
|
2015-06-10 18:19:01 +02:00
|
|
|
└── keys/
|
|
|
|
├── server.crt
|
|
|
|
└── server.key
|
|
|
|
```
|
|
|
|
|
2015-07-05 07:13:42 +02:00
|
|
|
> You may make `data` a symbolic link to `/home/aria2` or somewhere else.
|
|
|
|
> To implement disk quota, you can even create a [virtual disk][1].
|
2015-07-05 06:32:56 +02:00
|
|
|
|
2015-06-10 17:41:53 +02:00
|
|
|
## docker-compose.yml
|
|
|
|
|
|
|
|
```
|
|
|
|
aria2:
|
|
|
|
image: vimagick/aria2
|
|
|
|
ports:
|
|
|
|
- "6800:6800"
|
|
|
|
volumes:
|
2015-06-11 12:23:58 +02:00
|
|
|
- "data:/home/aria2"
|
2015-06-10 17:41:53 +02:00
|
|
|
- "keys:/etc/aria2"
|
|
|
|
environment:
|
|
|
|
- TOKEN=e6c3778f-6361-4ed0-b126-f2cf8fca06db
|
|
|
|
restart: always
|
2015-07-03 15:22:03 +02:00
|
|
|
|
|
|
|
yaaw:
|
|
|
|
image: vimagick/nginx
|
|
|
|
ports:
|
|
|
|
- "8080:80"
|
|
|
|
volumes:
|
|
|
|
- html:/usr/share/nginx/html
|
|
|
|
restart: always
|
2015-06-10 17:41:53 +02:00
|
|
|
```
|
|
|
|
|
2015-06-10 19:02:57 +02:00
|
|
|
## server
|
2015-06-10 17:41:53 +02:00
|
|
|
|
|
|
|
```
|
2015-07-05 06:32:56 +02:00
|
|
|
$ mkdir -p ~/fig/aria2/{html,keys}/
|
2015-06-10 19:02:57 +02:00
|
|
|
$ cd ~/fig/aria2/
|
2015-07-05 06:32:56 +02:00
|
|
|
$ ln -s /home/aria2 data
|
2015-07-03 15:22:03 +02:00
|
|
|
$ curl -sSL https://github.com/binux/yaaw/archive/master.tar.gz | tar xz --strip 1 -C html
|
2015-06-10 19:02:57 +02:00
|
|
|
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout keys/server.key -out keys/server.crt
|
2015-07-03 15:22:03 +02:00
|
|
|
$ vim docker-compose.yml
|
2015-06-10 19:02:57 +02:00
|
|
|
$ fig up -d
|
|
|
|
```
|
|
|
|
|
|
|
|
## client
|
|
|
|
|
|
|
|
```
|
2015-06-11 12:23:58 +02:00
|
|
|
$ scp server:fig/aria2/keys/server.crt /usr/local/share/ca-certificates/
|
|
|
|
$ update-ca-certificates --fresh
|
|
|
|
|
2015-06-10 19:02:57 +02:00
|
|
|
$ uuidgen
|
|
|
|
3c5323b8-79f7-49d4-8303-fcfe51488db5
|
|
|
|
|
2015-07-03 15:22:03 +02:00
|
|
|
$ http --verify no https://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"]'
|
|
|
|
|
2015-07-03 15:22:03 +02:00
|
|
|
$ curl https://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:
|
|
|
|
# wss://token:e6c3778f-6361-4ed0-b126-f2cf8fca06db@server:6800/jsonrpc
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
|
|
|
> Please choose `CommonName` properly when generating keys.
|
2015-07-03 15:22:03 +02:00
|
|
|
> `httpie` will throw error without `--verify no` option, I don't know why!
|
|
|
|
> Open `https://server:6800` in your browser, and accept security certificate.
|
2015-07-03 15:26:30 +02:00
|
|
|
|
2015-07-05 07:13:42 +02:00
|
|
|
[1]: http://souptonuts.sourceforge.net/quota_tutorial.html
|