Commit Graph

30 Commits

Author SHA1 Message Date
Arvin 3be0915a71 Make clash the primary CLI command 2026-07-30 17:25:15 +08:00
Arvin 58706dbe9d Fix download fallback handling 2026-07-04 21:26:30 +08:00
Larry Hao(郝卓远) 53cff332b9 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.
2026-06-17 22:23:41 +08:00
Arvin 5f30fcdfef Fix multiple shell/container/port bugs (#265 #270 #271 #272 #274 #266)
#265 / #272: systemd_user_available() now requires XDG_RUNTIME_DIR and a
live D-Bus socket before probing systemctl --user, preventing false-positives
in containers (K8s/containerd) where systemctl exists but D-Bus is absent.

#274: Remove 'export' from CLASH_FOR_LINUX_SHELL_LOADED guard in profile.sh
generation so the variable stays local to the sourcing shell and does not
leak into child shells (VSCode terminal, tmux pane, bash subshell), which
was causing alias.sh to be skipped and http_proxy not exported in children.

#270: Ensure compinit is loaded before bashcompinit in the generated zsh
completion script so that compdef is available when bashcompinit registers
completions, fixing 'command not found: compdef' on zsh setups that do not
call compinit themselves.

#271: Extend container_env_type() to detect cgroups v2 + containerd/K8s
environments where /proc/1/cgroup only contains '0::/' and neither
/.dockerenv nor legacy cgroup keywords are present. Detection now also
inspects PID 1 comm and overlay root filesystem as fallbacks.

#266: resolve_runtime_ports() accepts an optional config-file hint; when
MIXED_PORT is not explicitly set in the environment, the port is read from
the config file being normalized. normalize_runtime_config() passes its
target file, so a user's 'mixed-port: 7899' in their subscription YAML is
preserved instead of being silently overwritten with the default 7890.
2026-06-16 16:30:38 +08:00
jawwe a488fc6435 fix dashboard and tun proxy controls 2026-05-22 17:28:42 +08:00
put-go e8e45986a8 fix: 修复局域网代理开关持久化
clashctl lan off 原本只更新 config/template.yaml,但运行配置生成流程会在规范化之后继续应用 runtime/mixin.yaml。

如果已有 mixin override 将 allow-lan 设为 true,最终生成的 runtime/config.yaml 会被重新覆盖为 true,导致 mihomo 仍监听局域网地址。

现在将同一个 allow-lan 值同步写入 runtime mixin override,确保 lan on/off 能保留到最终合并后的运行配置。
2026-05-08 12:06:48 +08:00
yangtaowillv ea04c4da23 feat: add ALLOW-LAN; command: clashctl lan status/on/off 2026-05-07 11:06:48 +08:00
wnlen fae7a75f7d optimize: show fixed progress bar for subscription download 2026-04-29 17:33:26 +08:00
Arvin 45a2628807 fix(tun): rollback tun state on config sync failure and stage runtime config apply #223 2026-04-23 23:54:32 +08:00
Arvin 73d2bc0993 migrate mixin to runtime path with legacy compatibility 2026-04-22 15:57:37 +08:00
Arvin fa13774880 refactor: manage controller secret via env instead of mixin 2026-04-14 23:54:52 +08:00
Arvin a9e58429ef fix: persist install subscription only after successful config generation 2026-04-14 23:18:25 +08:00
Arvin fb3820f733 fix: improve subconverter compatibility with UA and raw-subscription fallback #203 2026-04-14 23:03:13 +08:00
Arvin b0a920cabb Revert "fix: prevent subconverter response handling from hanging #203"
This reverts commit 2e0c10695c.
2026-04-14 21:47:40 +08:00
Arvin 2e0c10695c fix: prevent subconverter response handling from hanging#203 2026-04-14 21:38:50 +08:00
Arvin c752f71b5a fix: apply mixin prepend and append arrays to runtime config 2026-04-14 21:23:28 +08:00
Arvin 8ed03f125a feat: support local subscription import and unblock add on broken active source 2026-04-14 17:04:28 +08:00
Arvin 30187ca50f Update config.sh 2026-04-14 15:47:28 +08:00
Arvin e896097bd5 fix(config): unify subscription download with download_file progress 2026-04-14 12:12:33 +08:00
Arvin ee5fc58ac5 refactor(config): use download_file for HTTP(S) subscription downloads 2026-04-14 11:59:29 +08:00
Arvin af31dc1104 refactor: use download_file for subscription fetch 2026-04-14 11:57:37 +08:00
Arvin ef305f2111 fix: add legacy subscriptions update fallback 2026-04-13 16:16:27 +08:00
Arvin e3d81de323 fix(openwrt): gate bash alias loading in profile 2026-04-12 23:44:09 +08:00
Arvin 77b454d6b6 feat: refine install flow, TUN experience, and command UX 2026-04-12 18:24:35 +08:00
Arvin b11b3bffef refine clashctl main path UX and runtime config flow 2026-04-12 15:59:06 +08:00
Arvin 9025dfb7ff Fix: Converge the clashctl CLI and address issues with subscriptions, UI, and the proxy main link. 2026-04-12 09:37:59 +08:00
Arvin fbd27881f8 fix: force runtime mode to rule during normalization 2026-04-10 14:18:05 +08:00
Arvin f87f53ffe9 Update config.sh 2026-04-09 23:16:52 +08:00
Arvin 3a8d460de7 Add configurable mihomo download source overrides 2026-04-09 13:55:05 +08:00
wnlen bc97b0a2cd refactor: rebuild project architecture and codebase 2026-04-08 15:53:52 +08:00