feat(client+scripts): release 本地真测 — local_test.sh + 内核查找加 /opt/homebrew
ci-pangolin / Lint — shellcheck (push) Has been cancelled
ci-pangolin / OpenAPI Sync Check (push) Has been cancelled
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (push) Has been cancelled
ci-pangolin / Flutter — analyze + test (push) Has been cancelled

- scripts/local_test.sh:一键构建 release macOS 包 + 配 sing-box 免密 sudoers
  (TUN 需 root)+ 前台运行真身(日志直出),让本地测试 = release 线上行为
- kernel_process 二进制查找兜底加 /opt/homebrew/bin/sing-box(Apple Silicon
  brew),release 包从 Finder/直接启动也能找到内核,免设 PANGOLIN_SINGBOX_BIN

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-06-18 21:09:08 +08:00
parent 81e7b12061
commit 25c7bd75aa
2 changed files with 64 additions and 4 deletions
+9 -4
View File
@@ -11,7 +11,8 @@
// 2. <executable dir>/sing-box (或 .exe)
// 3. <executable dir>/../../Resources/sing-box (macOS .app bundle)
// 4. <project>/app/kernel/dist/desktop/<os>-<arch>/sing-box (开发目录)
// 5. /usr/local/bin/sing-box
// 5. /opt/homebrew/bin/sing-box (Apple Silicon brew)
// 6. /usr/local/bin/sing-box (Intel brew / Linux)
// · 配置 Clash API 端口: 由 spawn 调用方(DesktopVpnBridge)写入配置,
// 或从配置文件读 experimental.clash_api.external_controller
//
@@ -601,9 +602,13 @@ class DesktopKernelProcess implements KernelProcess {
}
}
// 系统 PATH 兜底
const fallback = '/usr/local/bin/sing-box';
if (await File(fallback).exists()) return fallback;
// 系统常见安装路径兜底(Apple Silicon brew / Intel·Linux brew)
for (final fallback in const [
'/opt/homebrew/bin/sing-box',
'/usr/local/bin/sing-box',
]) {
if (await File(fallback).exists()) return fallback;
}
throw FileSystemException(
'sing-box binary not found. '