Skip to content

Commit b04fd37

Browse files
committed
get latest ariaNg version
1 parent 5ab206c commit b04fd37

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

nextcloud/aria2/Dockerfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ LABEL AUTHOR="Benson Yan<[email protected]>"
44

55
WORKDIR /root
66

7+
ARG ARIANG_URL="https://github.com/mayswind/AriaNg/releases"
78
ENV RPC_SECRET=Hello ENABLE_AUTH=false DOMAIN=0.0.0.0:80 ARIA2_USER=user ARIA2_PWD=password
8-
ENV ARIANG_VERSION=1.0.1
99

1010
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \
1111
&& apk add --no-cache wget bash curl openrc gnupg screen aria2 tar
@@ -18,11 +18,13 @@ COPY aria2c.sh /root
1818
COPY Caddyfile SecureCaddyfile /usr/local/caddy/
1919

2020
#AriaNg
21-
RUN aria2_path=/usr/local/www/aria2 \
21+
RUN set -ex \
22+
&& export ARIANG_VERSION=$(curl ${ARIANG_URL}/latest -si | grep 'Location:' | grep -oE "[0-9]{1,2}[0-9.]+") \
23+
&& aria2_path=/usr/local/www/aria2 \
2224
&& install -d ${aria2_path} ${aria2_path}/Download \
2325
&& cd ${aria2_path} \
2426
&& chmod +rw /root/conf/aria2.session \
25-
&& curl -kL https://github.com/mayswind/AriaNg/releases/download/${ARIANG_VERSION}/AriaNg-${ARIANG_VERSION}.zip -o /root/AriaNg-${ARIANG_VERSION}.zip
27+
&& curl -kL ${ARIANG_URL}/download/${ARIANG_VERSION}/AriaNg-${ARIANG_VERSION}.zip -o /root/AriaNg-${ARIANG_VERSION}.zip
2628

2729
#The folder to store ssl keys
2830
VOLUME /root/conf/key

nextcloud/aria2/aria2c.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ run_aria2() {
3636

3737
prepare() {
3838
local aria2_path=/usr/local/www/aria2
39-
local aria_ng=/root/AriaNg.zip
39+
local aria_ng=$(find /root/ -name AriaNg-*.zip)
4040
[ -d "$aria2_path" ] || install -d $aria2_path $aria2_path/Download
4141
if [ $(ls -A $aria2_path| wc -w) -lt 1 ];then
4242
cd $aria2_path

0 commit comments

Comments
 (0)