Skip to content

v1.4.2

Choose a tag to compare

@cn0xroot cn0xroot released this 16 Sep 14:50
· 88 commits to master since this release

修复

  • npm run electron 在 root 下无法启动:Chromium 在原生启动阶段就会检查是否
    以 root 身份运行且没带 --no-sandbox,不满足直接 FATAL 退出——这个检查比
    electron-main.js 里任何 JS 代码都先执行,运行时用 app.commandLine. appendSwitch() 加这个开关完全没用,必须在真正 spawn electron 二进制那一刻
    的进程参数(argv)里就带上。解决这层后又暴露第二层:GPU 进程有自己独立的
    沙箱,root 下同样会失败(GPU process isn't usable. Goodbye.),还得加
    --disable-gpu-sandbox。新增了一个小 launcher 脚本(webui/scripts/ electron-start.js),按 process.getuid() 判断身份,只有真的是 root 时才
    附加这两个开关,非 root 用户运行时完整沙箱保护不受任何影响。已在当前 root
    环境下用 wmctrl/xdotool 验证真实起了标题为 "CC-Monitor" 的独立窗口。

English

Fixed

  • npm run electron failed to launch under root: Chromium checks whether it's
    running as root without --no-sandbox at native startup and FATAL-exits if so —
    this check runs before any JS in electron-main.js executes, so setting the flag
    at runtime via app.commandLine.appendSwitch() does nothing; it has to be present
    in the actual process argv at the moment the electron binary is spawned. Fixing
    that surfaced a second layer: the GPU process has its own independent sandbox and
    fails the same way under root (GPU process isn't usable. Goodbye.), requiring
    --disable-gpu-sandbox as well. Added a small launcher script
    (webui/scripts/electron-start.js) that checks process.getuid() and only
    appends these two flags when actually running as root — non-root users keep the
    full sandbox untouched. Verified under the current root environment with
    wmctrl/xdotool that a real window titled "CC-Monitor" comes up.

完整更新日志见 CHANGELOG.md (English)。