diff --git a/Dockerfile b/Dockerfile index 37163ad..e79e464 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ ENV DOMAIN=0.0.0.0:80 ENV ARIA2_USER=user ENV ARIA2_PWD=password ENV ARIA2_SSL=false +ENV ARIA2_OUTSIDE_PORT=80 ENV PUID=1000 ENV PGID=1000 @@ -41,8 +42,7 @@ RUN mkdir /usr/local/www/aria2/Download \ && wget -N --no-check-certificate https://github.com/mayswind/AriaNg/releases/download/${version}/AriaNg-${version}.zip \ && unzip AriaNg-${version}.zip \ && rm -rf AriaNg-${version}.zip \ - && chmod -R 755 /usr/local/www/aria2 \ - && sed -i 's/6800/80/g' /usr/local/www/aria2/js/aria-ng*.js + && chmod -R 755 /usr/local/www/aria2 # folder for storing ssl keys VOLUME /app/conf/key diff --git a/README.CN.md b/README.CN.md index 2fef879..8c0e158 100644 --- a/README.CN.md +++ b/README.CN.md @@ -70,6 +70,7 @@ File Browser -e ARIA2_SSL=false \ -e ARIA2_USER=user \ -e ARIA2_PWD=pwd \ + -e ARIA2_OUTSIDE_PORT=443 \ -v /yourdata:/data \ -v /app/a.db:/app/filebrowser.db \ -v /yoursslkeys/:/app/conf/key \ @@ -100,6 +101,7 @@ services: * ENABLE_AUTH 启用 Basic auth(网页简单认证) 用户认证 * ARIA2_USER Basic Auth 用户认证用户名 * ARIA2_PWD Basic Auth 密码 + * ARIA2_OUTSIDE_PORT 从外部可以访问到的ARIA2端口,默认为http的`80` * PUID 需要绑定主机的Linux用户ID,可以通过`cat /etc/passwd` 查看用户列表, 默认UID 是`1000` * PGID 需要绑定的主机的Linux 用户组ID,默认GID 是`1000` * RPC_SECRET Aria2 RPC 加密 token @@ -135,6 +137,6 @@ docker build -t aria2-ui . 请参考 ## 常见问题 - 1. 当你以非其他`80` 端口或以启用了HTTPS`443`端口运行程序时,会出现`Aria2 状态 未连接`的错误,这是因为在最新版本里面,我们去掉aria2的独立6800端口,转而使用和网站同一个端口。因为你需要渠道 `AriaNg设置` -> 页面顶端的 `RPC`页面,将你的Aria2 RPC 地址中的端口从`80`改成你使用的正确端口。因为 AriaNg 仅仅将设置保存在浏览器中,因为当你使用不同的浏览器,或者将浏览器清除缓存后,你都需要重新设置一次。 + 1. 当你以非其他`80` 端口或以启用了HTTPS`443`端口运行程序时,会出现`Aria2 状态 未连接`的错误,这是因为在最新版本里面,我们去掉aria2的独立6800端口,转而使用和网站同一个端口。你可以设置`ARIA2_OUTSIDE_PORT`后重建你的容器。 2. 下载的BT或者磁力完全没有速度怎么办? 建议先下载一个热门的BT种子文件,而不是磁力链接。这样可以帮助缓存DHT文件,渐渐地,速度就会起来了。比如试试下载树莓派操作系统的BT种子?[前往下载](https://www.raspberrypi.org/downloads/raspbian/) 3. 如果你遇到了和 `setcap` 相关的错误,很大程度说明你说运行的Linux不支持使用非`root`用户来运行本Docker 镜像,因此请显式地设置环境变量`PUID` `PGID` 为 `0` ,也就是使用`root` 来运行 diff --git a/README.md b/README.md index 489c14f..1f8c8da 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ File Browser -e ARIA2_SSL=false \ -e ARIA2_USER=user \ -e ARIA2_PWD=pwd \ + -e ARIA2_OUTSIDE_PORT=443 \ -v /yourdata:/data \ -v /app/a.db:/app/filebrowser.db \ -v /yoursslkeys/:/app/conf/key \ @@ -106,6 +107,7 @@ Then just run `docker-compose up -d`, that's it! * ENABLE_AUTH whether to enable Basic auth * ARIA2_USER Basic Auth username * ARIA2_PWD Basic Auth password + * ARIA2_OUTSIDE_PORT The Aria2 port which accessible from outside * 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 @@ -140,6 +142,6 @@ docker build -t aria2-ui . Please refer ## FAQ - 1. When you running the docker image with non `80` port or you have HTTPS enabled, you will meet the error says `Aria2 Status Disconnected`, then you will need to go to `AriaNg Settings` -> RPC (at the top of the page) to modify the port value in `Aria2 RPC Address` field. Due to AriaNg store all configurations in local browser, so you need to do this per browser. + 1. When you running the docker image with non `80` port or you have HTTPS enabled, you will meet the error says `Aria2 Status Disconnected`, then you will need to set `ARIA2_OUTSIDE_PORT` and recreate your container. 2. If there is no speed at all when you downloading a BitTorrent file, please try to use a popular torrent file first to help the application to cache `DHT` file. Then the speed should get fast and fast, as well as downloading other links. 3. If you see any errors related to `setcap` which probably means the Linux you are running doesn't support running this application with `non-root` user. So please specify the `PUID` and `PGID` to `0` explicitly to use `root` user to run it. diff --git a/aria2c.sh b/aria2c.sh index e76d6f6..f9a9ae2 100755 --- a/aria2c.sh +++ b/aria2c.sh @@ -1,5 +1,7 @@ #! /bin/bash -eu +sed -i 's/6800/'"${ARIA2_OUTSIDE_PORT}"'/g' /usr/local/www/aria2/js/aria-ng*.js + if [ "$ARIA2_SSL" = "true" ]; then echo "Start aria2 with secure config" diff --git a/arm32.Dockerfile b/arm32.Dockerfile index 85508a9..78d4ed5 100644 --- a/arm32.Dockerfile +++ b/arm32.Dockerfile @@ -10,6 +10,7 @@ ENV DOMAIN=0.0.0.0:80 ENV ARIA2_USER=user ENV ARIA2_PWD=password ENV ARIA2_SSL=false +ENV ARIA2_OUTSIDE_PORT=80 ENV PUID=1000 ENV PGID=1000 @@ -42,8 +43,7 @@ RUN mkdir /usr/local/www/aria2/Download \ && wget -N --no-check-certificate https://github.com/mayswind/AriaNg/releases/download/${version}/AriaNg-${version}.zip \ && unzip AriaNg-${version}.zip \ && rm -rf AriaNg-${version}.zip \ - && chmod -R 755 /usr/local/www/aria2 \ - && sed -i 's/6800/80/g' /usr/local/www/aria2/js/aria-ng*.js + && chmod -R 755 /usr/local/www/aria2 #The folder to store ssl keys VOLUME /app/conf/key diff --git a/arm64.Dockerfile b/arm64.Dockerfile index 86af373..22c3719 100644 --- a/arm64.Dockerfile +++ b/arm64.Dockerfile @@ -10,6 +10,7 @@ ENV DOMAIN=0.0.0.0:80 ENV ARIA2_USER=user ENV ARIA2_PWD=password ENV ARIA2_SSL=false +ENV ARIA2_OUTSIDE_PORT=80 ENV PUID=1000 ENV PGID=1000 @@ -41,8 +42,7 @@ RUN mkdir /usr/local/www/aria2/Download \ && wget -N --no-check-certificate https://github.com/mayswind/AriaNg/releases/download/${version}/AriaNg-${version}.zip \ && unzip AriaNg-${version}.zip \ && rm -rf AriaNg-${version}.zip \ - && chmod -R 755 /usr/local/www/aria2 \ - && sed -i 's/6800/80/g' /usr/local/www/aria2/js/aria-ng*.js + && chmod -R 755 /usr/local/www/aria2 #The folder to store ssl keys VOLUME /app/conf/key