From 46fd0a842f10a5d62c141ae863d6c370ae023b1d Mon Sep 17 00:00:00 2001 From: Junwei Zhao Date: Tue, 19 Apr 2022 11:04:22 +1000 Subject: [PATCH] Dht issue (#211) * Move .aria2/dht.dat file to /app folder to solve the issue failed to save dht.dat * Add env CADDY_LOG_LEVEL to allow user override log levels --- Caddyfile | 12 +++++------- Dockerfile | 13 +++++++++---- SecureCaddyfile | 8 +++++--- conf/aria2.conf | 6 ++++++ init.sh | 1 + 5 files changed, 26 insertions(+), 14 deletions(-) diff --git a/Caddyfile b/Caddyfile index 03b4fbf..34a303d 100644 --- a/Caddyfile +++ b/Caddyfile @@ -1,9 +1,10 @@ -#{ -# auto_https off -#} - {$DOMAIN} +log { + level {env.CADDY_LOG_LEVEL} + output stderr +} + redir /ui / 301 redir /ui/ / 301 redir /rclone /rclone/ 301 @@ -29,6 +30,3 @@ root * /usr/local/www/aria2 file_server encode gzip -log { - output stderr -} diff --git a/Dockerfile b/Dockerfile index e5f8ad2..45303e3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,8 +31,10 @@ 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 XDG_CACHE_HOME=/app/.cache ENV RCLONE_CONFIG_BASE64="" ENV ENABLE_APP_CHECKER=true +ENV CADDY_LOG_LEVEL=INFO 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 @@ -44,13 +46,16 @@ RUN ./install.sh RUN rm ./install.sh -# folder for storing ssl keys -VOLUME /app/conf/key +# For config files +VOLUME /app/conf/ -# file downloading folder +# For file downloading VOLUME /data -EXPOSE 80 443 +# For rclone cache and aria2 DHT files +VOLUME /app/.cache + +EXPOSE 80 443 6881 HEALTHCHECK --interval=30s --timeout=3s \ CMD curl -f http://localhost/ping || exit 1 diff --git a/SecureCaddyfile b/SecureCaddyfile index f148cb9..c1f2ba6 100644 --- a/SecureCaddyfile +++ b/SecureCaddyfile @@ -1,5 +1,10 @@ {$DOMAIN} +log { + level {env.CADDY_LOG_LEVEL} + output stderr +} + basicauth / { ARIA2_USER ARIA2_PWD_ENCRYPT } @@ -29,6 +34,3 @@ root * /usr/local/www/aria2 file_server encode gzip -log { - output stderr -} diff --git a/conf/aria2.conf b/conf/aria2.conf index ad41133..daa032b 100644 --- a/conf/aria2.conf +++ b/conf/aria2.conf @@ -73,3 +73,9 @@ 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 + +## DHT +dht-entry-point=dht.transmissionbt.com:6881 +dht-entry-point=dht.vuze.com:6881 +dht-entry-point=dht.libtorrent.org:25401 +dht-listen-port=6881 diff --git a/init.sh b/init.sh index d56037a..3379dcf 100755 --- a/init.sh +++ b/init.sh @@ -6,6 +6,7 @@ usermod -o -u "$PUID" junv mkdir -p /app/.caddy mkdir -p /app/.cache +mkdir -p /app/.cache/aria2 chown -R junv:junv \ /app \