Simple-Tracker / qBittorrent-ClientBlocker

一款适用于 qBittorrent/Transmission (Beta)/BitComet (Beta, Partial) 的客户端屏蔽器, 默认屏蔽包括但不限于迅雷等客户端. A client blocker compatible with qBittorrent/Transmission (Beta)/BitComet (Beta, Partial) which is prohibited to include but not limited to clients such as Xunlei.
MIT License
976 stars 25 forks source link

关于群晖7.1.1 docker使用认证失败的问题 #80

Closed leosejin closed 2 months ago

leosejin commented 3 months ago

首先感谢您为BT做出的贡献! 使用情况: 黑群晖7.1.1 使用docker运行,版本号拉取的latest

问题描述: 配置文件中填入Transmission的URL和Username、Password之后运行程序,日志报错认证失败,确定信息填写正确

作出的尝试: 1.更改为Qbit配置文件之后问题仍然存在且报错一样 2.更换其他程序版本 例如3.4b2,问题依旧 3.URL更换为http://127.0.0.1、localhost和群晖自身IP都无法解决登陆认证问题

image image image image
{
    "debug": true,
    "interval": 6,
    "cleanInterval": 3600,
    "banTime": 86400,
    "timeout": 6,
    "logPath": "logs",
    "logToFile": true,
    "clientType": "Transmission",
    "clientURL": "http://192.168.x.x:8085",
    "clientUsername": "admin",
    "clientPassword": "xxx",
    "skipCertVerification": true,
    "blockList": [
        "^-(SD|XF|QD|BN|DL)",
        "^-XL(?!0019)", "Xunlei(?! ?0019)", "cacao_torrent",
        "anacrolix[ /]torrent v?([0-1]\\.(([0-9]|[0-4][0-9]|[0-5][0-2])\\.[0-9]+|(53\\.[0-2]( |$)))|unknown)",
        "^-DT", "dt[ /]torrent", "^-HP", "hp[ /]torrent",
        "trafficConsume", "\u07ad__",
        "^-GT0002", "go[ \\.]torrent",
        "Taipei-Torrent dev",
        "qBittorrent[ /]3\\.3\\.15",
        "gobind", "offline-download",
        "ljyun.cn"
    ],
    "ipBlockList": [
        // Credit: https://docs.qq.com/doc/DQnJBTGJjSFZBR2JW.
        "1.180.24.0/23",
        "36.102.218.0/24",
        "112.45.16.0/24",
        "112.45.20.0/24",
        "122.224.33.0/24",
        "123.184.152.0/24",
        "218.7.138.0/24",
        "221.11.96.0/24",
        "221.203.3.0/24",
        "221.203.6.0/24",
        "223.78.79.0/24",
        "223.78.80.0/24",
        "2002:df4e:4f00::/48",
        "2002:df4e:5000::/48",
        "2408:862e:ff:ff0d::/60",
        "2408:8631:2e09:d05::/60",
        "2408:8738:6000:d::/60",
        "2409:873c:f03:6000::/56",
        "240e:90c:2000:301::/60",
        "240e:90e:2000:2006::/60",
        "240e:918:8008::/48"
    ],
    "_blockList": [
        // 可选 blockList, 合并以屏蔽媒体播放器.
        "^-UW\\w{4}-", // uTorrent Web.
        "^-SP(([0-2]\\d{3})|(3[0-5]\\d{2}))-", "StellarPlayer", // 恒星播放器.
        "dandanplay" // 弹弹 Play.
    ]
}
Simple-Tracker commented 3 months ago

感谢反馈!

Login 部分若提示登录时发生错误, 但没有详细信息, 意味着它依赖的其它部分发生了错误, 可尝试搜寻这些错误, 它应该早于 Login 被提示.

Simple-Tracker commented 3 months ago

另外, 对于 Transmission, 若使用认证, 须启用 useBasicAuth.

leosejin commented 3 months ago

感谢您的积极回复。 1.返回认证失败的前面没有发现日志的其他报错信息,详细内容贴在下面,且查看logs文件里只有认证失败。在修改useBasicAuth之后返回301; 2.在config.json中添加了useBasicAuth,设置为打开后依旧认证失败。

image image image image
Simple-Tracker commented 3 months ago

这是由于 ClientURL 设置错误导致的 301 重定向. 对于 qBittorrent, Web UI/Web API 有多个端点, 因此地址是一个无法修改的固定入口, 而对于 Transmission 则应指定 RPC 地址 (也由于 Transmission RPC 相关文档建议允许自定义 RPC 地址).

这一方面有一些行为差异, 未来可能会进行优化以统一行为.

Simple-Tracker commented 2 months ago

在下一版本中将统一为 Web API 或 RPC 地址, 为保持向下兼容, 原 qBittorrent 所使用 Web UI 地址仍可用, 但用户将收到改动提醒.

nekolr commented 2 months ago

群晖 7.2.1 docker 启动同样遇到了该问题,之前都是正常使用的,更新了最新的镜像错误依旧。

qbittorrent 版本 qBittorrent v4.3.9

