mirror of
https://github.com/wnlen/clash-for-linux.git
synced 2026-10-10 04:03:04 +08:00
fix(config): 规范化时剥离 subconverter 注入的 port/socks-port/redir-port,只保留 mixed-port (#276)
* fix(config): drop subconverter-injected port/socks-port/redir-port so only mixed-port is kept The bundled subconverter base templates hard-code a static listener block (port/socks-port/redir-port, with socks-port=7891). normalize_runtime_config only rewrites mixed-port and leaves that block in the generated config, while resolve_runtime_ports does not know those ports exist. On a busy shared host where 7890 is already taken, the auto-resolver shifts mixed-port to 7891 and it collides with the injected socks-port=7891. mihomo then binds socks on 7891 and silently fails to bind the mixed (http) listener, so the port clashctl exports as http_proxy has no HTTP handler and every request dies with "curl: (56) Proxy CONNECT aborted". Strip the legacy listener keys during normalization so the framework's single auto-managed mixed-port is the only proxy listener, which is what the default template already intends. * refactor(config): consolidate legacy port deletion into a single del() call Addresses Copilot review feedback on #276. Verified the bundled yq v4.52.4 supports deleting multiple paths in one del() expression.
This commit is contained in:
@@ -839,6 +839,7 @@ normalize_runtime_config() {
|
|||||||
dns_listen_value="0.0.0.0:${dns_port_value}" \
|
dns_listen_value="0.0.0.0:${dns_port_value}" \
|
||||||
"$(yq_bin)" eval -i '
|
"$(yq_bin)" eval -i '
|
||||||
.["mixed-port"] = (env(mixed_port) | tonumber) |
|
.["mixed-port"] = (env(mixed_port) | tonumber) |
|
||||||
|
del(.port, .["socks-port"], .["redir-port"], .["tproxy-port"]) |
|
||||||
.["external-controller"] = env(controller) |
|
.["external-controller"] = env(controller) |
|
||||||
.secret = env(controller_secret_value) |
|
.secret = env(controller_secret_value) |
|
||||||
.["external-ui"] = env(dashboard_dir_value) |
|
.["external-ui"] = env(dashboard_dir_value) |
|
||||||
|
|||||||
Reference in New Issue
Block a user