Skip to content

Commit 46fd0a8

Browse files
authored
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
1 parent a20300c commit 46fd0a8

File tree

5 files changed

+26
-14
lines changed

5 files changed

+26
-14
lines changed

Caddyfile

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
#{
2-
# auto_https off
3-
#}
4-
51
{$DOMAIN}
62

3+
log {
4+
level {env.CADDY_LOG_LEVEL}
5+
output stderr
6+
}
7+
78
redir /ui / 301
89
redir /ui/ / 301
910
redir /rclone /rclone/ 301
@@ -29,6 +30,3 @@ root * /usr/local/www/aria2
2930
file_server
3031

3132
encode gzip
32-
log {
33-
output stderr
34-
}

Dockerfile

+9-4
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ ENV CADDYPATH=/app
3131
ENV RCLONE_CONFIG=/app/conf/rclone.conf
3232
ENV XDG_DATA_HOME=/app/.caddy/data
3333
ENV XDG_CONFIG_HOME=/app/.caddy/config
34+
ENV XDG_CACHE_HOME=/app/.cache
3435
ENV RCLONE_CONFIG_BASE64=""
3536
ENV ENABLE_APP_CHECKER=true
37+
ENV CADDY_LOG_LEVEL=INFO
3638

3739
ADD install.sh aria2c.sh caddy.sh Procfile init.sh start.sh rclone.sh new-version-checker.sh APP_VERSION /app/
3840
ADD conf /app/conf
@@ -44,13 +46,16 @@ RUN ./install.sh
4446

4547
RUN rm ./install.sh
4648

47-
# folder for storing ssl keys
48-
VOLUME /app/conf/key
49+
# For config files
50+
VOLUME /app/conf/
4951

50-
# file downloading folder
52+
# For file downloading
5153
VOLUME /data
5254

53-
EXPOSE 80 443
55+
# For rclone cache and aria2 DHT files
56+
VOLUME /app/.cache
57+
58+
EXPOSE 80 443 6881
5459

5560
HEALTHCHECK --interval=30s --timeout=3s \
5661
CMD curl -f http://localhost/ping || exit 1

SecureCaddyfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{$DOMAIN}
22

3+
log {
4+
level {env.CADDY_LOG_LEVEL}
5+
output stderr
6+
}
7+
38
basicauth / {
49
ARIA2_USER ARIA2_PWD_ENCRYPT
510
}
@@ -29,6 +34,3 @@ root * /usr/local/www/aria2
2934
file_server
3035

3136
encode gzip
32-
log {
33-
output stderr
34-
}

conf/aria2.conf

+6
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,9 @@ on-download-complete=/app/conf/aria2-sample-hook.sh
7373

7474
# The script to be run when download fails
7575
on-download-error=/app/conf/aria2-sample-hook.sh
76+
77+
## DHT
78+
dht-entry-point=dht.transmissionbt.com:6881
79+
dht-entry-point=dht.vuze.com:6881
80+
dht-entry-point=dht.libtorrent.org:25401
81+
dht-listen-port=6881

init.sh

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ usermod -o -u "$PUID" junv
66

77
mkdir -p /app/.caddy
88
mkdir -p /app/.cache
9+
mkdir -p /app/.cache/aria2
910

1011
chown -R junv:junv \
1112
/app \

0 commit comments

Comments
 (0)