openship 0.6.7 → 0.6.8

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.
Files changed (67) hide show
  1. package/dist/bare-FA66N7GC.js +29 -0
  2. package/dist/{chunk-LHFXSC36.js → chunk-3MP6ACKM.js} +183 -87
  3. package/dist/{chunk-MEE6OZFP.js → chunk-5DJOB7IX.js} +3 -3
  4. package/dist/{chunk-PPEBIY5F.js → chunk-5I3COAFH.js} +35 -12
  5. package/dist/{chunk-VQM6JHJB.js → chunk-5UXHT6ED.js} +9 -9
  6. package/dist/{chunk-XWHWTHEL.js → chunk-6GU6JSK6.js} +21 -2
  7. package/dist/{chunk-QHMDCYZ3.js → chunk-7PEXM2UI.js} +213 -45
  8. package/dist/{chunk-RDXT4BQB.js → chunk-7YBWXEM6.js} +4 -4
  9. package/dist/{chunk-H4FS5BED.js → chunk-AHJYP7DG.js} +13 -11
  10. package/dist/{chunk-VSTFHUCV.js → chunk-BO6CY4V2.js} +109 -23
  11. package/dist/{chunk-J3K6XABC.js → chunk-D3OEMXYP.js} +3 -3
  12. package/dist/{chunk-UWEV6XTS.js → chunk-D6HU4VUZ.js} +1 -1
  13. package/dist/{chunk-S6B2Z3OO.js → chunk-ENKJ7XIF.js} +21 -11
  14. package/dist/{chunk-BLEXTYRK.js → chunk-GNOMEMNI.js} +1 -1
  15. package/dist/{chunk-NRTJRNAE.js → chunk-IAMOUDHY.js} +138 -54
  16. package/dist/{chunk-CIJV43LH.js → chunk-MUWVC5R4.js} +161 -39
  17. package/dist/{chunk-ZPJ74LXE.js → chunk-NIYD7MD2.js} +197 -45
  18. package/dist/{chunk-FZ6QCF6B.js → chunk-NPSRGIHV.js} +2 -2
  19. package/dist/{chunk-2GWYYHOR.js → chunk-NRU2EBYZ.js} +2 -2
  20. package/dist/{chunk-J2XM3QSP.js → chunk-NUT6HKK6.js} +5 -5
  21. package/dist/{chunk-H3WT3A6R.js → chunk-P7RCYELG.js} +1 -1
  22. package/dist/{chunk-FYPFEDPZ.js → chunk-R5DC5PEF.js} +1 -1
  23. package/dist/{chunk-DDFUESPJ.js → chunk-RCMERVBL.js} +9 -9
  24. package/dist/{chunk-RXQBD4ZY.js → chunk-RHLNVZMS.js} +2 -2
  25. package/dist/{chunk-WU54BXFE.js → chunk-SK4FFCFR.js} +1 -1
  26. package/dist/{chunk-PVP4RGWT.js → chunk-T46BQOLY.js} +3 -3
  27. package/dist/{chunk-E2X26PXR.js → chunk-T6DVUX4F.js} +1 -1
  28. package/dist/{chunk-5T4UVOM3.js → chunk-TAZZZKYO.js} +1 -1
  29. package/dist/{chunk-GGIAIGUL.js → chunk-UAWY6X7V.js} +34 -12
  30. package/dist/{chunk-2ANV5ZQ5.js → chunk-VAI5VOOI.js} +1 -1
  31. package/dist/{chunk-2VSW6Q6C.js → chunk-WEZFTL4V.js} +655 -62
  32. package/dist/{chunk-GIPJNNI5.js → chunk-X53JXRS4.js} +3 -3
  33. package/dist/{cloud-KRTZ2IL5.js → cloud-2CRDKOWQ.js} +1 -1
  34. package/dist/cloud-REV3DPJH.js +42 -0
  35. package/dist/{detect-G4DR3U2N.js → detect-BBFT5GEU.js} +4 -4
  36. package/dist/{docker-YOVPCIB4.js → docker-EG3QSE6I.js} +10 -10
  37. package/dist/{docker-edge-executor-QFXD3337.js → docker-edge-executor-E5TOTLMR.js} +7 -7
  38. package/dist/edge-import-YJVJUGYC.js +56 -0
  39. package/dist/{edge-preflight-MXERVAMG.js → edge-preflight-QUW4BM7N.js} +13 -13
  40. package/dist/{ensure-container-edge-F4JUNQIK.js → ensure-container-edge-FOEFQ3PI.js} +13 -11
  41. package/dist/{executor-CVPAYYHR.js → executor-NTWDJ3DB.js} +6 -6
  42. package/dist/host-channel-preflight-OMCZMMKR.js +54 -0
  43. package/dist/index.js +158 -72
  44. package/dist/{local-executor-ODC6RANU.js → local-executor-OQ2GRN7K.js} +3 -3
  45. package/dist/{nginx-KLFF43TC.js → nginx-4U4C2XUS.js} +9 -9
  46. package/dist/{noop-NJ72F46T.js → noop-CLLJHCPL.js} +1 -1
  47. package/dist/{openresty-lua-VKWUV4GB.js → openresty-lua-LLWT5XQW.js} +7 -5
  48. package/dist/{privilege-7D3SSOL3.js → privilege-MNDVMDST.js} +5 -5
  49. package/dist/server/index.js +31643 -25553
  50. package/dist/server/migrations/0109_service_build_args.sql +9 -0
  51. package/dist/server/migrations/0110_service_deployment_host_ports.sql +18 -0
  52. package/dist/server/migrations/0111_host_port_claim.sql +381 -0
  53. package/dist/server/migrations/0112_backup_run_execution_lease.sql +12 -0
  54. package/dist/server/migrations/0113_docker_migration_execution_lease.sql +11 -0
  55. package/dist/server/migrations/0114_build_session_execution_lease_index.sql +6 -0
  56. package/dist/server/migrations/0115_orphan_target_key.sql +3 -0
  57. package/dist/server/migrations/0116_domain_ssl_challenge.sql +2 -0
  58. package/dist/server/migrations/meta/_journal.json +56 -0
  59. package/dist/{setup-I5AJC6NJ.js → setup-IFIMPQZJ.js} +12 -12
  60. package/dist/{ssh-client-625VWGKP.js → ssh-client-2XWZCMGI.js} +2 -2
  61. package/dist/up-HQS7IR7H.js +61 -0
  62. package/package.json +1 -1
  63. package/dist/bare-7QD623QV.js +0 -29
  64. package/dist/cloud-KNNABE3O.js +0 -40
  65. package/dist/edge-import-CRFVSR6P.js +0 -56
  66. package/dist/host-channel-preflight-QTDNGLCK.js +0 -54
  67. package/dist/up-QXTOOVXC.js +0 -61
