@fabioplunser/epd 0.5.8 → 0.5.9
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/dist/cli.js +8 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2521,7 +2521,7 @@ true`, { allowFailure: true, stream: true, label: `${host.name}: install package
|
|
|
2521
2521
|
}
|
|
2522
2522
|
|
|
2523
2523
|
// src/core/ssh.ts
|
|
2524
|
-
import { existsSync as existsSync5, mkdirSync as mkdirSync4, writeFileSync as writeFileSync4 } from "fs";
|
|
2524
|
+
import { chmodSync as chmodSync2, existsSync as existsSync5, mkdirSync as mkdirSync4, writeFileSync as writeFileSync4 } from "fs";
|
|
2525
2525
|
import { tmpdir } from "os";
|
|
2526
2526
|
import { join as join5 } from "path";
|
|
2527
2527
|
var controlDir = join5(tmpdir(), `epd-${process.getuid?.() ?? 0}`);
|
|
@@ -2610,6 +2610,7 @@ class Host {
|
|
|
2610
2610
|
try {
|
|
2611
2611
|
writeFileSync4(keyPath, rawEnvKey.trim() + `
|
|
2612
2612
|
`, { mode: 384 });
|
|
2613
|
+
chmodSync2(keyPath, 384);
|
|
2613
2614
|
} catch {}
|
|
2614
2615
|
} else if (existsSync5(rawEnvKey)) {
|
|
2615
2616
|
keyPath = rawEnvKey;
|
|
@@ -2724,7 +2725,10 @@ mv -f ${shq(path)}.tmp ${shq(path)}`, { label: `${this.name}: write ${path}` });
|
|
|
2724
2725
|
async ping() {
|
|
2725
2726
|
const res = await this.exec("echo epd-ok", { allowFailure: true, sudo: false });
|
|
2726
2727
|
if (res.code !== 0 || !res.stdout.includes("epd-ok")) {
|
|
2727
|
-
|
|
2728
|
+
const isPublickey = res.stderr.includes("Permission denied (publickey)");
|
|
2729
|
+
const hint = isPublickey ? "SSH key authentication failed. Ensure the SSH key is in ~/.ssh/authorized_keys on the server and has NO passphrase (passphrases cannot be entered in non-interactive CI)." : res.stderr || "Check that the host is up and your SSH key is authorized.";
|
|
2730
|
+
throw new EpdError(`cannot reach ${this.target}:${this.cfg.port}`, res.stderr ? `${res.stderr}
|
|
2731
|
+
${hint}` : hint);
|
|
2728
2732
|
}
|
|
2729
2733
|
}
|
|
2730
2734
|
}
|
|
@@ -6996,7 +7000,7 @@ function stripAnsi2(str) {
|
|
|
6996
7000
|
}
|
|
6997
7001
|
|
|
6998
7002
|
// src/core/update.ts
|
|
6999
|
-
import { chmodSync as
|
|
7003
|
+
import { chmodSync as chmodSync3, existsSync as existsSync10, mkdirSync as mkdirSync6, readFileSync as readFileSync7, renameSync, writeFileSync as writeFileSync6 } from "fs";
|
|
7000
7004
|
import { homedir as homedir4 } from "os";
|
|
7001
7005
|
import { dirname as dirname3, join as join9 } from "path";
|
|
7002
7006
|
function parseSemver(v) {
|
|
@@ -7102,7 +7106,7 @@ async function performUpdate(targetVersion) {
|
|
|
7102
7106
|
const buf = await res.arrayBuffer();
|
|
7103
7107
|
const tmpPath = `${execPath}.tmp.${Date.now()}`;
|
|
7104
7108
|
writeFileSync6(tmpPath, Buffer.from(buf));
|
|
7105
|
-
|
|
7109
|
+
chmodSync3(tmpPath, 493);
|
|
7106
7110
|
renameSync(tmpPath, execPath);
|
|
7107
7111
|
return true;
|
|
7108
7112
|
}
|
package/package.json
CHANGED