mirror of
https://github.com/wahyd4/aria2-ariang-docker.git
synced 2026-08-09 13:26:07 +10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d1a326a23 | ||
|
|
534b94a31f | ||
|
|
cc16fa5b0b | ||
|
|
76789658e5 | ||
|
|
59c67bad8c | ||
|
|
c2881479a9 | ||
|
|
1f4a331147 | ||
|
|
461f0e9451 | ||
|
|
381e7a760c | ||
|
|
56190aea72 | ||
|
|
42f1317afe | ||
|
|
a6c21b228e | ||
|
|
feb2d5781b | ||
|
|
53985992c6 | ||
|
|
963b4ae8d2 | ||
|
|
9a58c2a12e |
@@ -13,6 +13,12 @@ jobs:
|
||||
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
|
||||
@@ -72,3 +78,25 @@ jobs:
|
||||
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
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
4.10.0
|
||||
+20
-1
@@ -1,3 +1,18 @@
|
||||
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 20180216151118 \
|
||||
&& go mod init \
|
||||
&& go mod vendor \
|
||||
&& go mod download \
|
||||
&& go build -o forego \
|
||||
&& chmod +x forego
|
||||
|
||||
FROM alpine:edge
|
||||
|
||||
LABEL AUTHOR=Junv<wahyd4@gmail.com>
|
||||
@@ -18,11 +33,15 @@ 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 /app/
|
||||
ADD install.sh aria2c.sh caddy.sh Procfile init.sh start.sh rclone.sh new-version-checker.sh APP_VERSION /app/
|
||||
ADD conf /app/conf
|
||||
ADD Caddyfile SecureCaddyfile HerokuCaddyfile /usr/local/caddy/
|
||||
|
||||
COPY --from=build-forego /app/forego/forego /app
|
||||
|
||||
RUN ./install.sh
|
||||
|
||||
RUN rm ./install.sh
|
||||
|
||||
@@ -2,3 +2,4 @@ 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
|
||||
|
||||
+11
-9
@@ -106,15 +106,17 @@ 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`
|
||||
* `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`来禁用该功能。注意该功能启用下,依然需要手动更新镜像来完成升级。
|
||||
|
||||
|
||||
### 支持的 Docker volume 属性
|
||||
|
||||
@@ -117,15 +117,17 @@ Then simply 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
|
||||
* `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.
|
||||
|
||||
|
||||
### Supported Volumes
|
||||
|
||||
@@ -11,6 +11,11 @@
|
||||
"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",
|
||||
|
||||
@@ -5,7 +5,7 @@ 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 "Start aria2 with secure config"
|
||||
echo "[INFO] Start aria2 with secure config"
|
||||
|
||||
/usr/bin/aria2c --conf-path="/app/conf/aria2.conf" \
|
||||
--enable-rpc --rpc-listen-all \
|
||||
@@ -15,7 +15,7 @@ echo "Start aria2 with secure config"
|
||||
|
||||
else
|
||||
|
||||
echo "Start aria2 with standard mode"
|
||||
echo "[INFO] Start aria2 with standard mode"
|
||||
/usr/bin/aria2c --conf-path="/app/conf/aria2.conf" --enable-rpc --rpc-listen-all
|
||||
|
||||
fi
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
#! /bin/bash -eu
|
||||
|
||||
echo "Run aria2c and ariaNG"
|
||||
echo "[INFO] Run aria2c and ariaNG"
|
||||
|
||||
echo "**** Generate basic auth password for caddy ****"
|
||||
echo "[INFO] Generate basic auth password for caddy"
|
||||
ARIA2_PWD_ENCRYPT=$(caddy hash-password -plaintext ${ARIA2_PWD})
|
||||
|
||||
case $ENABLE_AUTH in
|
||||
true)
|
||||
echo "Using Basic Auth config file "
|
||||
echo "[INFO] Use 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 "Running in Heroku mode"
|
||||
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}
|
||||
@@ -23,7 +23,7 @@ heroku)
|
||||
|
||||
;;
|
||||
*)
|
||||
echo "Using caddy without Basic Auth"
|
||||
echo "[INFO] Use caddy without Basic Auth"
|
||||
export CADDY_FILE=/usr/local/caddy/Caddyfile
|
||||
;;
|
||||
esac
|
||||
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#! /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]"
|
||||
+8
-2
@@ -54,10 +54,10 @@ disable-ipv6=true
|
||||
# General Options
|
||||
log=/var/log/aria2.log
|
||||
#You can set either debug, info, notice, warn or error.
|
||||
log-level=notice
|
||||
log-level=warn
|
||||
|
||||
|
||||
## 进度保存相关 ##
|
||||
## Related to save downloading progress ##
|
||||
# 从会话文件中读取下载任务
|
||||
input-file=/app/conf/aria2.session
|
||||
# 在Aria2退出时保存`错误/未完成`的下载任务到会话文件
|
||||
@@ -67,3 +67,9 @@ 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/bash -eu
|
||||
|
||||
echo "**** update uid and gid to ${PUID}:${PGID} ****"
|
||||
echo "[INFO] Update uid and gid to ${PUID}:${PGID}"
|
||||
groupmod -o -g "$PGID" junv
|
||||
usermod -o -u "$PUID" junv
|
||||
|
||||
@@ -19,7 +19,7 @@ chmod +x /app/caddy.sh \
|
||||
/app/rclone.sh \
|
||||
/app/aria2c.sh
|
||||
|
||||
echo "**** give caddy permissions to use low ports ****"
|
||||
echo "[INFO] Give caddy permissions to use low ports"
|
||||
setcap cap_net_bind_service=+ep /usr/local/bin/caddy
|
||||
|
||||
"${@-sh}"
|
||||
|
||||
+6
-9
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh -eux
|
||||
|
||||
echo "Set variables for $(arch)"
|
||||
echo "[INFO] Set variables for $(arch)"
|
||||
|
||||
caddy_version=2.4.5
|
||||
filebrowser_version=v2.17.2
|
||||
@@ -13,24 +13,21 @@ case "$(arch)" in
|
||||
platform=linux-amd64
|
||||
caddy_file=caddy_${caddy_version}_linux_amd64.tar.gz
|
||||
rclone_file=rclone-${rclone_version}-${platform}.zip
|
||||
forego_file=forego-stable-${platform}.tgz
|
||||
;;
|
||||
armv7l)
|
||||
platform=linux-armv7
|
||||
caddy_file=caddy_${caddy_version}_linux_armv7.tar.gz
|
||||
rclone_file=rclone-${rclone_version}-linux-arm-v7.zip
|
||||
forego_file=forego-stable-linux-arm.tgz
|
||||
;;
|
||||
|
||||
aarch64)
|
||||
platform=linux-arm64
|
||||
caddy_file=caddy_${caddy_version}_linux_arm64.tar.gz
|
||||
rclone_file=rclone-${rclone_version}-${platform}.zip
|
||||
forego_file=forego-stable-${platform}.tgz
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "unsupported arch $(arch), exit now"
|
||||
echo "[ERROR] unsupported arch $(arch), exit now"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -40,7 +37,7 @@ 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 --no-cache \
|
||||
&& 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/ \
|
||||
@@ -50,9 +47,6 @@ adduser -D -u 1000 junv \
|
||||
&& tar -zxf ${filebrowser_file} \
|
||||
&& rm -rf ${filebrowser_file} \
|
||||
&& rm LICENSE README.md CHANGELOG.md \
|
||||
&& wget -N https://bin.equinox.io/c/ekMN3bCZFUn/${forego_file} \
|
||||
&& tar -zxf ${forego_file} \
|
||||
&& rm -rf ${forego_file} \
|
||||
&& mkdir -p /usr/local/www \
|
||||
&& mkdir -p /usr/local/www/aria2 \
|
||||
&& rm -rf init /app/*.txt \
|
||||
@@ -71,3 +65,6 @@ adduser -D -u 1000 junv \
|
||||
&& 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
|
||||
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#! /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
|
||||
@@ -1,7 +1,13 @@
|
||||
#! /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 "Start Rclone, please make sure you can connect to Github website. if not, please set docker env ENABLE_RCLONE=false"
|
||||
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 \
|
||||
@@ -9,6 +15,6 @@ if [ "$ENABLE_RCLONE" = "true" ]; then
|
||||
--rc-pass $ARIA2_PWD \
|
||||
--cache-dir /app/.cache
|
||||
else
|
||||
echo "Skip starting Rclone as it's been disabled"
|
||||
echo "[INFO] Skip starting Rclone as it has been disabled"
|
||||
sleep 3650d
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user