sync: update from private repo (11e2d76)
CI / build-and-test (push) Has been cancelled

This commit is contained in:
oss-sync
2026-06-08 08:43:20 +00:00
parent ee062050e0
commit ef44e1a5d9
3 changed files with 61 additions and 12 deletions
+22 -6
View File
@@ -108,14 +108,30 @@ export class SessionManager extends EventEmitter {
}
static isAvailable(): boolean {
try {
execSync('which Xvfb', { stdio: 'ignore' });
execSync('which x11vnc', { stdio: 'ignore' });
execSync('which websockify', { stdio: 'ignore' });
return true;
} catch {
// Use the POSIX shell builtin `command -v`, NOT the external `which` binary.
// `which` is absent in some minimal images (e.g. debian-slim dropped it from
// debianutils) and depends on PATH; relying on it caused "deps missing →
// headless fallback" even when Xvfb/x11vnc/websockify were actually installed.
// `command -v` is built into /bin/sh, so execSync (which runs via `/bin/sh -c`)
// resolves each binary from the server process's own PATH.
const required = ['Xvfb', 'x11vnc', 'websockify'];
const missing: string[] = [];
for (const bin of required) {
try {
execSync(`command -v ${bin}`, { stdio: 'ignore' });
} catch {
missing.push(bin);
}
}
if (missing.length > 0) {
logger.warn(
`[SessionManager] noVNC display stack unavailable; not found on the server PATH: ${missing.join(', ')}. ` +
`Browser/CAPTCHA live view (display_mode: novnc) falls back to headless. ` +
`Install them (scripts/setup-novnc.sh) and ensure they are on the server process's PATH.`,
);
return false;
}
return true;
}
private cleanupOrphanedProcesses(): void {