本文关于安装完荒野无灯N1之后,将原生的qBittorrent和Filebrowser改为Docker版本。
Docker qBittorrent
替换原生qBittorrent ,重新安装荒野无灯编译的Docker版qBittorrent。
参考资料 小钢炮使用docker版qb 4.1.6 简明教程 qBittorrent docker镜像:简介里没有说明的部分 N1小钢炮下载系统 篇七:如何在小钢炮系统的Docker里安装灯大原味qBittorrent及优化设置
- 禁用原生qBittorrent
mv /etc/init.d/S92qbittorrent /etc/S92qbittorrent.disabled
killall qbittorrent-nox
- 备份配置文件到外置存储
cp -r /var/lib/qbittorrent/.config/qBittorrent /media/Travel/Document/qBittorrent/config
cp -r /var/lib/qbittorrent/.local/share/data/qBittorrent /media/Travel/Document/qBittorrent/data
- 安装qBittorrent的脚本,保存成.sh文件运行,把网络设置成host模式会有更好的性能表现,而且UPnP/NAT-PMP可以自动映射
IMAGE_NAME=80x86/qbittorrent
WEB_PORT=$(nvram get app.qb.listen_port)
DOWNLOAD_PATH=$(cat /var/lib/qbittorrent/.config/qBittorrent/qBittorrent.conf | grep -i 'Downloads\\SavePath' | cut -d'=' -f2)
BT_PORT=$(cat /var/lib/qbittorrent/.config/qBittorrent/qBittorrent.conf | grep -i 'Connection\\PortRangeMin' | cut -d'=' -f2)
QBT_AUTH_SERVER_ADDR="127.0.0.1"
if [ "$DOWNLOAD_PATH" = "/downloads" ] || [ "$DOWNLOAD_PATH" = "/downloads/" ]; then
echo "please set correct DOWNLOAD_PATH"
exit -1
fi
docker run -d --name qbittorrent \
-e PUID=$(id -u qbittorrent) \
-e PGID=$(cat /etc/group | grep -e '^users' | cut -d':' -f3) \
-e WEB_PORT=$WEB_PORT \
-e BT_PORT=$BT_PORT \
-e QBT_AUTH_SERVER_ADDR=$QBT_AUTH_SERVER_ADDR \
--restart unless-stopped \
--network host \
-v /var/lib/qbittorrent/.config/qBittorrent:/config \
-v /var/lib/qbittorrent/.local/share/data/qBittorrent:/data \
-v "$DOWNLOAD_PATH":/downloads \
--mount type=tmpfs,destination=/tmp \
${IMAGE_NAME}
如果要安装桥接模式:
#!/bin/sh
IMAGE_NAME=80x86/qbittorrent:4.2.1-arm64
WEB_PORT=$(nvram get app.qb.listen_port)
[ -z "$WEB_PORT" ] && WEB_PORT=8082
DOWNLOAD_PATH=$(cat /var/lib/qbittorrent/.config/qBittorrent/qBittorrent.conf | grep -i 'Downloads\\SavePath' | cut -d'=' -f2)
BT_PORT=$(cat /var/lib/qbittorrent/.config/qBittorrent/qBittorrent.conf | grep -i 'Connection\\PortRangeMin' | cut -d'=' -f2)
[ -z "$BT_PORT" ] && BT_PORT=8999
QBT_AUTH_SERVER_ADDR=$(ip -4 addr show docker0 | grep inet | awk '{print $2}' | cut -d'/' -f1)
if [ "$DOWNLOAD_PATH" = "/downloads" ] || [ "$DOWNLOAD_PATH" = "/downloads/" ] || [ "$DOWNLOAD_PATH" = "" ]; then
echo "please set correct DOWNLOAD_PATH"
exit -1
fi
docker pull ${IMAGE_NAME} && \
docker run -d --name qbittorrent \
-e PUID=$(id -u qbittorrent) \
-e PGID=$(cat /etc/group | grep -e '^users' | cut -d':' -f3) \
-e WEB_PORT=$WEB_PORT \
-e BT_PORT=$BT_PORT \
-e QBT_AUTH_SERVER_ADDR=$QBT_AUTH_SERVER_ADDR \
--restart unless-stopped \
-p $WEB_PORT:$WEB_PORT -p $BT_PORT:$BT_PORT/tcp -p $BT_PORT:$BT_PORT/udp \
-v /var/lib/qbittorrent/.config/qBittorrent:/config \
-v /var/lib/qbittorrent/.local/share/data/qBittorrent:/data \
-v "$DOWNLOAD_PATH":/downloads \
--mount type=tmpfs,destination=/tmp \
${IMAGE_NAME}
- 本地免验证(按照荒野无灯大大的说法,QBT_AUTH_SERVER_ADDR已经设置好,但是我测试没有成功。)如果无法免密码登录,可以打开qB,在设置中将本地网段添加到白名单中
Docker Filebrowser
- 禁用原生Filebrowser
mv /etc/init.d/S99filebrowser /etc/S99filebrows.disabled
killall filebrowser
- 设置原配置目录的权限以防止出错
chmod -R 777 /var/lib/filebrowser
- 安装Filebrowser
docker run -it --restart always \
-d --name filebrowser \
--net=host \
-e SSL=on \
-e PUID=$(id -u filebrowser) \
-e PGID=$(cat /etc/group | grep -e '^users' | cut -d':' -f3) \
-e WEB_PORT=8082 \
-v /var/lib/filebrowser:/config \
-v /media:/myfiles \
--mount type=tmpfs,destination=/tmp \
80x86/filebrowser:arm64