@fabioplunser/epd 0.5.8 → 0.5.10
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 +10 -6
- 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;
|
|
@@ -2715,7 +2716,7 @@ mv -f ${shq(path)}.tmp ${shq(path)}`, { label: `${this.name}: write ${path}` });
|
|
|
2715
2716
|
const local = localCommand.map((a) => shq(a)).join(" ");
|
|
2716
2717
|
const source = password ? `{ printf '%s\\n' "$EPD_SUDO_PW"; ${local}; }` : local;
|
|
2717
2718
|
const script = `set -euo pipefail; ${source} | ${sshArgs.map((a) => shq(a)).join(" ")}`;
|
|
2718
|
-
await run(["
|
|
2719
|
+
await run(["bash", "-c", script], {
|
|
2719
2720
|
stream: true,
|
|
2720
2721
|
label: `pipe \u2192 ${this.name}`,
|
|
2721
2722
|
env: password ? { EPD_SUDO_PW: password } : undefined
|
|
@@ -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
|
}
|
|
@@ -4108,7 +4112,7 @@ async function ensureImage(host, cfg, version) {
|
|
|
4108
4112
|
await host.exec(`docker pull ${shq(ref)} >/dev/null`, { label: `${host.name}: docker pull` });
|
|
4109
4113
|
} else {
|
|
4110
4114
|
log.host(host.name, `shipping ${ref} over ssh (no registry configured)`);
|
|
4111
|
-
await host.pipeInto("gunzip | docker load", ["
|
|
4115
|
+
await host.pipeInto("gunzip | docker load", ["bash", "-c", `docker save ${shq(ref)} | gzip -1`]);
|
|
4112
4116
|
}
|
|
4113
4117
|
}
|
|
4114
4118
|
async function pruneImages(host, cfg, keep, inUse) {
|
|
@@ -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