@deinossrl/dgp-agent 1.4.32 → 1.4.33
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 +10 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -222,7 +222,15 @@ function saveSshKeyLocally(sshPrivateKey) {
|
|
|
222
222
|
|
|
223
223
|
const keyPath = getDgpSshKeyPath();
|
|
224
224
|
// Normalizar saltos de línea
|
|
225
|
-
|
|
225
|
+
let normalizedKey = sshPrivateKey.replace(/\\n/g, '\n').replace(/\r\n/g, '\n');
|
|
226
|
+
|
|
227
|
+
// Verificar si la key tiene los delimitadores BEGIN/END
|
|
228
|
+
if (!normalizedKey.includes('-----BEGIN')) {
|
|
229
|
+
console.log('[!] SSH Key sin delimitadores, agregándolos automáticamente...');
|
|
230
|
+
// Agregar header y footer OpenSSH
|
|
231
|
+
normalizedKey = `-----BEGIN OPENSSH PRIVATE KEY-----\n${normalizedKey}\n-----END OPENSSH PRIVATE KEY-----`;
|
|
232
|
+
}
|
|
233
|
+
|
|
226
234
|
writeFileSync(keyPath, normalizedKey, { mode: 0o600 });
|
|
227
235
|
|
|
228
236
|
return keyPath;
|
|
@@ -321,7 +329,7 @@ function getPlinkPath() {
|
|
|
321
329
|
}
|
|
322
330
|
|
|
323
331
|
// Versión del agente
|
|
324
|
-
const AGENT_VERSION = '1.4.
|
|
332
|
+
const AGENT_VERSION = '1.4.33';
|
|
325
333
|
let AGENT_MODE = 'smart'; // Siempre inteligente
|
|
326
334
|
|
|
327
335
|
// Configuración (prioridad: env vars > archivo config > platform config > defaults)
|