mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-07 00:16:57 +08:00
fix(checks): update regex for proxy string to support socks proxy (#6236)
This commit is contained in:
@@ -430,13 +430,13 @@ def _check_config(runner: DoctorRunnerProtocol) -> None:
|
|||||||
)
|
)
|
||||||
|
|
||||||
proxy_host = (settings.PROXY_HOST or "").strip()
|
proxy_host = (settings.PROXY_HOST or "").strip()
|
||||||
if proxy_host and not re.match(r"^https?://", proxy_host, re.IGNORECASE):
|
if proxy_host and not re.match(r"^(https?|socks5h?)://", proxy_host, re.IGNORECASE):
|
||||||
runner.add(
|
runner.add(
|
||||||
finding_id="config.proxy_format",
|
finding_id="config.proxy_format",
|
||||||
severity=DoctorSeverity.Warn,
|
severity=DoctorSeverity.Warn,
|
||||||
status=DoctorFindingStatus.Degraded,
|
status=DoctorFindingStatus.Degraded,
|
||||||
title="代理地址格式可能不完整",
|
title="代理地址格式可能不完整",
|
||||||
detail=f"PROXY_HOST={proxy_host} 未包含 http:// 或 https:// 前缀。",
|
detail=f"PROXY_HOST={proxy_host} 未包含 http:// 或 https:// 或 socks5:// 或 socks5h:// 前缀。",
|
||||||
recommendation="如果外部访问异常,请把 PROXY_HOST 调整为完整 URL。",
|
recommendation="如果外部访问异常,请把 PROXY_HOST 调整为完整 URL。",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user