Update server.cjs

Redact only sensitive info for logging
This commit is contained in:
Dale Driver
2025-03-07 21:39:10 -08:00
committed by GitHub
parent 09677caa26
commit b75ffad643

View File

@@ -23,7 +23,16 @@ io.on("connection", (socket) => {
return; return;
} }
console.log("Received hostConfig:", hostConfig); // Redact only sensitive info for logging
const safeHostConfig = {
ip: hostConfig.ip,
port: hostConfig.port,
user: hostConfig.user,
password: hostConfig.password ? '***REDACTED***' : undefined,
rsaKey: hostConfig.rsaKey ? '***REDACTED***' : undefined,
};
console.log("Received hostConfig:", safeHostConfig);
const { ip, port, user, password, rsaKey } = hostConfig; const { ip, port, user, password, rsaKey } = hostConfig;
const conn = new SSHClient(); const conn = new SSHClient();