@deinossrl/dgp-agent 1.4.20 → 1.4.21
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 +7 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -203,7 +203,7 @@ async function fetchPlatformConfig() {
|
|
|
203
203
|
let platformConfig = null;
|
|
204
204
|
|
|
205
205
|
// Versión del agente
|
|
206
|
-
const AGENT_VERSION = '1.4.
|
|
206
|
+
const AGENT_VERSION = '1.4.21';
|
|
207
207
|
let AGENT_MODE = 'smart'; // Siempre inteligente
|
|
208
208
|
|
|
209
209
|
// Configuración (prioridad: env vars > archivo config > platform config > defaults)
|
|
@@ -1036,7 +1036,9 @@ async function executeDeploy(command) {
|
|
|
1036
1036
|
const fs = await import('fs');
|
|
1037
1037
|
const path = await import('path');
|
|
1038
1038
|
sshKeyPath = path.join(os.tmpdir(), `dgp_deploy_key_${Date.now()}`);
|
|
1039
|
-
|
|
1039
|
+
// Normalizar saltos de línea (pueden venir como \n literal del JSON)
|
|
1040
|
+
const normalizedKey = sshPrivateKey.replace(/\\n/g, '\n').replace(/\r\n/g, '\n');
|
|
1041
|
+
fs.writeFileSync(sshKeyPath, normalizedKey, { mode: 0o600 });
|
|
1040
1042
|
sshOptions = `-e "ssh -i ${sshKeyPath} -o StrictHostKeyChecking=no"`;
|
|
1041
1043
|
}
|
|
1042
1044
|
|
|
@@ -1311,7 +1313,9 @@ async function executeTestConnection(command) {
|
|
|
1311
1313
|
const fs = await import('fs');
|
|
1312
1314
|
const path = await import('path');
|
|
1313
1315
|
sshKeyPath = path.join(os.tmpdir(), `dgp_test_key_${Date.now()}`);
|
|
1314
|
-
|
|
1316
|
+
// Normalizar saltos de línea (pueden venir como \n literal del JSON)
|
|
1317
|
+
const normalizedKey = sshPrivateKey.replace(/\\n/g, '\n').replace(/\r\n/g, '\n');
|
|
1318
|
+
fs.writeFileSync(sshKeyPath, normalizedKey, { mode: 0o600 });
|
|
1315
1319
|
logInfo('SSH Key: Usando clave desde plataforma');
|
|
1316
1320
|
await addCommandLog('info', 'Usando SSH key configurada en la plataforma');
|
|
1317
1321
|
}
|