Repository navigation
v1.4.2
修复
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 electronfailed to launch under root: Chromium checks whether it's
running as root without--no-sandboxat native startup and FATAL-exits if so —
this check runs before any JS inelectron-main.jsexecutes, so setting the flag
at runtime viaapp.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-sandboxas well. Added a small launcher script
(webui/scripts/electron-start.js) that checksprocess.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/xdotoolthat a real window titled "CC-Monitor" comes up.
完整更新日志见 CHANGELOG.md (English)。