Skip to content

Commit

Permalink
First version of aria2 addon
Browse files Browse the repository at this point in the history
  • Loading branch information
bestlibre committed Mar 28, 2018
1 parent d073dae commit b82e45a
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
26 changes: 26 additions & 0 deletions aria2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
ARG BUILD_FROM
FROM $BUILD_FROM

ARG BUILD_VERSION
ARG BUILD_ARCH

# Add env
ENV LANG C.UTF-8

# Setup base
RUN apk add --no-cache -U --virtual .build-deps \
git \
&& apk add --no-cache -U aria2 darkhttpd \
&& git clone https://github.com/ziahamza/webui-aria2.git /webui-aria2 \
&& rm -rf /webui-aria2/.git \
&& rm -rf /webui-aria2/screenshots \
&& rm -rf /webui-aria2/*.md \
&& rm -rf /webui-aria2/Dockerfile* \
&& rm -rf /webui-aria2/node-server.js \
&& apk del .build-deps

COPY run.sh /

RUN chmod a+x /run.sh

CMD [ "/run.sh" ]
10 changes: 10 additions & 0 deletions aria2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# aria2 with webui for hass.io
[![Build Status](https://travis-ci.org/bestlibre/hassio-addons.svg?branch=master)](https://travis-ci.org/bestlibre/hassio-addons)[![](https://images.microbadger.com/badges/version/bestlibre/armhf-aria2.svg)](https://microbadger.com/images/bestlibre/armhf-aria2 "Get your own version badge on microbadger.com")

## Description

This addon provide an [aria2](https://aria2.github.io/) with the [webui-aria2](https://github.com/ziahamza/webui-aria2) frontend container for hass.io.


## Configuration
To be completed
15 changes: 15 additions & 0 deletions aria2/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "Aria2",
"version": "0.1",
"slug": "aria2",
"description": "Aria2 download manager",
"url": "https://github.com/bestlibre/hassio-addons/tree/master/aria2",
"startup": "system",
"boot": "auto",
"image": "bestlibre/{arch}-aria2",
"options": {},
"schema": {},
"ports": {"6800/tcp": null, "8080/tcp": null},
"map": ["share:rw"],
"webui": "http://[HOST]:[PORT:8080]"
}
10 changes: 10 additions & 0 deletions aria2/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e
secret=$(jq -r '.secret // "123456789"' /data/options.json)
downloads=$(jq -r '.downloads // "/share/aria2/"' /data/options.json)
options=$(jq -r 'if .options then [.options[] | "--"+.name+"="+.value ] | join(" ") else "" end' /data/options.json)
session_file=/data/aria.session.gz

darkhttpd /webui-aria2 --port 8080 &

aria2c --enable-rpc --rpc-secret=${secret} --rpc-listen-all --save-session=${session_file} --input-file=${session_file} --save-session-interval=30 --dir=${downloads} ${options}

0 comments on commit b82e45a

Please sign in to comment.