1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-25 16:28:40 +00:00
This commit is contained in:
kev 2015-07-03 21:22:03 +08:00
parent 8c86b8c344
commit 2ede98d9ea
2 changed files with 48 additions and 6 deletions

@ -1,10 +1,22 @@
`aria2` is a utility for downloading files.
aria2
=====
- `aria2` is a utility for downloading files.
- `yaaw` is yet another aria2 web frontend.
## directory tree
```
~/fig/aria2/
├── docker-compose.yml
├── html/
│ ├── README.md
│ ├── TODO.md
│ ├── css/...
│ ├── img/...
│ ├── index.html
│ ├── js/...
│ └── offline.appcache
├── data/
└── keys/
├── server.crt
@ -24,15 +36,24 @@ aria2:
environment:
- TOKEN=e6c3778f-6361-4ed0-b126-f2cf8fca06db
restart: always
yaaw:
image: vimagick/nginx
ports:
- "8080:80"
volumes:
- html:/usr/share/nginx/html
restart: always
```
## server
```
$ mkdir -p ~/fig/aria2/{data,keys}/
$ mkdir -p ~/fig/aria2/{html,data,keys}/
$ cd ~/fig/aria2/
$ vim docker-compose.yml
$ curl -sSL https://github.com/binux/yaaw/archive/master.tar.gz | tar xz --strip 1 -C html
$ openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout keys/server.key -out keys/server.crt
$ vim docker-compose.yml
$ fig up -d
```
@ -45,12 +66,12 @@ $ update-ca-certificates --fresh
$ uuidgen
3c5323b8-79f7-49d4-8303-fcfe51488db5
$ http --verify no https://datageek.info:6800/jsonrpc \
$ http --verify no https://server:6800/jsonrpc \
id=3c5323b8-79f7-49d4-8303-fcfe51488db5 \
method=aria2.getGlobalStat \
params:='["token:e6c3778f-6361-4ed0-b126-f2cf8fca06db"]'
$ curl https://datageek.info:6800/jsonrpc --data '
$ curl https://server:6800/jsonrpc --data '
{
"id": "3c5323b8-79f7-49d4-8303-fcfe51488db5",
"method": "aria2.getGlobalStat",
@ -69,7 +90,10 @@ $ curl https://datageek.info:6800/jsonrpc --data '
"uploadSpeed": "0"
}
}
$ firefox http://server:8080/
```
> Please choose `CommonName` properly when generating keys.
> `httpie` will throw error without `--verify no` option, I don't know why!
> `httpie` will throw error without `--verify no` option, I don't know why!
> Open `https://server:6800` in your browser, and accept security certificate.

18
aria2/docker-compose.yml Normal file

@ -0,0 +1,18 @@
aria2:
image: vimagick/aria2
ports:
- "6800:6800"
volumes:
- "data:/home/aria2"
- "keys:/etc/aria2"
environment:
- TOKEN=e6c3778f-6361-4ed0-b126-f2cf8fca06db
restart: always
yaaw:
image: vimagick/nginx
ports:
- "8080:80"
volumes:
- html:/usr/share/nginx/html
restart: always