@deinossrl/dgp-agent 1.4.31 → 1.4.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.mjs +8 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -321,7 +321,7 @@ function getPlinkPath() {
|
|
|
321
321
|
}
|
|
322
322
|
|
|
323
323
|
// Versión del agente
|
|
324
|
-
const AGENT_VERSION = '1.4.
|
|
324
|
+
const AGENT_VERSION = '1.4.32';
|
|
325
325
|
let AGENT_MODE = 'smart'; // Siempre inteligente
|
|
326
326
|
|
|
327
327
|
// Configuración (prioridad: env vars > archivo config > platform config > defaults)
|
|
@@ -1482,9 +1482,10 @@ async function executeTestConnection(command) {
|
|
|
1482
1482
|
}
|
|
1483
1483
|
}
|
|
1484
1484
|
await addCommandLog('info', `Usando plink: ${plinkPath}`);
|
|
1485
|
-
//
|
|
1486
|
-
const
|
|
1487
|
-
|
|
1485
|
+
// Crear archivo temporal con respuesta "y" para auto-aceptar host key
|
|
1486
|
+
const tempFile = join(CONFIG_DIR, 'plink_input.txt');
|
|
1487
|
+
writeFileSync(tempFile, 'y\n');
|
|
1488
|
+
sshCmd = `cmd /c "type "${tempFile}" | "${plinkPath}" -ssh -pw "${sshPassword}" ${user}@${server_host} "echo SSH_OK && hostname && whoami""`;
|
|
1488
1489
|
} else {
|
|
1489
1490
|
// En Linux/Mac usar sshpass
|
|
1490
1491
|
await addCommandLog('info', 'Usando sshpass (Linux/Mac)');
|
|
@@ -1512,8 +1513,9 @@ async function executeTestConnection(command) {
|
|
|
1512
1513
|
throw new Error('No se pudo descargar plink. Instalá PuTTY manualmente o usá SSH Key.');
|
|
1513
1514
|
}
|
|
1514
1515
|
}
|
|
1515
|
-
const
|
|
1516
|
-
|
|
1516
|
+
const tempFile = join(CONFIG_DIR, 'plink_input.txt');
|
|
1517
|
+
writeFileSync(tempFile, 'y\n');
|
|
1518
|
+
sshCmd = `cmd /c "type "${tempFile}" | "${plinkPath}" -ssh -pw "${sshPassword}" ${user}@${server_host} "echo SSH_OK && hostname && whoami""`;
|
|
1517
1519
|
} else {
|
|
1518
1520
|
sshCmd = `sshpass -p "${sshPassword}" ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 ${user}@${server_host} "echo 'SSH_OK' && hostname && whoami"`;
|
|
1519
1521
|
}
|