Compare commits

..
19 Commits
Author SHA1 Message Date
junv 6195370246 fix app.conf 2019-10-11 15:22:14 +11:00
junvandGitHub 8802857b70 Merge pull request #63 from wahyd4/junwei/new-nextcloud
Build aria2 ui docker image to integrate with nextcloud
2019-10-11 14:51:20 +11:00
junv e8e3ef9e1e Build aria2 ui docker image to integrate with nextcloud 2019-10-11 14:44:16 +11:00
junv 1ba4a05cd7 Merge branch 'master' into nextcloud 2019-10-11 14:22:08 +11:00
junv c405b58610 A URL path improvment to solve https://github.com/wahyd4/aria2-ariang-x-docker-compose/issues/65 2019-05-22 16:16:14 +10:00
junvandGitHub 13be30c82f Update aria2.conf 2019-02-01 11:58:19 +11:00
junv 0b82cbbbf5 Update config align with new official nextcloud docker image 2019-01-18 14:03:19 +11:00
junv f273910ac8 Correct file name 2018-12-15 18:24:22 +11:00
junv d7e435d784 bump ariang to 1.0.0 2018-12-15 17:33:06 +11:00
junv 2d04e95161 Back to use wonderfall/nextcloud , as the official one needs to downloads at starting phase which makes this Image is super slow in China. 2018-08-16 21:00:05 +10:00
junv 7b67d12646 Update ariaNg to 0.40 2018-07-11 22:24:47 +10:00
junv 84ba3370bc Update caddy file to match the default nextcloud docker image, also solve the older nextcloud docker image cannot delete external storage files 2018-07-11 22:23:59 +10:00
junv 4f5b6f2b53 Conflicts:
caddy/Dockerfile
2018-01-21 23:16:09 +11:00
junv e5a9bcf7a9 Update AriaNg to 0.3 release. 2017-12-16 16:10:51 +11:00
junv dcaeec3633 Add bt-tracker servers. 2017-09-18 17:59:38 +08:00
junv 01b446b5bb Add ability to store and retore unfinished tasks. 2017-09-17 10:57:40 +08:00
junv 9c9a36150e Update config for nextcloud 2017-09-06 11:01:38 +08:00
junv 3de5fe6746 Update config for nextcloud. 2017-09-04 11:36:48 +08:00
junv 2f6c18d1e6 update config for filerun. 2017-09-04 11:18:49 +08:00
27 changed files with 198 additions and 607 deletions
+3
View File
@@ -0,0 +1,3 @@
README*.md
LICENSE
.github
-12
View File
@@ -1,12 +0,0 @@
# These are supported funding model platforms
github: [wahyd4]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: https://www.paypal.me/junvzhao
-17
View File
@@ -1,17 +0,0 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 30
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: "Closed due to no further updates have been provided."
+6 -94
View File
@@ -1,102 +1,14 @@
name: Build and Push docker image
on:
pull_request:
branches: master
push:
branches:
- '*'
tags:
- v*
name: Docker Image CI
on: [push]
jobs:
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'wahyd4/aria2-ariang-docker'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
-
name: Update APP VERSION
if: contains(github.ref, '/tags/v')
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo $VERSION > APP_VERSION
-
name: Prepare
id: prepare
run: |
DOCKER_IMAGE=wahyd4/aria2-ui
DOCKER_PLATFORMS=linux/amd64,linux/arm/v7,linux/arm64
VERSION=edge
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
fi
TAGS="--tag ${DOCKER_IMAGE}:${VERSION}"
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
TAGS="$TAGS --tag ${DOCKER_IMAGE}:latest"
fi
echo ::set-output name=docker_image::${DOCKER_IMAGE}
echo ::set-output name=version::${VERSION}
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} \
--build-arg VERSION=${VERSION} \
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
--build-arg VCS_REF=${GITHUB_SHA::8} \
${TAGS} --file Dockerfile .
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Cache Docker layers
uses: actions/cache@v2
id: cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
-
name: Docker Buildx (build)
run: |
docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args }}
-
name: Login to DockerHub
if: contains(github.ref, '/heads/master') || contains(github.ref, '/tags/v')
uses: docker/login-action@v1
- name: Build and Publish main docker image to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: wahyd4/aria2-ui
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASS }}
-
name: Push docker images to Dockerhub
if: contains(github.ref, '/heads/master') || contains(github.ref, '/tags/v')
run: |
docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }}
-
name: Inspect image
if: contains(github.ref, '/heads/master') || contains(github.ref, '/tags/v')
run: |
docker buildx imagetools inspect ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}
-
name: Commit changes
if: contains(github.ref, '/tags/v')
uses: EndBug/add-and-commit@v7
with:
author_name: junv-repo-bot
author_email: me@toozhao.com
message: 'Update version'
add: 'APP_VERSION'
push: true
branch: master
-
name: Update tag
if: contains(github.ref, '/tags/v')
env:
API_KEY: ${{ secrets.BadgeAPIKey }}
run: |
VERSION=${GITHUB_REF#refs/tags/v}
curl --max-time 6 -XPUT -D- 'https://badges.toozhao.com/val/aria2-ui-docker' \
-H 'Content-Type: application/json' \
-H 'API_KEY': ${API_KEY} \
-d '{"value": "'${VERSION}'"}' || true
snapshot: true
-23
View File
@@ -1,23 +0,0 @@
name: Docker Image Vulnability Check
on:
pull_request:
branches: master
push:
branches:
- '*'
jobs:
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'wahyd4/aria2-ariang-docker'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build the Docker image
run: docker build . --file Dockerfile --tag local/aria-ui:latest
- name: Scan image
uses: anchore/scan-action@v2
with:
image: "local/aria-ui:latest"
fail-build: true
severity-cutoff: high
- name: grype scan JSON results
run: for j in `ls ./anchore-reports/*.json`; do echo "---- ${j} ----"; cat ${j}; echo; done
-2
View File
@@ -1,2 +0,0 @@
conf/rclone.conf
.devcontainer
-1
View File
@@ -1 +0,0 @@
4.13.1
+19 -27
View File
@@ -1,34 +1,26 @@
#{
# auto_https off
#}
{$DOMAIN} {
proxy / file-manager {
transparent
}
{$DOMAIN}
proxy /jsonrpc localhost:6800 {
transparent
websocket
}
redir /ui / 301
redir /ui/ / 301
redir /rclone /rclone/ 301
redir /files /files/ 301
reverse_proxy /jsonrpc 127.0.0.1:6800
route /rclone/* {
uri strip_prefix /rclone
reverse_proxy 127.0.0.1:5572
log stdout
errors stdout
gzip
}
route /files/* {
uri strip_prefix /files
reverse_proxy 127.0.0.1:8080
{$DOMAIN}/ui {
redir / /ui/ 301
}
route /ping {
respond "app version: {env.APP_VERSION}"
}
root * /usr/local/www/aria2
file_server
encode gzip
log {
output stderr
{$DOMAIN}/ui/ {
root /usr/local/www/aria2
timeouts none
gzip
log stdout
errors stdout
}
+24 -32
View File
@@ -1,16 +1,3 @@
FROM golang:alpine AS build-forego
RUN apk add --no-cache git openssh
WORKDIR /app
RUN git clone https://github.com/wahyd4/forego.git \
&& cd forego \
&& git checkout fix-go-mod \
&& go mod download \
&& go build -o forego \
&& chmod +x forego
FROM alpine:edge
LABEL AUTHOR=Junv<wahyd4@gmail.com>
@@ -19,30 +6,38 @@ WORKDIR /app
ENV RPC_SECRET=""
ENV ENABLE_AUTH=false
ENV ENABLE_RCLONE=true
ENV DOMAIN=:80
ENV DOMAIN=0.0.0.0:80
ENV ARIA2_USER=user
ENV ARIA2_PWD=password
ENV ARIA2_SSL=false
ENV ARIA2_EXTERNAL_PORT=80
ENV PUID=1000
ENV PGID=1000
ENV CADDYPATH=/app
ENV RCLONE_CONFIG=/app/conf/rclone.conf
ENV XDG_DATA_HOME=/app/.caddy/data
ENV XDG_CONFIG_HOME=/app/.caddy/config
ENV RCLONE_CONFIG_BASE64=""
ENV ENABLE_APP_CHECKER=true
ADD install.sh aria2c.sh caddy.sh Procfile init.sh start.sh rclone.sh new-version-checker.sh APP_VERSION /app/
RUN adduser -D -u 1000 junv \
&& apk update \
&& apk add runit shadow wget bash curl openrc gnupg aria2 tar --no-cache \
&& curl https://getcaddy.com | bash -s personal \
&& platform=linux-amd64 \
&& wget -N https://bin.equinox.io/c/ekMN3bCZFUn/forego-stable-${platform}.tgz \
&& tar -zxvf forego-stable-${platform}.tgz \
&& rm -rf forego-stable-${platform}.tgz \
&& mkdir -p /usr/local/www \
&& mkdir -p /usr/local/www/aria2
ADD aria2c.sh caddy.sh Procfile init.sh start.sh /app/
ADD conf /app/conf
ADD Caddyfile SecureCaddyfile HerokuCaddyfile /usr/local/caddy/
ADD Caddyfile SecureCaddyfile /usr/local/caddy/
COPY --from=build-forego /app/forego/forego /app
RUN ./install.sh
RUN rm ./install.sh
# AriaNg
RUN mkdir /usr/local/www/aria2/Download \
&& cd /usr/local/www/aria2 \
&& chmod +rw /app/conf/aria2.session \
&& version=1.1.1 \
&& wget -N --no-check-certificate https://github.com/mayswind/AriaNg/releases/download/${version}/AriaNg-${version}.zip \
&& unzip AriaNg-${version}.zip \
&& rm -rf AriaNg-${version}.zip \
&& chmod -R 755 /usr/local/www/aria2 \
&& sed -i 's/6800/80/g' /usr/local/www/aria2/js/aria-ng*.js
# folder for storing ssl keys
VOLUME /app/conf/key
@@ -52,7 +47,4 @@ VOLUME /data
EXPOSE 80 443
HEALTHCHECK --interval=30s --timeout=3s \
CMD curl -f http://localhost/ping || exit 1
CMD ["./start.sh"]
-39
View File
@@ -1,39 +0,0 @@
{
admin off
auto_https off
}
:PORT
basicauth / {
ARIA2_USER ARIA2_PWD_ENCRYPT
}
redir /ui / 301
redir /ui/ / 301
redir /rclone /rclone/ 301
redir /files /files/ 301
reverse_proxy /jsonrpc 127.0.0.1:6800
route /rclone/* {
uri strip_prefix /rclone
reverse_proxy 127.0.0.1:5572
}
route /files/* {
uri strip_prefix /files
reverse_proxy 127.0.0.1:8080
}
route /ping {
respond "app version: {env.APP_VERSION}"
}
root * /usr/local/www/aria2
file_server
encode gzip
log {
output stderr
}
-3
View File
@@ -1,5 +1,2 @@
caddy: /app/caddy.sh
filebrowser: /app/filebrowser -p 8080 -d /app/filebrowser.db -r /data -b /files
aria2c: /app/aria2c.sh
rclone: /app/rclone.sh
newer_version_checker: /app/new-version-checker.sh
+24 -41
View File
@@ -6,19 +6,13 @@ Aria2 + AriaNg
[![Docker Pulls](https://img.shields.io/docker/pulls/wahyd4/aria2-ui.svg)](https://hub.docker.com/r/wahyd4/aria2-ui/)
[![Github Build](https://github.com/wahyd4/aria2-ariang-docker/workflows/Docker%20Image%20CI/badge.svg)](https://github.com/wahyd4/aria2-ariang-docker/actions)
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/wahyd4/aria2-ariang-docker/tree/master)
[![Page Views Count](https://badges.toozhao.com/badges/01EJ791D8BB43PDS8D7PP7H0YE/green.svg)](https://badges.toozhao.com/stats/01EJ791D8BB43PDS8D7PP7H0YE "Get your own page views count badge on badges.toozhao.com")
<img src="https://raw.githubusercontent.com/wahyd4/work-in-australia/766592ac6318027d7b3c334d8c50ca80818eeff8/wepay.jpg" alt="buy me a drink" width="120"/>
本镜像包含 Aria2、AriaNg 和File Manager,主要方便那些用户期望只运行一个镜像就能实现图形化下载文件和在线播放文件。(类似离线下载的功能),只使用一个 Docker 镜像也方便用户在群晖NAS 中运行本程序。
- [功能特性](#功能特性)
- [推荐使用的docker image tag](#推荐使用的docker-image-tag)
- [安装运行](#安装运行)
- [安装运行](#安装运行)
- [快速运行](#快速运行)
- [开启所有功能](#开启所有功能)
- [使用docker-compose 运行](#使用docker-compose-运行)
@@ -38,33 +32,31 @@ File Browser
## 功能特性
* [Aria2](https://aria2.github.io) 文件下载工具(支持SSL )
* [AriaNg](https://github.com/mayswind/AriaNg) 通过 UI 来操作,下载文件
* [Rclone](https://rclone.org) 同步文件到云盘
* Aria2 (SSL 支持)
* AriaNg 通过 UI 来操作,下载文件
* 自动 HTTPS Let's Encrypt
* 支持绑定自定义用户ID,可以主机上的非`root`用户,也可以管理下载的文件
* Basic Auth 用户认证
* 文件管理和视频播放 ([FileBrowser](https://filebrowser.xyz/),注意默认情况下,只能访问和管理 `/data` 目录下的文件)
* 支持ARM CPU 架构,因此可以在树莓派等设备上运行,
* 文件管理和视频播放 ([File Browser](https://filebrowser.xyz/),注意默认情况下,只能访问和管理 `/data` 目录下的文件)
* 支持ARM CPU 架构,因此可以在树莓派中运行,请下载对应的[ARM TAG](https://cloud.docker.com/repository/docker/wahyd4/aria2-ui/tags) 版本, `arm32``arm64`
## 推荐使用的docker image tag
* wahyd4/aria2-ui:latest
* wahyd4/aria2-ui:arm32
* wahyd4/aria2-ui:arm64
> Docker会为你自动选择对应CPU平台的image. e.g. arm64v8 或者 x86_64 平台
## 安装与运行
## 安装于运行
### 快速运行
```bash
docker buildx build --platform linux/arm/v7,linux/arm64,linux/amd64 -t aria2-ui .
```shell
docker run -d --name aria2-ui -p 80:80 wahyd4/aria2-ui
```
* Aria2: <http://yourip>
* Filebrowser: <http://yourip/files>
* Rclone: <http://yourip/rclone>
* 请使用 admin/admin 进行登录Filebrowser, 在如果没有修改`ARIA2_USER`,`ARIA2_PWD`的情况下,请使用`user`/`password`登录`Rclone`
* Aria2: <http://yourip/ui/>
* FileManger: <http://yourip>
* 请使用 admin/admin 进行登录
### 开启所有功能
```bash
docker run -d --name ariang \
@@ -78,11 +70,10 @@ File Browser
-e ARIA2_SSL=false \
-e ARIA2_USER=user \
-e ARIA2_PWD=pwd \
-e ARIA2_EXTERNAL_PORT=443 \
-v /yourdata:/data \
-v /app/a.db:/app/filebrowser.db \
-v /yoursslkeys/:/app/conf/key \
-v <conf files folder>:/app/conf \
-v <the folder of aria2.conf and aria2.session>:/app/conf \
wahyd4/aria2-ui
```
### 使用docker-compose 运行
@@ -98,7 +89,7 @@ services:
- ENABLE_AUTH=true
- ARIA2_USER=hello
- ARIA2_PWD=world
- DOMAIN=http://toozhao.com
- DOMAIN=toozhao.com
volumes:
- ./data:/data
```
@@ -106,26 +97,19 @@ services:
### 支持的 Docker 环境变量
* `ENABLE_AUTH` 启用 Basic auth(网页简单认证) 用户认证
* `ENABLE_RCLONE` 是否启用 RCLONE,由于Rclone 的初次运行需要从Github 下载文件,由于你懂的原因,可能文件下载失败,进而导致整个程序崩溃,这时你需要设置为`false`
* `ARIA2_USER` Basic Auth 用户认证用户名,Rclone也使用该参数
* `ARIA2_PWD` Basic Auth 密码,Rclone也使用该参数
* `ARIA2_EXTERNAL_PORT` 从外部可以访问到的 Aria2 端口,默认为 HTTP 的`80`
* `PUID` 需要绑定主机的Linux用户ID,可以通过`cat /etc/passwd` 查看用户列表, 默认UID 是`1000`
* `PGID` 需要绑定的主机的Linux 用户组ID,默认GID 是`1000`
* `RPC_SECRET` Aria2 RPC 加密 token
* `DOMAIN` 绑定的域名, 当绑定的域名为`HTTPS`时,即为启用`HTTPS` 例: `DOMAIN=https://toozhao.com`
* `RCLONE_CONFIG_BASE64` 通过`base64` 字符串的形式配置rclone.conf。主要给在Heroku平台上运行时使用,请使用命令行 `cat /app/conf/rclone.conf | base64` 或者其他任何在线base64在线工具 [比如这个](https://www.base64encode.org/)来把`rclone.conf`的内容生成`base64`字符串。在使用本环境变量的同时,请确保`ENABLE_RCLONE`设置为`true`
* `ENABLE_APP_CHECKER`,默认情况下本程序会每天向远程服务器发送一次GET请求,以检查是否有新版本的镜像。该功能可以让你及时获取新功能和相关安全隐患的修复的推送提醒。你也可以选择将该环境变量设置为`false`来禁用该功能。注意该功能启用下,依然需要手动更新镜像来完成升级。
* ENABLE_AUTH 启用 Basic auth(网页简单认证) 用户认证
* ARIA2_USER Basic Auth 用户认证用户名
* ARIA2_PWD Basic Auth 密码
* PUID 需要绑定主机的Linux用户ID,可以通过`cat /etc/passwd` 查看用户列表, 默认UID 是`1000`
* PGID 需要绑定的主机的Linux 用户组ID,默认GID 是`1000`
* RPC_SECRET Aria2 RPC 加密 token
* DOMAIN 绑定的域名, 当绑定的域名为`HTTPS`时,即为启用`HTTPS` 例: `DOMAIN=https://toozhao.com`
### 支持的 Docker volume 属性
* `/data` 用来放置所有下载的文件的目录
* `/app/conf/key` 用户来放置 Aria2 SSL `certificate`证书和 `key` 文件. `注意`: 证书的名字必须是 `aria2.crt` Key 文件的名字必须是 `aria2.key`
* `/app/conf` 该目录下可以放置你的自定义`aria2.conf`配置文件,`aria2.session`,且必须包含这两个文件。第一次使用`aria2.session`时,创建一个空文件即可,该文件会包含aria2当前的下载列表,这样即使容器被销毁也不用担心文件列表丢失了。你也可以直接拷贝当前项目下`conf`目录中的两个文件并使用。如需映射rclone.conf到容器内,请将其就放置于该目录下。因此配置文件目录支持的所有配置文件为:
* aria2.conf
* aria2.session
* rclone.conf
* `/app/conf` 该目录下可以放置你的自定义`aria2.conf`配置文件,`aria2.session`,且必须包含这两个文件。第一次使用`aria2.session`时,创建一个空文件即可,该文件会包含aria2当前的下载列表,这样即使容器被销毁也不用担心文件列表丢失了。你也可以直接拷贝当前项目下`conf`目录中的两个文件并使用。
* `/app/filebrowser.db` File Browser 的内嵌数据库,升级Docker 镜像也不用担心之前的设置丢失。请确保在宿主机先创建一个空文件再使用。
## 自动 SSL
@@ -151,7 +135,6 @@ docker build -t aria2-ui .
请参考 <https://github.com/wahyd4/aria2-ariang-x-docker-compose>
## 常见问题
1. 当你以非其他`80` 端口或以启用了HTTPS`443`端口运行程序时,会出现`Aria2 状态 未连接`的错误,这是因为在最新版本里面,我们去掉aria2的独立6800端口,转而使用和网站同一个端口。你可以设置`ARIA2_EXTERNAL_PORT`后重建你的容器
1. 当你以非其他`80` 端口或以启用了HTTPS`443`端口运行程序时,会出现`Aria2 状态 未连接`的错误,这是因为在最新版本里面,我们去掉aria2的独立6800端口,转而使用和网站同一个端口。因为你需要渠道 `AriaNg设置` -> 页面顶端的 `RPC`页面,将你的Aria2 RPC 地址中的端口从`80`改成你使用的正确端口。因为 AriaNg 仅仅将设置保存在浏览器中,因为当你使用不同的浏览器,或者将浏览器清除缓存后,你都需要重新设置一次
2. 下载的BT或者磁力完全没有速度怎么办? 建议先下载一个热门的BT种子文件,而不是磁力链接。这样可以帮助缓存DHT文件,渐渐地,速度就会起来了。比如试试下载树莓派操作系统的BT种子?[前往下载](https://www.raspberrypi.org/downloads/raspbian/)
3. 如果你遇到了和 `setcap` 相关的错误,很大程度说明你说运行的Linux不支持使用非`root`用户来运行本Docker 镜像,因此请显式地设置环境变量`PUID` `PGID``0` ,也就是使用`root` 来运行
4. 如何配置`Rclone`? 如果你想连接`Google Drive` 类似的云存储平台,很遗憾你不能通过浏览器配置,因为网页版本`Oauth` 方式在这里是用不了的,你只能通过命令行的形式来配置,即`rclone config`. 详请请参考官网 [Configuring rclone on a remote / headless machine](https://rclone.org/remote_setup) 以及详细步骤请参考 [issue](https://github.com/wahyd4/aria2-ariang-docker/issues/118)
+34 -58
View File
@@ -6,14 +6,6 @@ English | [简体中文](https://github.com/wahyd4/aria2-ariang-docker/blob/mast
[![Docker Pulls](https://img.shields.io/docker/pulls/wahyd4/aria2-ui.svg)](https://hub.docker.com/r/wahyd4/aria2-ui/)
[![Github Build](https://github.com/wahyd4/aria2-ariang-docker/workflows/Docker%20Image%20CI/badge.svg)](https://github.com/wahyd4/aria2-ariang-docker/actions)
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/wahyd4/aria2-ariang-docker/tree/master)
[![Page Views Count](https://badges.toozhao.com/svg/aria2-ariang-docker)](https://badges.toozhao.com/stats/aria2-ariang-docker "Page Views Count")
**If you like this project, please consider support me / 如果喜欢本项目,请考虑打赏,谢谢!**
<img src="https://raw.githubusercontent.com/wahyd4/work-in-australia/766592ac6318027d7b3c334d8c50ca80818eeff8/wepay.jpg" alt="buy me a drink" width="120"/>
- [Features](#features)
@@ -24,17 +16,17 @@ English | [简体中文](https://github.com/wahyd4/aria2-ariang-docker/blob/mast
- [Run with docker-compose](#run-with-docker-compose)
- [Supported Environment Variables](#supported-environment-variables)
- [Supported Volumes](#supported-volumes)
- [Auto HTTPS enabling](#auto-https-enabling)
- [Auto SSL enabling](#auto-ssl-enabling)
- [Build the image by yourself](#build-the-image-by-yourself)
- [Docker Hub](#docker-hub)
- [Usage it in Docker compose](#usage-it-in-docker-compose)
- [FAQ](#faq)
One Docker image for file downloading, managing, sharing, as well as video playing and evening cloud storage synchronization.
One Docker image for all file downloading, managing, playing and evening sharing platforms!
Furthermore, it's pretty small and ARM CPU compatible which means you can also run it on Raspberry Pi🍓.
Besides, it's pretty small and ARM CPU supported which means you can run it on Raspberry Pi🍓.
Last but not least, Auto HTTPS can't be more easy!
Last but not least, SSL enabling so easy!
AriaNG
![Screenshot](https://github.com/wahyd4/aria2-ariang-x-docker-compose/raw/master/images/ariang.jpg)
@@ -44,21 +36,19 @@ File Browser
## Features
* [Aria2 (SSL support)](https://aria2.github.io)
* [AriaNg](https://github.com/mayswind/AriaNg)
* [Rclone](https://rclone.org/)
* [File Browser](https://filebrowser.xyz/): Files mangement and videos playing
* Aria2 (SSL support)
* AriaNg
* Auto HTTPS Let's Encrypt
* Bind non root user into container, so non root user can also manage downloaded files.
* Basic Auth
* Support ARM CPUs as well, all supported CPU platforms can be found [here](https://cloud.docker.com/repository/docker/wahyd4/aria2-ui/tags)
* Cloud Storage platforms synchronization
* File indexing and video playing ([File Browser](https://filebrowser.xyz/))
* Add support for ARM CPUs, please choose correct [docker image TAG](https://cloud.docker.com/repository/docker/wahyd4/aria2-ui/tags)
## Recommended versions
* wahyd4/aria2-ui:latest
> Docker will pick the the proper ARCH for you. e.g. arm64v8 or x86_64
* wahyd4/aria2-ui:arm32
* wahyd4/aria2-ui:arm64
## How to run
@@ -68,10 +58,9 @@ File Browser
docker run -d --name aria2-ui -p 80:80 wahyd4/aria2-ui
```
* Aria2: <http://yourip>
* FileManger: <http://yourip/files>
* Rclone: <http://yourip/rclone>
* Please use `admin`/`admin` as username and password to login `Filebrowser` for the first time. And use `user`/`password` to login `Rclone` if you don't update `ARIA2_USER` and `ARIA2_PWD`
* Aria2: <http://yourip/ui/>
* FileManger: <http://yourip>
* Please use `admin`/`admin` as username and password to login for the first time.
### Full features run
@@ -86,17 +75,16 @@ File Browser
-e DOMAIN=https://example.com \
-e ARIA2_SSL=false \
-e ARIA2_USER=user \
-e ARIA2_PWD=password \
-e ARIA2_EXTERNAL_PORT=443 \
-e ARIA2_PWD=pwd \
-v /yourdata:/data \
-v /app/a.db:/app/filebrowser.db \
-v /to_yoursslkeys/:/app/conf/key \
-v <conf files folder>:/app/conf \
-v /yoursslkeys/:/app/conf/key \
-v <the folder of aria2.conf and aria2.session>:/app/conf \
wahyd4/aria2-ui
```
### Run with docker-compose
If you would like to get rid of those annoying command line commands, then just put the following sample content into `docker-compose.yaml`
If you wanna get rid of those annoying command line things, just put the following sample content into `docker-compose.yaml`
```yaml
version: "3.5"
services:
@@ -107,51 +95,40 @@ services:
- ENABLE_AUTH=true
- ARIA2_USER=hello
- ARIA2_PWD=world
- DOMAIN=http://toozhao.com
ports:
- "80:80"
- DOMAIN=toozhao.com
volumes:
- ./data:/data
```
Then simply run `docker-compose up -d`, that's it!
Then just run `docker-compose up -d`, that's it!
### Supported Environment Variables
* `ENABLE_AUTH` whether to enable Basic auth
* `ENABLE_RCLONE` whether to disable Rclone, if you running this container offline or do not have stable connection to Github, please set to `false`
* `ARIA2_USER` Basic Auth username, Rclone GUI uses it as well.
* `ARIA2_PWD` Basic Auth password, Rclone GUI uses it as well.
* `ARIA2_EXTERNAL_PORT` The Aria2 port which exposed to public to access to
* `PUID` Bind Linux UID into container which means you can use non `root` user to manage downloaded files, default UID is `1000`
* `PGID` Bind Linux GID into container, default GID is 1000
* `RPC_SECRET` The Aria2 RPC secret token
* `DOMAIN` The domain you'd like to bind, when domain is a `https://` thing, then auto TLS feature will be enabled
* `RCLONE_CONFIG_BASE64` Inject and config Rclone through `base64` string, which is the only way to use Rclone on Heroku. Please use `cat /app/conf/rclone.conf | base64` or any base64 online tools such as [this](https://www.base64encode.org/) to encode your `rclone.conf` as bse64 string. Note, you need to set `ENABLE_RCLONE` to true as well.
* `ENABLE_APP_CHECKER`, by default it's set to `true` to check if any new docker image version release on daily basis, which can help you get notification when new features released as well as some security vulnerabilities get fixed. You can set it to `false` to disable this feature. Note: you still need to manually pull the new image version and re run the docker container to complete upgrading.
* ENABLE_AUTH whether to enable Basic auth
* ARIA2_USER Basic Auth username
* ARIA2_PWD Basic Auth password
* PUID Bind Linux UID into container which means you can use non `root` user to manage downloaded files, default UID is `1000`
* PGID Bind Linux GID into container, default GID is 1000
* RPC_SECRET The Aria2 RPC secret token
* DOMAIN The domain you'd like to bind, when domain is a `https://` thing, then auto SSL feature will be enabled
### Supported Volumes
* `/data` The folder contains all the files you download.
* `/app/conf/key` The folder which stores Aria2 SSL `certificate` and `key` file. `Notice`: The certificate file should be named `aria2.crt` and the key file should be named `aria2.key`
* `/app/conf` The Aria2 configuration and file session folder. Make sure you have `aria2.conf` and `aria2.session` file. For the first time `aria2.session` just need to be a empty file can be appended. You can also user the templates for these two file in the `conf` folder of this project. Please put your `rclone.conf` in this folder as well if you'd mount it to Rclone. So all the config files supported in this folder are:
* aria2.conf
* aria2.session
* rclone.conf
**Warning: if you don't mount `/app/conf`, whenever the container restarts, you'll lose your downloading progress.**
* `/data` The folder which contains all the files you download.
* `/app/conf/key` The folder which stored Aria2 SSL `certificate` and `key` file. `Notice`: The certificate file should be named `aria2.crt` and the key file should be named `aria2.key`
* `/app/conf` The Aria2 configuration and file session folder. Make sure you have `aria2.conf` and `aria2.session` file. For the first time `aria2.session` just need to be a empty file can be appended. You can also user the templates for these two file in the `conf` folder of this project.
* `/app/filebrowser.db` File Browser settings database, make sure you make a empty file first on your host.
## Auto HTTPS enabling
## Auto SSL enabling
Make sure you have added proper `A` record point to the host you running to your domain `DNS` record list, then just add `e` option to bind the `https` domain when you run the image
Make sure you have add proper `A` record point to the host you running to your domain `DNS` record list, then just add `e` option to bind the `https` domain when you run the image
```bash
docker run -d --name aria2-ui -p 80:80 -p 443:443 -e DOMAIN=https://toozhao.com wahyd4/aria2-ui
```
## Build the image by yourself
```bash
docker buildx build --platform linux/arm/v7,linux/arm64,linux/amd64 -t aria2-ui .
```
docker build -t aria2-ui .
```
## Docker Hub
@@ -163,7 +140,6 @@ docker run -d --name aria2-ui -p 80:80 -p 443:443 -e DOMAIN=https://toozhao.com
Please refer <https://github.com/wahyd4/aria2-ariang-x-docker-compose>
## FAQ
1. When you running the docker image with non `80` port or you have HTTPS enabled, you will meet the error says `Aria2 Status Disconnected`, then you will need to set `ARIA2_EXTERNAL_PORT` and recreate your container.
1. When you running the docker image with non `80` port or you have HTTPS enabled, you will meet the error says `Aria2 Status Disconnected`, then you will need to go to `AriaNg Settings` -> RPC (at the top of the page) to modify the port value in `Aria2 RPC Address` field. Due to AriaNg store all configurations in local browser, so you need to do this per browser.
2. If there is no speed at all when you downloading a BitTorrent file, please try to use a popular torrent file first to help the application to cache `DHT` file. Then the speed should get fast and fast, as well as downloading other links.
3. If you see any errors related to `setcap` which probably means the Linux you are running doesn't support running this application with `non-root` user. So please specify the `PUID` and `PGID` to `0` explicitly to use `root` user to run it.
4. How can I get `Rclone` authenticated? Due to Rclone is running in this docker image only as a component rather than an application, you can only interact with it via `/rclone` endpoint, and no other ports. So the web browser authentication mechanism doesn't work here. Please configure Rclone through command line within the container. You can follow the official doc [Configuring rclone on a remote / headless machine](https://rclone.org/remote_setup) or this [issue](https://github.com/wahyd4/aria2-ariang-docker/issues/118)
+21 -27
View File
@@ -1,34 +1,28 @@
{$DOMAIN}
{$DOMAIN} {
proxy / file-manager {
transparent
}
basicauth / {
ARIA2_USER ARIA2_PWD_ENCRYPT
proxy /jsonrpc localhost:6800 {
transparent
websocket
}
gzip
log stdout
errors stdout
}
redir /ui / 301
redir /ui/ / 301
redir /rclone /rclone/ 301
redir /files /files/ 301
reverse_proxy /jsonrpc 127.0.0.1:6800
route /rclone/* {
uri strip_prefix /rclone
reverse_proxy 127.0.0.1:5572
{$DOMAIN}/ui {
redir / /ui/ 301
}
route /files/* {
uri strip_prefix /files
reverse_proxy 127.0.0.1:8080
}
{$DOMAIN}/ui/ {
root /usr/local/www/aria2
timeouts none
gzip
log stdout
errors stdout
route /ping {
respond "app version: {env.APP_VERSION}"
}
root * /usr/local/www/aria2
file_server
encode gzip
log {
output stderr
basicauth / {$ARIA2_USER} {$ARIA2_PWD}
}
-45
View File
@@ -1,45 +0,0 @@
{
"name": "wahyd4/aria2-ariang-docker demo",
"description": "A demo of Aria2 + AriaNg + Filebrowser + Rclone",
"repository": "https://github.com/wahyd4/aria2-ariang-docker",
"keywords": ["docker", "aria2", "rclone", "fllebrowser", "ariang"],
"stack": "container",
"success_url": "/",
"env": {
"ENABLE_AUTH": {
"description": "This value must be heroku when running in Heroku",
"value": "heroku",
"required": false
},
"RCLONE_CONFIG_BASE64": {
"description": "This value is the base64 string of your preconfigured /app/conf/rclone.conf content",
"value": "",
"required": false
},
"ARIA2_USER": {
"description": "Username to login to AriaNg",
"value": "user",
"required": false
},
"ARIA2_PWD": {
"description": "Password to login to AriaNg",
"value": "password",
"required": false
},
"ARIA2_EXTERNAL_PORT": {
"description": "External port for apps, it should be 443 when running in Heroku",
"value": "443",
"required": false
},
"PUID": {
"description": "The Linux user's ID that to run the app",
"value": "0",
"required": false
},
"PGID": {
"description": "The Linux group's ID that to run the app",
"value": "0",
"required": false
}
}
}
+2 -6
View File
@@ -1,11 +1,7 @@
#! /bin/bash -eu
sed -i 's/6800/'"${ARIA2_EXTERNAL_PORT}"'/g' /usr/local/www/aria2/js/aria-ng*.js
RPC_SECRET_BASE64=$(echo -n ${RPC_SECRET}|base64)
sed -i 's/secret:\"\"/secret:\"'"${RPC_SECRET_BASE64}"'\"/g' /usr/local/www/aria2/js/aria-ng*.js
if [ "$ARIA2_SSL" = "true" ]; then
echo "[INFO] Start aria2 with secure config"
echo "Start aria2 with secure config"
/usr/bin/aria2c --conf-path="/app/conf/aria2.conf" \
--enable-rpc --rpc-listen-all \
@@ -15,7 +11,7 @@ echo "[INFO] Start aria2 with secure config"
else
echo "[INFO] Start aria2 with standard mode"
echo "Start aria2 with standard mode"
/usr/bin/aria2c --conf-path="/app/conf/aria2.conf" --enable-rpc --rpc-listen-all
fi
+50
View File
@@ -0,0 +1,50 @@
FROM arm32v6/alpine:edge
LABEL AUTHOR=Junv<wahyd4@gmail.com>
WORKDIR /app
ENV RPC_SECRET=""
ENV ENABLE_AUTH=false
ENV DOMAIN=0.0.0.0:80
ENV ARIA2_USER=user
ENV ARIA2_PWD=password
ENV ARIA2_SSL=false
ENV PUID=1000
ENV PGID=1000
RUN adduser -D -u 1000 junv \
&& apk update \
&& apk add runit shadow wget bash curl openrc gnupg aria2 tar --no-cache \
&& curl https://getcaddy.com | bash -s personal \
&& platform=linux-armv6 \
&& wget -N https://bin.equinox.io/c/ekMN3bCZFUn/forego-stable-linux-arm.tgz \
&& tar -zxvf forego-stable-linux-arm.tgz \
&& rm -rf forego-stable-linux-arm.tgz \
&& mkdir -p /usr/local/www \
&& mkdir -p /usr/local/www/aria2
ADD aria2c.sh caddy.sh Procfile init.sh start.sh /app/
ADD conf /app/conf
ADD Caddyfile SecureCaddyfile /usr/local/caddy/
# AriaNg
RUN mkdir /usr/local/www/aria2/Download \
&& cd /usr/local/www/aria2 \
&& chmod +rw /app/conf/aria2.session \
&& version=1.1.1 \
&& wget -N --no-check-certificate https://github.com/mayswind/AriaNg/releases/download/${version}/AriaNg-${version}.zip \
&& unzip AriaNg-${version}.zip \
&& rm -rf AriaNg-${version}.zip \
&& chmod -R 755 /usr/local/www/aria2 \
&& sed -i 's/6800/80/g' /usr/local/www/aria2/js/aria-ng*.js
#The folder to store ssl keys
VOLUME /app/conf/key
# User downloaded files
VOLUME /data
EXPOSE 80 443
CMD ["./start.sh"]
+7 -26
View File
@@ -1,31 +1,12 @@
#! /bin/bash -eu
echo "[INFO] Run aria2c and ariaNG"
echo "[INFO] Generate basic auth password for caddy"
ARIA2_PWD_ENCRYPT=$(caddy hash-password -plaintext ${ARIA2_PWD})
case $ENABLE_AUTH in
true)
echo "[INFO] Use Basic Auth config file "
echo "Run aria2c and ariaNG"
if [ "$ENABLE_AUTH" = "true" ]; then
echo "Using Basic Auth config file "
export CADDY_FILE=/usr/local/caddy/SecureCaddyfile
sed -i 's/ARIA2_USER/'"${ARIA2_USER}"'/g' ${CADDY_FILE}
sed -i 's/ARIA2_PWD_ENCRYPT/'"${ARIA2_PWD_ENCRYPT}"'/g' ${CADDY_FILE}
;;
heroku)
echo "[INFO] Run Caddy with Heroku mode"
export CADDY_FILE=/usr/local/caddy/HerokuCaddyfile
sed -i 's/ARIA2_USER/'"${ARIA2_USER}"'/g' ${CADDY_FILE}
sed -i 's/ARIA2_PWD_ENCRYPT/'"${ARIA2_PWD_ENCRYPT}"'/g' ${CADDY_FILE}
sed -i 's/PORT/'"${PORT}"'/g' ${CADDY_FILE}
;;
*)
echo "[INFO] Use caddy without Basic Auth"
else
echo "Using caddy without Basic Auth"
export CADDY_FILE=/usr/local/caddy/Caddyfile
;;
esac
fi
/usr/local/bin/caddy run -config ${CADDY_FILE} -adapter=caddyfile
/usr/local/bin/caddy -quic --conf ${CADDY_FILE}
-5
View File
@@ -1,5 +0,0 @@
#! /bin/bash -eu
# For more details about how to use this feature, see: https://aria2.github.io/manual/en/html/aria2c.html#event-hook
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Aria2 hook triggered with parameters: GID [$1], Files Count: [$2], Files Path: [$3]"
+6 -14
View File
@@ -15,8 +15,6 @@ rpc-listen-all=true
#rpc-listen-port=6800
#最大同时下载数(任务数), 路由建议值: 3
max-concurrent-downloads=5
#种子最小分享率
seed-ratio=100.0
#断点续传
continue=true
#同服务器连接数
@@ -37,8 +35,8 @@ max-upload-limit=0
#lowest-speed-limit=0
#验证用,需要1.16.1之后的release版本
#referer=*
#文件保存路径, 默认为当前启动位置
# dir=/user-files/superuser/
# File downloading folder
dir=/data
#文件缓存, 使用内置的文件缓存, 如果你不相信Linux内核文件缓存和磁盘内置缓存时使用, 需要1.16及以上版本
#disk-cache=0
@@ -54,10 +52,10 @@ disable-ipv6=true
# General Options
log=/var/log/aria2.log
#You can set either debug, info, notice, warn or error.
log-level=warn
log-level=notice
## Related to save downloading progress ##
## 进度保存相关 ##
# 从会话文件中读取下载任务
input-file=/app/conf/aria2.session
# 在Aria2退出时保存`错误/未完成`的下载任务到会话文件
@@ -65,11 +63,5 @@ save-session=/app/conf/aria2.session
# 定时保存会话, 0为退出时才保存, 需1.16.1以上版本, 默认:0
save-session-interval=10
# BT trackers from https://trackerslist.com/best.txt updated on 2021-06-06
bt-tracker=http://1337.abcvg.info:80/announce,http://nyaa.tracker.wf:7777/announce,http://opentracker.xyz:80/announce,http://rt.tace.ru:80/announce,http://share.camoe.cn:8080/announce,http://t.nyaatracker.com:80/announce,http://torrentsmd.com:8080/announce,http://tr.cili001.com:8070/announce,http://tracker-cdn.moeking.me:2095/announce,http://tracker.anirena.com:80/announce,http://tracker.anirena.com:80/b16a15d9a238d1f59178d3614b857290/announce,http://tracker.anonwebz.xyz:8080/announce,http://tracker.bt4g.com:2095/announce,http://tracker.files.fm:6969/announce,http://tracker.gbitt.info:80/announce,http://tracker.ipv6tracker.ru:80/announce,http://tracker.noobsubs.net:80/announce,http://tracker.shittyurl.org:80/announce,http://tracker.tfile.co:80/announce,http://tracker.tfile.me:80/announce,http://tracker.trackerfix.com:80/announce,http://vps02.net.orel.ru:80/announce,https://1337.abcvg.info:443/announce,https://tr.torland.ga:443/announce,https://tracker.coalition.space:443/announce,https://tracker.gbitt.info:443/announce,https://tracker.lilithraws.cf:443/announce,https://tracker.nanoha.org:443/announce,https://tracker.nitrix.me:443/announce,https://tracker.parrotsec.org:443/announce,https://tracker.shittyurl.org:443/announce,https://tracker.tamersunion.org:443/announce,https://w.wwwww.wtf:443/announce,udp://6rt.tace.ru:80/announce,udp://9.rarbg.com:2830/announce,udp://9.rarbg.me:2710/announce,udp://9.rarbg.to:2710/announce,udp://app.icon256.com:8000/announce,udp://bubu.mapfactor.com:6969/announce,udp://discord.heihachi.pw:6969/announce,udp://exodus.desync.com:6969/announce,udp://explodie.org:6969/announce,udp://fe.dealclub.de:6969/announce,udp://inferno.demonoid.is:3391/announce,udp://ipv6.tracker.zerobytes.xyz:16661/announce,udp://mail.realliferpg.de:6969/announce,udp://movies.zsw.ca:6969/announce,udp://mts.tvbit.co:6969/announce,udp://open.demonii.com:1337/announce,udp://open.stealth.si:80/announce,udp://opentor.org:2710/announce,udp://opentracker.i2p.rocks:6969/announce,udp://p4p.arenabg.ch:1337/announce,udp://p4p.arenabg.com:1337/announce,udp://pow7.com:80/announce,udp://retracker.hotplug.ru:2710/announce,udp://retracker.lanta-net.ru:2710/announce,udp://retracker.netbynet.ru:2710/announce,udp://retracker01-msk-virt.corbina.net:80/announce,udp://t1.leech.ie:1337/announce,udp://t2.leech.ie:1337/announce,udp://thetracker.org:80/announce,udp://torrentclub.online:54123/announce,udp://tracker-de.ololosh.space:6969/announce,udp://tracker.0x.tf:6969/announce,udp://tracker.altrosky.nl:6969/announce,udp://tracker.army:6969/announce,udp://tracker.beeimg.com:6969/announce,udp://tracker.birkenwald.de:6969/announce,udp://tracker.blacksparrowmedia.net:6969/announce,udp://tracker.breizh.pm:6969/announce,udp://tracker.ccp.ovh:6969/announce,udp://tracker.cyberia.is:6969/announce,udp://tracker.dler.com:6969/announce,udp://tracker.internetwarriors.net:1337/announce,udp://tracker.moeking.me:6969/announce,udp://tracker.nrx.me:6969/announce,udp://tracker.ololosh.space:6969/announce,udp://tracker.openbittorrent.com:6969/announce,udp://tracker.opentrackr.org:1337/announce,udp://tracker.shkinev.me:6969/announce,udp://tracker.theoks.net:6969/announce,udp://tracker.tiny-vps.com:6969/announce,udp://tracker.torrent.eu.org:451/announce,udp://tracker.uw0.xyz:6969/announce,udp://tracker.zerobytes.xyz:1337/announce,udp://tracker0.ufibox.com:6969/announce,udp://tracker1.bt.moack.co.kr:80/announce,udp://tracker1.itzmx.com:8080/announce,udp://tracker2.dler.com:80/announce,udp://tracker2.dler.org:80/announce,udp://tracker2.itzmx.com:6961/announce,udp://tracker3.itzmx.com:6961/announce,udp://tracker4.itzmx.com:2710/announce,udp://u.wwwww.wtf:1/announce,udp://valakas.rollo.dnsabr.com:2710/announce,udp://vibe.community:6969/announce,udp://wassermann.online:6969/announce,udp://www.torrent.eu.org:451/announce
# The script to be run when download completes
on-download-complete=/app/conf/aria2-sample-hook.sh
# The script to be run when download fails
on-download-error=/app/conf/aria2-sample-hook.sh
# BT trackers from https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best_ip.txt
bt-tracker=udp://62.138.0.158:6969/announce,udp://188.241.58.209:6969/announce,udp://188.241.58.209:6969/announce,udp://185.225.17.100:1337/announce,udp://62.210.79.110:1337/announce,udp://151.80.120.114:2710/announce,udp://151.80.120.112:2710/announce,udp://208.83.20.20:6969/announce,udp://176.113.68.67:8080/announce,udp://184.105.151.164:6969/announce,udp://176.113.68.66:6961/announce,http://176.113.71.19:6961/announce,udp://51.15.40.114:80/announce,udp://89.234.156.205:451/announce,udp://5.206.58.23:6969/announce,udp://176.31.106.35:80/announce,udp://188.246.227.212:80/announce,udp://5.2.79.219:1337/announce,udp://5.2.79.22:6969/announce,http://95.107.48.115:80/announce
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

-3
View File
@@ -1,3 +0,0 @@
build:
docker:
web: Dockerfile
+2 -8
View File
@@ -1,25 +1,19 @@
#! /bin/bash -eu
echo "[INFO] Update uid and gid to ${PUID}:${PGID}"
echo "**** update uid and gid to ${PUID}:${PGID} ****"
groupmod -o -g "$PGID" junv
usermod -o -u "$PUID" junv
mkdir -p /app/.caddy
mkdir -p /app/.cache
chown -R junv:junv \
/app \
/app/.caddy \
/app/.cache \
/usr/local \
/var/log \
/data
chmod +x /app/caddy.sh \
/app/rclone.sh \
/app/aria2c.sh
echo "[INFO] Give caddy permissions to use low ports"
echo "**** give caddy permissions to use low ports ****"
setcap cap_net_bind_service=+ep /usr/local/bin/caddy
"${@-sh}"
-70
View File
@@ -1,70 +0,0 @@
#! /bin/sh -eux
echo "[INFO] Set variables for $(arch)"
caddy_version=2.4.6
filebrowser_version=v2.20.1
rclone_version=v1.57.0
ariang_version=1.2.3
case "$(arch)" in
x86_64)
platform=linux-amd64
caddy_file=caddy_${caddy_version}_linux_amd64.tar.gz
rclone_file=rclone-${rclone_version}-${platform}.zip
;;
armv7l)
platform=linux-armv7
caddy_file=caddy_${caddy_version}_linux_armv7.tar.gz
rclone_file=rclone-${rclone_version}-linux-arm-v7.zip
;;
aarch64)
platform=linux-arm64
caddy_file=caddy_${caddy_version}_linux_arm64.tar.gz
rclone_file=rclone-${rclone_version}-${platform}.zip
;;
*)
echo "[ERROR] unsupported arch $(arch), exit now"
exit 1
;;
esac
filebrowser_file=${platform}-filebrowser.tar.gz
ariang_file=AriaNg-${ariang_version}.zip
adduser -D -u 1000 junv \
&& apk update \
&& apk add runit shadow wget bash curl openrc gnupg aria2 tar mailcap fuse vim --no-cache \
&& wget -N https://github.com/caddyserver/caddy/releases/download/v${caddy_version}/${caddy_file} \
&& tar -zxf ${caddy_file} \
&& mv caddy /usr/local/bin/ \
&& rm -rf ${caddy_file} \
&& platform=linux-amd64 \
&& wget -N https://github.com/filebrowser/filebrowser/releases/download/${filebrowser_version}/${filebrowser_file} \
&& tar -zxf ${filebrowser_file} \
&& rm -rf ${filebrowser_file} \
&& rm LICENSE README.md CHANGELOG.md \
&& mkdir -p /usr/local/www \
&& mkdir -p /usr/local/www/aria2 \
&& rm -rf init /app/*.txt \
&& curl -O https://downloads.rclone.org/${rclone_version}/${rclone_file} \
&& unzip ${rclone_file} \
&& cd rclone-* \
&& cp rclone /usr/local/bin/ \
&& chown junv:junv /usr/local/bin/rclone \
&& chmod 755 /usr/local/bin/rclone \
&& rm /app/${rclone_file} \
&& rm -rf /app/rclone-* \
&& mkdir /usr/local/www/aria2/Download \
&& cd /usr/local/www/aria2 \
&& chmod +rw /app/conf/aria2.session \
&& wget -N --no-check-certificate https://github.com/mayswind/AriaNg/releases/download/${ariang_version}/${ariang_file} \
&& unzip ${ariang_file} \
&& rm -rf ${ariang_file} \
&& chmod -R 755 /usr/local/www/aria2 \
&& mkdir -p /data/cloud \
&& chown junv:junv /data/cloud \
&& ln -s /data/cloud /app
-31
View File
@@ -1,31 +0,0 @@
#! /bin/bash -u
sleep 5
if [ "$ENABLE_APP_CHECKER" = "false" ]; then
echo "[INFO] Skip checking new version"
# Do nothing and just sleep 10 years
sleep 315360000
exit 0
fi
set -e
APP_VERSION=$(cat APP_VERSION)
set +e
while true; do
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Checking for new version against ${APP_VERSION} ..."
newer_version=$(curl --max-time 6 -s "https://badges.toozhao.com/val/aria2-ui-docker?version=${APP_VERSION}&arch=$(arch)")
if [[ -z ${newer_version} ]]; then
echo "[WARN] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Failed to check new version."
sleep 86400
continue
fi
if [[ ${newer_version} > ${APP_VERSION} ]]; then
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Found newer Docker image version wahyd4/aria2-ui:${newer_version}, please consider to upgrade by using docker pull command to have better user experience."
# check new version daily
sleep 86400
continue
fi
echo "[INFO] $(date -u +'%Y-%m-%dT%H:%M:%SZ') Congrats, you are using the latest version docker image"
sleep 86400
done
-20
View File
@@ -1,20 +0,0 @@
#! /bin/bash -eu
if [ "$RCLONE_CONFIG_BASE64" != "" ]; then
echo "[INFO] Config Rclone from RCLONE_CONFIG_BASE64 env"
echo $RCLONE_CONFIG_BASE64 | base64 -d > /app/conf/rclone.conf
echo "[INFO] Config Rclone from RCLONE_CONFIG_BASE64 completed"
fi
if [ "$ENABLE_RCLONE" = "true" ]; then
echo "[INFO] Start Rclone, please make sure you can connect to Github website. if not, please set docker env ENABLE_RCLONE=false"
rclone rcd --rc-web-gui \
--rc-web-gui-no-open-browser \
--rc-addr :5572 \
--rc-user $ARIA2_USER \
--rc-pass $ARIA2_PWD \
--cache-dir /app/.cache
else
echo "[INFO] Skip starting Rclone as it has been disabled"
sleep 3650d
fi
-3
View File
@@ -1,7 +1,4 @@
#!/bin/bash -eu
export APP_VERSION=$(cat /app/APP_VERSION)
if [ "$PGID" != "0" ]; then
$(dirname $0)/init.sh chpst -u junv ./forego start
else