Fix DNS2 self-updater path and sync live dashboard version UI
This commit is contained in:
@@ -55,7 +55,9 @@ async function handleExec(ws, containerId, log) {
|
||||
if (chunks.length > 0 && Buffer.concat(chunks).toString().includes('/bash')) {
|
||||
shell = '/bin/bash';
|
||||
}
|
||||
} catch (_) {}
|
||||
} catch (_) {
|
||||
// Fall back to /bin/sh when bash detection fails
|
||||
}
|
||||
|
||||
execInstance = await container.exec({
|
||||
Cmd: [shell],
|
||||
@@ -96,21 +98,27 @@ async function handleExec(ws, containerId, log) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (_) {}
|
||||
} catch (_) {
|
||||
// Treat message as raw terminal input if JSON parsing fails
|
||||
}
|
||||
// Regular terminal input
|
||||
execStream.write(data);
|
||||
});
|
||||
|
||||
ws.on('close', () => {
|
||||
if (execStream) {
|
||||
try { execStream.destroy(); } catch (_) {}
|
||||
try { execStream.destroy(); } catch (_) {
|
||||
// Ignore stream teardown errors on socket close
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ws.on('error', (err) => {
|
||||
log.warn('exec', 'WebSocket error', { containerId, error: err.message });
|
||||
if (execStream) {
|
||||
try { execStream.destroy(); } catch (_) {}
|
||||
try { execStream.destroy(); } catch (_) {
|
||||
// Ignore stream teardown errors after websocket errors
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user