Skip to content

Commit

Permalink
Allow user to use root to run this application
Browse files Browse the repository at this point in the history
  • Loading branch information
wahyd4 committed Oct 10, 2019
1 parent 38abdb6 commit 94b7e09
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
5 changes: 3 additions & 2 deletions README.CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,6 @@ docker build -t aria2-ui .
请参考 <https://github.com/wahyd4/aria2-ariang-x-docker-compose>
## 常见问题
1.当你以非其他`80` 端口或以启用了HTTPS`443`端口运行程序时,会出现`Aria2 状态 未连接`的错误,这是因为在最新版本里面,我们去掉aria2的独立6800端口,转而使用和网站同一个端口。因为你需要渠道 `AriaNg设置` -> 页面顶端的 `RPC`页面,将你的Aria2 RPC 地址中的端口从`80`改成你使用的正确端口。因为 AriaNg 仅仅将设置保存在浏览器中,因为当你使用不同的浏览器,或者将浏览器清除缓存后,你都需要重新设置一次。
1. 下载的BT或者磁力完全没有速度怎么办? 建议先下载一个热门的BT种子文件,而不是磁力链接。这样可以帮助缓存DHT文件,渐渐地,速度就会起来了。比如试试下载树莓派操作系统的BT种子?[前往下载](https://www.raspberrypi.org/downloads/raspbian/)
1. 当你以非其他`80` 端口或以启用了HTTPS`443`端口运行程序时,会出现`Aria2 状态 未连接`的错误,这是因为在最新版本里面,我们去掉aria2的独立6800端口,转而使用和网站同一个端口。因为你需要渠道 `AriaNg设置` -> 页面顶端的 `RPC`页面,将你的Aria2 RPC 地址中的端口从`80`改成你使用的正确端口。因为 AriaNg 仅仅将设置保存在浏览器中,因为当你使用不同的浏览器,或者将浏览器清除缓存后,你都需要重新设置一次。
2. 下载的BT或者磁力完全没有速度怎么办? 建议先下载一个热门的BT种子文件,而不是磁力链接。这样可以帮助缓存DHT文件,渐渐地,速度就会起来了。比如试试下载树莓派操作系统的BT种子?[前往下载](https://www.raspberrypi.org/downloads/raspbian/)
3. 如果你遇到了和 `setcap` 相关的错误,很大程度说明你说运行的Linux不支持使用非`root`用户来运行本Docker 镜像,因此请显式地设置环境变量`PUID` `PGID` 为 `0` ,也就是使用`root` 来运行
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,4 @@ docker build -t aria2-ui .
## 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.
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.
3 changes: 2 additions & 1 deletion init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ usermod -o -u "$PUID" junv
chown -R junv:junv \
/app \
/usr/local \
/var/log
/var/log \
/data

chmod +x /app/caddy.sh \
/app/aria2c.sh
Expand Down
7 changes: 5 additions & 2 deletions start.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/bash -eu

$(dirname $0)/init.sh chpst -u junv ./forego start
if [ "$PGID" != "0" ]; then
$(dirname $0)/init.sh chpst -u junv ./forego start
else
./forego start
fi

0 comments on commit 94b7e09

Please sign in to comment.