@@ -8,24 +8,24 @@ import {
8
8
  import {
9
9
  getTarCreateEnv,
10
10
  prepareSourceTarArgs
11
- } from "./chunk-2ANV5ZQ5.js";
11
+ } from "./chunk-VAI5VOOI.js";
12
12
  import {
13
13
  connectSshClient,
14
14
  openDockerDialStdioChannel,
15
15
  openSftp,
16
16
  openSshUnixSocket,
17
17
  reconcileKnownHosts
18
- } from "./chunk-5T4UVOM3.js";
18
+ } from "./chunk-TAZZZKYO.js";
19
19
  import {
20
20
  LocalExecutor
21
- } from "./chunk-E2X26PXR.js";
21
+ } from "./chunk-T6DVUX4F.js";
22
22
  import {
23
23
  emitBufferedLines,
24
24
  flushBufferedLines,
25
25
  hasLocalCommand,
26
26
  logEntry,
27
27
  sq
28
- } from "./chunk-H3WT3A6R.js";
28
+ } from "./chunk-P7RCYELG.js";
29
29
  import {
30
30
  HostChannelUnavailableError,
31
31
  SshDisconnectedError,
@@ -42,7 +42,7 @@ import {
42
42
  hostChannelAccount,
43
43
  hostFirewallRule,
44
44
  safeErrorMessage
45
- } from "./chunk-2VSW6Q6C.js";
45
+ } from "./chunk-WEZFTL4V.js";
46
46
 
47
47
  // ../../packages/adapters/src/system/executor.ts
48
48
  import { existsSync, readFileSync } from "fs";
@@ -62,7 +62,10 @@ import { tmpdir } from "os";
62
62
  import { join } from "path";
