devome / dockerfiles

一些Dockerfile
https://evine.win
GNU General Public License v3.0
194 stars 23 forks source link

MONITOR_IP这个参数不生效 #110

Closed sokingshen closed 9 months ago

sokingshen commented 9 months ago

设置监控ip后,监控ip在线也没有切换到限速模式。docker网络为host模式

devome commented 9 months ago

请使用最新版本。

sokingshen commented 9 months ago

image 我用的就是4.5.5没有最新的了

devome commented 9 months ago

在容器中的/usr/local/bin/alter-limits/usr/local/bin/detect-ip这两个脚本的第二行都添加上set -x,然后容器中手动运行一次detect-ip,把输出发来看看。注意隐藏密码。

sokingshen commented 9 months ago

Ok.' ++++ echo 'HTTP/1.1 200 OK connection: keep-alive content-length: 3 content-security-policy: default-src '\''self'\''; style-src '\''self'\'' '\''unsafe-inline'\''; img-src '\''self'\'' data:; script-src '\''self'\'' '\''unsafe-inline'\''; object-src '\''none'\''; form-action '\''self'\''; content-type: text/plain; charset=UTF-8 date: Mon, 16 Oct 2023 13:37:26 GMT referrer-policy: same-origin set-cookie: SID=H0v2Cna38Nv/pqvHw0/f6m+a8r+GILm4; HttpOnly; path=/ x-content-type-options: nosniff x-xss-protection: 1; mode=block

Ok.' ++++ awk '/set-cookie/{print $2}' +++ local 'qb_cookie=SID=H0v2Cna38Nv/pqvHw0/f6m+a8r+GILm4;' +++ [[ -n SID=H0v2Cna38Nv/pqvHw0/f6m+a8r+GILm4; ]] +++ echo 'SID=H0v2Cna38Nv/pqvHw0/f6m+a8r+GILm4;' ++ cmd_curl='curl -sk -b SID=H0v2Cna38Nv/pqvHw0/f6m+a8r+GILm4;' ++ cmd_curl_post='curl -sk -b SID=H0v2Cna38Nv/pqvHw0/f6m+a8r+GILm4; -X POST' ++ curl -sk -b 'SID=H0v2Cna38Nv/pqvHw0/f6m+a8r+GILm4;' http://127.0.0.1:8085/api/v2/transfer/speedLimitsMode

devome commented 9 months ago

全局速度限制是你自己设置的,全局速度限制优先于备用速度速度限制。我的脚本不会设置全局速度限制。

sokingshen commented 9 months ago

image 可是我没设置全局速度限制

devome commented 9 months ago

还有一个可能,当你MONITOR_IP不在线时,自然就又关闭备用速度限制了。有些手机在没使用时会断开wifi。

备用速度限制要自己设置好具体的限制值。

sokingshen commented 9 months ago

不可能,我用电脑回复你的,我设置的就是电脑ip,主要手动是一瞬间是切换了备用但不知道为什么又切换回去了。就很奇怪

sokingshen commented 9 months ago

我发现用root权限运行容器是不会切换回去的,但关键是容器似乎不会自动运行这个脚本,必须我手动运行才会切换

devome commented 9 months ago

你可以以qbittorrent这个用户进入容器后docker exec -it -u qbittorrent qbittorrent bashcrontab -edetect-ip &>/dev/null改成detect-ip >> /data/diy/crond.log,然后隔几分钟看看/data/diy/crond.log这个文件。

sokingshen commented 9 months ago

image crontab -e是空的正常吗

devome commented 9 months ago

你这qbittorrent用户没有家里任务,创建容器时就有问题。看看创建时的启动日志在,在Set crontab to system...这行日志前后的信息。

sokingshen commented 9 months ago

Screenshot_2023-10-16-22-42-26-21_a252b927494330cdc2c8ba3b3f952e5e 这个吗?看不出来有啥问题

sokingshen commented 9 months ago

我看目前日志是有这个脚本在运行,但不知道为啥不起作用 ![Uploading Screenshot_2023-10-16-22-47-43-28_a252b927494330cdc2c8ba3b3f952e5e.jpg…]()

devome commented 9 months ago

你以root用户进去看看crontab -l有没有输出。

devome commented 9 months ago

看起来没有问题,用户权限就是root的权限,我测试了也是正常的。

sokingshen commented 9 months ago

明天我重新建个容器再试试看,谢谢了