@deinossrl/dgp-agent 1.4.33 → 1.4.34
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 +14 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -231,7 +231,19 @@ function saveSshKeyLocally(sshPrivateKey) {
|
|
|
231
231
|
normalizedKey = `-----BEGIN OPENSSH PRIVATE KEY-----\n${normalizedKey}\n-----END OPENSSH PRIVATE KEY-----`;
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
-
writeFileSync(keyPath, normalizedKey
|
|
234
|
+
writeFileSync(keyPath, normalizedKey);
|
|
235
|
+
|
|
236
|
+
// Establecer permisos 600 (solo owner puede leer/escribir)
|
|
237
|
+
try {
|
|
238
|
+
chmodSync(keyPath, 0o600);
|
|
239
|
+
} catch (e) {
|
|
240
|
+
// En Windows puede fallar, intentar con comando nativo
|
|
241
|
+
if (process.platform === 'win32') {
|
|
242
|
+
try {
|
|
243
|
+
shellSync(`icacls "${keyPath}" /inheritance:r /grant:r "%USERNAME%:RW"`);
|
|
244
|
+
} catch {}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
235
247
|
|
|
236
248
|
return keyPath;
|
|
237
249
|
} catch (e) {
|
|
@@ -329,7 +341,7 @@ function getPlinkPath() {
|
|
|
329
341
|
}
|
|
330
342
|
|
|
331
343
|
// Versión del agente
|
|
332
|
-
const AGENT_VERSION = '1.4.
|
|
344
|
+
const AGENT_VERSION = '1.4.34';
|
|
333
345
|
let AGENT_MODE = 'smart'; // Siempre inteligente
|
|
334
346
|
|
|
335
347
|
// Configuración (prioridad: env vars > archivo config > platform config > defaults)
|