2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][RunConsole] 认证失败.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][Login] 登录时发生了错误.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][Submit] 请求时发生了错误: 资源不存在.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][Debug-LoadConfig_CompileBlockList] trafficConsume.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][Debug-LoadConfig_CompileBlockList] dt[ /]torrent.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][Debug-LoadConfig_CompileBlockList] ^-DT.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][Debug-LoadConfig_CompileBlockList] anacrolix[ /]torrent v?([0-1]\.(([0-9]|[0-4][0-9]|[0-5][0-2])\.[0-9]+|(53\.[0-2]( |$)))|unknown).
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][Debug-LoadConfig_CompileBlockList] dandanplay.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][Debug-LoadConfig_CompileBlockList] StellarPlayer.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][Debug-LoadConfig_CompileBlockList] ^-(UW\w{4}|SP(([0-2]\d{3})|(3[0-5]\d{2})))-.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][Debug-LoadConfig_CompileBlockList] ((^(Xunlei)? *?\d+\.\d+\.\d+\.\d+)|cacao_torrent).
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][Debug-LoadConfig_CompileBlockList] ^-(XL|SD|XF|QD|BN|DL)(\d+)-.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] BanByRelativePUAntiErrorRatio: 3.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] BanByRelativePUStartPrecent: 2.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] BanByRelativePUStartMB: 20.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] BanByRelativeProgressUploaded: false.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] BanByPUAntiErrorRatio: 3.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] BanByPUStartPrecent: 2.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] BanByPUStartMB: 20.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] BanByProgressUploaded: false.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] MaxIPPortCount: 0.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] IPUpCheckPerTorrentRatio: 3.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] IPUpCheckIncrementMB: 38000.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] IPUpCheckInterval: 300.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] IPUploadedCheck: false.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] GenIPDat: 0.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] IgnoreByDownloaded: 100.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] IPBlockListFile: .
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] IPBlockListURL: .
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] IPBlockList: [].
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] PortBlockList: [].
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] BlockListFile: .
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] BlockListURL: .
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] BlockList: [^-(XL|SD|XF|QD|BN|DL)(\d+)- ((^(Xunlei)? *?\d+\.\d+\.\d+\.\d+)|cacao_torrent) ^-(UW\w{4}|SP(([0-2]\d{3})|(3[0-5]\d{2})))- StellarPlayer dandanplay anacrolix[ /]torrent v?([0-1]\.(([0-9]|[0-4][0-9]|[0-5][0-2])\.[0-9]+|(53\.[0-2]( |$)))|unknown) ^-DT dt[ /]torrent trafficConsume].
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] SyncServerToken: .
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] SyncServerURL: .
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] ExecCommand_Unban: .
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] ExecCommand_Ban: .
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] ExecCommand_Run: .
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] ExecCommand_FetchFailed: .
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] FetchFailedThreshold: 0.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] SkipCertVerification: true.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] UseBasicAuth: false.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] ClientPassword: XXXXXXXXX
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] ClientUsername: XXXXXXXXX.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] ClientURL: http://172.17.0.1:8002.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] ClientType: qBittorrent.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] Listen: :26262.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] LogDebug: false.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] LogToFile: true.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] LogPath: logs.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] LongConnection: true.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] Timeout: 6.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] SleepTime: 20.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] IgnorePTTorrent: true.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] IgnoreNoLeechersTorrent: true.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] IgnoreEmptyPeer: true.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] BanIP6CIDR: /128.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] BanIPCIDR: /32.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] BanAllPort: false.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] BanTime: 86400.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] TorrentMapCleanInterval: 60.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] UpdateInterval: 86400.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] CleanInterval: 3600.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] Interval: 6.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] Debug_CheckPeer: false.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] Debug_CheckTorrent: false.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] Debug: true.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig_Current] CheckUpdate: true.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][LoadConfig] 加载配置文件 (config.json) 成功.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][PrepareEnv] 切换工作目录: /app.
2024/07/19 09:18:37 stdout  [2024-07-19 01:18:37][ShowVersion] qBittorrent-ClientBlocker 3.4p4 (linux, amd64). 
Simple-Tracker commented 2 months ago

2024/07/19 09:18:37 stdout [2024-07-19 01:18:37][LoadConfig_Current] ClientURL:

测试已定位到问题, 在设置 clientType 为特定值时, 不会自动检测 URL 类型的更改. 由于新版本使用 Web API (http://172.17.0.1:8002/api) 而非 Web UI 地址 (http://172.17.0.1:8002). 可尝试手动修改 clientURL 或清空 clientType 作为缓解方案.

将修改为新版本 (3.4p5) 在设置 clientType 后仍会进行检测客户端, 但不会根据检测结果改写 clientType.

nekolr commented 2 months ago

2024/07/19 09:18:37 stdout [2024-07-19 01:18:37][LoadConfig_Current] ClientURL:

测试已定位到问题, 在设置 clientType 为特定值时, 不会自动检测 URL 类型的更改. 由于新版本使用 Web API (http://172.17.0.1:8002/api) 而非 Web UI 地址 (http://172.17.0.1:8002). 可尝试手动修改 clientURL 或清空 clientType 作为缓解方案.

将修改为新版本 (3.4p5) 在设置 clientType 后仍会进行检测客户端, 但不会根据检测结果改写 clientType.

在 3.4p4 版本手动修改为 Web API 后没问题了,使用 3.4p5 版本,改回 Web UI 也可以正常运行并收到修改提示。Thanks!