This commit is contained in:
commit
e842cbafe1
13
.drone.yml
Normal file
13
.drone.yml
Normal file
|
@ -0,0 +1,13 @@
|
|||
kind: pipeline
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: docker
|
||||
image: plugins/docker
|
||||
settings:
|
||||
registry: r.sbruder.de
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
repo: r.sbruder.de/aria2
|
25
Dockerfile
Normal file
25
Dockerfile
Normal file
|
@ -0,0 +1,25 @@
|
|||
FROM node as webui
|
||||
|
||||
RUN git clone --depth=1 https://github.com/ziahamza/webui-aria2
|
||||
|
||||
WORKDIR /webui-aria2
|
||||
|
||||
RUN npm install
|
||||
COPY configuration.js /webui-aria2/src/js/services/configuration.js
|
||||
RUN npm run-script build
|
||||
|
||||
FROM alpine
|
||||
|
||||
RUN apk add --no-cache \
|
||||
aria2 \
|
||||
nginx \
|
||||
su-exec
|
||||
|
||||
COPY --from=webui /webui-aria2/docs /srv/www/webui
|
||||
|
||||
COPY --from=nginx:alpine /etc/nginx/nginx.conf /etc/nginx/nginx.conf
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
37
configuration.js
Normal file
37
configuration.js
Normal file
|
@ -0,0 +1,37 @@
|
|||
import angular from "angular";
|
||||
|
||||
export default angular
|
||||
.module("webui.services.configuration", [])
|
||||
.constant("$name", "Aria2 WebUI")
|
||||
.constant("$titlePattern", "active: {active} - waiting: {waiting} - stopped: {stopped} — {name}")
|
||||
.constant("$pageSize", 11)
|
||||
.constant("$authconf", {
|
||||
host: location.hostname,
|
||||
path: "/jsonrpc",
|
||||
port: location.protocol === 'https:' ? 443 : 80,
|
||||
encrypt: location.protocol === 'https:',
|
||||
directURL: "/download/"
|
||||
})
|
||||
.constant("$enable", {
|
||||
torrent: true,
|
||||
metalink: true,
|
||||
sidebar: {
|
||||
show: true,
|
||||
stats: true,
|
||||
filters: true,
|
||||
starredProps: true
|
||||
}
|
||||
})
|
||||
.constant("$starredProps", [
|
||||
"max-overall-download-limit",
|
||||
"max-overall-upload-limit"
|
||||
])
|
||||
.constant("$downloadProps", [
|
||||
"header",
|
||||
"http-user",
|
||||
"http-passwd",
|
||||
"pause",
|
||||
"dir",
|
||||
"max-connection-per-server"
|
||||
])
|
||||
.constant("$globalTimeout", 1000).name;
|
16
entrypoint.sh
Executable file
16
entrypoint.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/ash
|
||||
nginx
|
||||
|
||||
touch /data/torrents
|
||||
chown $UID /data/torrents
|
||||
|
||||
su-exec $UID aria2c \
|
||||
--enable-rpc \
|
||||
--bt-save-metadata \
|
||||
--bt-load-saved-metadata \
|
||||
--force-save \
|
||||
--summary-interval=0 \
|
||||
--seed-ratio=0 \
|
||||
--dir /data/ \
|
||||
--save-session /data/torrents \
|
||||
-i /data/torrents
|
22
nginx.conf
Normal file
22
nginx.conf
Normal file
|
@ -0,0 +1,22 @@
|
|||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
root /srv/www/webui/;
|
||||
|
||||
location / {
|
||||
index index.html;
|
||||
}
|
||||
|
||||
location /download/ {
|
||||
alias /data/;
|
||||
autoindex on;
|
||||
}
|
||||
|
||||
location /jsonrpc {
|
||||
proxy_pass http://localhost:6800/jsonrpc;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
}
|
||||
}
|
Reference in a new issue