fix(network): wired ping probe, AP/WS and systemd notify hardening

- Add hasWiredInternetProbe and export; AP mode uses it with hasInternet
- systemd-env: strip NOTIFY_SOCKET from env early; client uses unix_dgram
- Strip NOTIFY_SOCKET from frpc/ttyd spawn env in watchdog and frpc
- WS: pong miss debounce; AP net monitor consecutive-fail debounce

Made-with: Cursor
This commit is contained in:
stswangzhiping
2026-03-28 14:37:56 +08:00
parent 402440aadc
commit 04dd1017bb
6 changed files with 116 additions and 24 deletions

View File

@@ -124,9 +124,12 @@ async function startTtyd() {
const shell = fs.existsSync('/bin/bash') ? '/bin/bash' : '/bin/sh';
// 以普通用户身份启动 shell与 SSH 登录一致)
const ttydUser = process.env.CLAWD_TTY_USER || 'sts';
const ttyEnv = { ...process.env };
delete ttyEnv.NOTIFY_SOCKET;
const proc = spawn(TTYD_BIN, ['-p', String(TTYD_PORT), '-i', '127.0.0.1', '-W', '-t', 'cursorBlink=true', '/bin/su', '-', ttydUser], {
stdio: 'ignore',
detached: true,
env: ttyEnv,
});
proc.unref();
log.info('ttyd', `已启动,端口 ${TTYD_PORT},用户=${ttydUser}`);