Skip to content

Commit

Permalink
Dht issue (wahyd4#211)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
wahyd4 authored Apr 19, 2022
1 parent a20300c commit 46fd0a8
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
12 changes: 5 additions & 7 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -29,6 +30,3 @@ root * /usr/local/www/aria2
file_server

encode gzip
log {
output stderr
}
13 changes: 9 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 5 additions & 3 deletions SecureCaddyfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{$DOMAIN}

log {
level {env.CADDY_LOG_LEVEL}
output stderr
}

basicauth / {
ARIA2_USER ARIA2_PWD_ENCRYPT
}
Expand Down Expand Up @@ -29,6 +34,3 @@ root * /usr/local/www/aria2
file_server

encode gzip
log {
output stderr
}
6 changes: 6 additions & 0 deletions conf/aria2.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down

0 comments on commit 46fd0a8

Please sign in to comment.