63
63
  function packLocalArchive(tarArgs, outFile) {
64
64
  return new Promise((resolve, reject) => {
65
- const tar = spawn("tar", tarArgs, { stdio: ["ignore", "pipe", "pipe"], env: getTarCreateEnv() });
65
+ const tar = spawn("tar", tarArgs, {
66
+ stdio: ["ignore", "pipe", "pipe"],
67
+ env: getTarCreateEnv()
68
+ });
66
69
  const out = createWriteStream(outFile);
67
70
  let stderr = "";
68
71
  let tarCode = null;
@@ -71,7 +74,12 @@ function packLocalArchive(tarArgs, outFile) {
71
74
  const settle = () => {
72
75
  if (!tarClosed || !outClosed) return;
73
76
  if (tarCode === 0) resolve();
74
- else reject(new Error(`tar failed (exit ${tarCode})${stderr.trim() ? `: ${stderr.trim().slice(-300)}` : ""}`));
77
+ else
78
+ reject(
79
+ new Error(
80
+ `tar failed (exit ${tarCode})${stderr.trim() ? `: ${stderr.trim().slice(-300)}` : ""}`
81
+ )
82
+ );
75
83
  };
76
84
  tar.stderr.on("data", (d) => {
77
85
  stderr += d.toString();
@@ -102,9 +110,17 @@ async function extractRemoteArchive(exec, remoteArchive, remotePath, expectedByt
102
110
  );
103
111
  onLog?.(logEntry(`Transferred ${formatBytes(expectedBytes)} and extracted on the server.`));
104
112
  }
113
+ function formatPrivateKeyForOpenSsh(privateKey) {
114
+ const normalized = privateKey.replace(/^\uFEFF/, "").replace(/\r\n?/g, "\n");
115
+ return normalized.endsWith("\n") ? normalized : `${normalized}
116
+ `;
117
+ }
105
118
  async function canUseRemoteRsync(deps) {
106
119
  if (deps.config.privateKey && deps.config.privateKeyPassphrase && !deps.config.sshAgent) {
107
- return { ok: false, reason: "encrypted SSH keys without an agent are not supported by non-interactive rsync" };
120
+ return {
121
+ ok: false,
122
+ reason: "encrypted SSH keys without an agent are not supported by non-interactive rsync"
123
+ };
108
124
  }
109
125
  const [localRsync, localSsh, localSshpass, remoteRsync] = await Promise.all([
110
126
  hasLocalCommand("rsync"),
@@ -114,7 +130,8 @@ async function canUseRemoteRsync(deps) {
114
130
  ]);
115
131
  if (!localRsync) return { ok: false, reason: "local rsync is not installed" };
116
132
  if (!localSsh) return { ok: false, reason: "local ssh is not installed" };
117
- if (!localSshpass) return { ok: false, reason: "local sshpass is not installed for password-based rsync" };
133
+ if (!localSshpass)
134
+ return { ok: false, reason: "local sshpass is not installed for password-based rsync" };
118
135
  if (!remoteRsync) return { ok: false, reason: "remote rsync is not installed" };
119
136
  return { ok: true };
120
137
  }
@@ -157,7 +174,7 @@ async function withTemporaryPrivateKey(config, fn) {
157
174
  const tempDir = await mkdtemp(join(tmpdir(), "openship-rsync-key-"));
158
175
  const keyPath = join(tempDir, "id_rsa");
159
176
  try {
160
- await fsWriteFile(keyPath, config.privateKey);
177
+ await fsWriteFile(keyPath, formatPrivateKeyForOpenSsh(config.privateKey), { mode: 384 });
161
178
  await chmod(keyPath, 384);
162
179
  return await fn(keyPath);
163
180
  } finally {
@@ -203,7 +220,12 @@ async function uploadFileWithRsync(localFile, remoteFile, deps, onLog, opts) {
203
220
  let lastCode = 1;
204
221
  for (let attempt = 1; attempt <= retries; attempt++) {
205
222
  if (attempt > 1) {
206
- onLog?.(logEntry(`Connection dropped \u2014 resuming upload (attempt ${attempt}/${retries})...`, "warn"));
223
+ onLog?.(
224
+ logEntry(
225
+ `Connection dropped \u2014 resuming upload (attempt ${attempt}/${retries})...`,
226
+ "warn"
227
+ )
228
+ );
207
229
  }
208
230
  const args = [
209
231
  "-a",
@@ -1669,7 +1691,7 @@ async function verifyHostChannelAuth(config) {
1669
1691
  let hint = null;
1670
1692
  let forwarding = "unknown";
1671
1693
  try {
1672
- const { connectSshClient: connectSshClient2 } = await import("./ssh-client-625VWGKP.js");
1694
+ const { connectSshClient: connectSshClient2 } = await import("./ssh-client-2XWZCMGI.js");
1673
1695
  const client = await connectSshClient2({
1674
1696
  host: config.host,
1675
1697
  port: config.port,
@@ -4,7 +4,7 @@ import { createRequire as __ospCreateRequire } from "node:module";
4
4
  const require = __ospCreateRequire(import.meta.url);
5
5
  import {
6
6
  PACKAGE_ROOT_ONLY_EXCLUDES
7
- } from "./chunk-2VSW6Q6C.js";
7
+ } from "./chunk-WEZFTL4V.js";
8
8
 
9
9
  // ../../packages/adapters/src/archive.ts
10
10
  import { execFile } from "child_process";