openship 0.5.0 → 0.6.1

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 (104) hide show
  1. package/README.md +26 -1
  2. package/dist/bare-IWS2QHJ3.js +23 -0
  3. package/dist/{bowser-O3AEA6AN.js → bowser-HNOTPGJO.js} +2 -2
  4. package/dist/{chunk-5MZ624VX.js → chunk-2GWYYHOR.js} +1 -1
  5. package/dist/{chunk-BS2AXYZX.js → chunk-2NZSUXOB.js} +647 -214
  6. package/dist/chunk-3FYIXVX5.js +8051 -0
  7. package/dist/{chunk-ILFETZOM.js → chunk-3LDWWY7U.js} +21 -1
  8. package/dist/{chunk-W73X43R7.js → chunk-3NQQXMDR.js} +3 -3
  9. package/dist/{chunk-NNPEG6HM.js → chunk-3NZICQHF.js} +2 -2
  10. package/dist/{chunk-OWED2GRM.js → chunk-42WQABXM.js} +2 -2
  11. package/dist/{chunk-TYVME3XD.js → chunk-6FH4AXVY.js} +20 -3
  12. package/dist/{chunk-ZCOQJCZO.js → chunk-6ODUBKUB.js} +3 -3
  13. package/dist/{chunk-DYPH4HCI.js → chunk-AO252K7Z.js} +1 -1
  14. package/dist/{chunk-IXCHURVK.js → chunk-DOD2BXHQ.js} +4 -4
  15. package/dist/{chunk-VWPEKOH6.js → chunk-DRK3MEDS.js} +3 -3
  16. package/dist/{chunk-V7BZMGOT.js → chunk-EMXI4UCU.js} +5 -5
  17. package/dist/{chunk-RB35YN3J.js → chunk-EW6KB2J7.js} +391 -63
  18. package/dist/chunk-I3DPMTSF.js +29 -0
  19. package/dist/{chunk-NXFIRK2Z.js → chunk-IOT5ZX23.js} +573 -459
  20. package/dist/{chunk-KZOBYJUW.js → chunk-IW2UKBVF.js} +3 -3
  21. package/dist/{chunk-YWMODKWL.js → chunk-IXM5245F.js} +165 -13
  22. package/dist/{chunk-KNTJ7PSF.js → chunk-JIMUYEKN.js} +4 -4
  23. package/dist/{chunk-O6ZZF52V.js → chunk-ONKEYSMY.js} +2 -2
  24. package/dist/{chunk-UMQP7SYT.js → chunk-OTLSJYAC.js} +1316 -53
  25. package/dist/{chunk-EI575GHN.js → chunk-PDW4L3NV.js} +3 -3
  26. package/dist/{chunk-KI2EY3WB.js → chunk-PXKCZB2I.js} +1 -1
  27. package/dist/{chunk-6APIPIJY.js → chunk-QWHBRY2K.js} +5 -5
  28. package/dist/{chunk-JLKKYUZA.js → chunk-RRJJGVKE.js} +7 -7
  29. package/dist/{chunk-6B5YCFFV.js → chunk-RVER2EOO.js} +5 -5
  30. package/dist/{chunk-Q2CIRAOK.js → chunk-RXQBD4ZY.js} +1 -1
  31. package/dist/{chunk-6LKHXB6T.js → chunk-TWJCLD4W.js} +48 -13
  32. package/dist/{chunk-K2RPVGPN.js → chunk-UC7YIEHT.js} +36 -17
  33. package/dist/{chunk-I6PSTQIR.js → chunk-VDDMADOF.js} +3 -3
  34. package/dist/{chunk-6PIYRG5I.js → chunk-VZ2ZHPS2.js} +52 -42
  35. package/dist/{chunk-AVIB7CT7.js → chunk-WNWQBB7F.js} +2 -2
  36. package/dist/{chunk-FRNAR33O.js → chunk-XZYFZ6A5.js} +3 -3
  37. package/dist/chunk-YIPMDGG6.js +703 -0
  38. package/dist/{chunk-RPHRPFEH.js → chunk-ZCFVHA25.js} +1 -1
  39. package/dist/{chunk-FPRHYBY2.js → chunk-ZFJXPCQP.js} +1 -1
  40. package/dist/{chunk-JYGD5WSN.js → chunk-ZWLDLTJP.js} +1 -1
  41. package/dist/{cloud-7QYOGF7F.js → cloud-KRTZ2IL5.js} +3 -3
  42. package/dist/cloud-M2YLWEXO.js +31 -0
  43. package/dist/{detect-BAJMY6KM.js → detect-ALF4GXRX.js} +7 -8
  44. package/dist/{dist-IQJ6H6UZ.js → dist-BM6NPWIH.js} +3 -3
  45. package/dist/{dist-es-X3B5QYKB.js → dist-es-2YRDXMUU.js} +6 -6
  46. package/dist/{dist-es-OSNJBLXB.js → dist-es-CCVZEFRZ.js} +5 -5
  47. package/dist/{dist-es-VNKHQVIB.js → dist-es-IOH6G4GM.js} +4 -4
  48. package/dist/{dist-es-RYHIPOTN.js → dist-es-JGBPABJI.js} +14 -14
  49. package/dist/{dist-es-JSTDUS7Q.js → dist-es-KWSMDPIP.js} +6 -6
  50. package/dist/{dist-es-5DY7K32L.js → dist-es-UYDDOVZ3.js} +6 -6
  51. package/dist/{dist-es-WV4AMOII.js → dist-es-XUOR4NQN.js} +8 -8
  52. package/dist/docker-QECQJ5P4.js +32 -0
  53. package/dist/docker-edge-executor-62N64MGS.js +17 -0
  54. package/dist/edge-import-SAYTRJLO.js +48 -0
  55. package/dist/ensure-container-edge-CFSCPGZK.js +32 -0
  56. package/dist/{event-streams-EHRAKL75.js → event-streams-TR4GAC53.js} +4 -4
  57. package/dist/{executor-LOYMPU67.js → executor-PT6UEJ5M.js} +8 -8
  58. package/dist/index.js +1228 -463
  59. package/dist/{loadSso-46FQRIZS.js → loadSso-UGF4JMRK.js} +10 -10
  60. package/dist/{local-executor-V7U5VOZW.js → local-executor-WOFZD72X.js} +4 -4
  61. package/dist/nginx-YOEEFBTE.js +31 -0
  62. package/dist/node-entry.js +4 -0
  63. package/dist/{noop-FMMFG2EZ.js → noop-NJ72F46T.js} +3 -3
  64. package/dist/openresty-lua-WGBO2M3Z.js +81 -0
  65. package/dist/server/index.js +23276 -8015
  66. package/dist/server/lua/geo_country.lua +34 -8
  67. package/dist/server/lua/maxminddb.lua +403 -0
  68. package/dist/server/lua/mgmt_api.lua +431 -68
  69. package/dist/server/lua/pipe_stream.lua +52 -39
  70. package/dist/server/lua/site_logger.lua +236 -30
  71. package/dist/server/migrations/0082_edge_target_verification.sql +39 -0
  72. package/dist/server/migrations/0083_service_incident.sql +84 -0
  73. package/dist/server/migrations/0084_analytics_daily_rollup.sql +72 -0
  74. package/dist/server/migrations/0085_resource_usage.sql +68 -0
  75. package/dist/server/migrations/0086_remote_infra_updates.sql +41 -0
  76. package/dist/server/migrations/0087_server_container_version_columns.sql +17 -0
  77. package/dist/server/migrations/0088_audit_source_and_settings.sql +27 -0
  78. package/dist/server/migrations/0089_auto_scan_infra.sql +7 -0
  79. package/dist/server/migrations/0090_project_collect_paths.sql +18 -0
  80. package/dist/server/migrations/0091_project_server_id.sql +26 -0
  81. package/dist/server/migrations/0092_project_internal_alias.sql +13 -0
  82. package/dist/server/migrations/0093_service_incident_org_index.sql +13 -0
  83. package/dist/server/migrations/0094_backup_restore_meta.sql +15 -0
  84. package/dist/server/migrations/0095_backup_restore_cancel.sql +19 -0
  85. package/dist/server/migrations/0096_backup_policy_retention_defaults.sql +20 -0
  86. package/dist/server/migrations/0097_update_status_upstream_only.sql +35 -0
  87. package/dist/server/migrations/meta/_journal.json +112 -0
  88. package/dist/setup-M2ZDGH3O.js +21 -0
  89. package/dist/{signin-ITOPKKUB.js → signin-3M3UPB6K.js} +10 -10
  90. package/dist/{sso-oidc-NON2PD7Y.js → sso-oidc-3VDIYOEJ.js} +10 -10
  91. package/dist/{sts-HHFFSAY2.js → sts-B3WIYLXR.js} +9 -9
  92. package/package.json +6 -3
  93. package/dist/bare-VRGE5MXH.js +0 -23
  94. package/dist/chunk-CUJXGK7R.js +0 -3167
  95. package/dist/chunk-EAAGSQXN.js +0 -377
  96. package/dist/cloud-3M2WZ624.js +0 -30
  97. package/dist/docker-2NGBRJFJ.js +0 -18
  98. package/dist/docker-edge-executor-5I4M5QT7.js +0 -13
  99. package/dist/edge-import-RIWNEIXQ.js +0 -47
  100. package/dist/ensure-container-edge-3NSYKHRX.js +0 -31
  101. package/dist/nginx-QE4DOM5J.js +0 -24
  102. package/dist/openresty-lua-BTAKECCF.js +0 -42
  103. package/dist/server/lua/pipe_log.lua +0 -71
  104. package/dist/setup-KELALK7H.js +0 -20
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env sh
2
- ":" //# ; exec "$(command -v bun || command -v node)" "$0" "$@"
2
+ ":" //# ; exec "$(command -v node || command -v bun)" "$0" "$@"
3
3
  import { createRequire as __ospCreateRequire } from "node:module";
4
4
  const require = __ospCreateRequire(import.meta.url);
5
5
 
@@ -54,6 +54,25 @@ async function waitForPortListening(executor, port, opts = {}) {
54
54
  }
55
55
  return anyConclusive ? { listening: false, checked: true } : { listening: false, checked: false };
56
56
  }
57
+ async function waitForPortFree(executor, port, opts = {}) {
58
+ const timeoutMs = opts.timeoutMs ?? 15e3;
59
+ const intervalMs = opts.intervalMs ?? 500;
60
+ const deadline = Date.now() + timeoutMs;
61
+ let anyConclusive = false;
62
+ try {
63
+ for (; ; ) {
64
+ const result = await probePortListeningOnce(executor, port);
65
+ if (result === false) return { free: true, checked: true };
66
+ if (result === true) anyConclusive = true;
67
+ const remaining = deadline - Date.now();
68
+ if (remaining <= 0) break;
69
+ await delay(Math.min(intervalMs, remaining));
70
+ }
71
+ } catch {
72
+ return { free: false, checked: false };
73
+ }
74
+ return anyConclusive ? { free: false, checked: true } : { free: false, checked: false };
75
+ }
57
76
 
58
77
  // ../../packages/adapters/src/runtime/port-conflict.ts
59
78
  async function tryExec(executor, command) {
@@ -126,6 +145,7 @@ async function describeProcess(executor, pid) {
126
145
 
127
146
  export {
128
147
  waitForPortListening,
148
+ waitForPortFree,
129
149
  probeListeningPort,
130
150
  describeProcess
131
151
  };
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env sh
2
- ":" //# ; exec "$(command -v bun || command -v node)" "$0" "$@"
2
+ ":" //# ; exec "$(command -v node || command -v bun)" "$0" "$@"
3
3
  import { createRequire as __ospCreateRequire } from "node:module";
4
4
  const require = __ospCreateRequire(import.meta.url);
5
5
  import {
@@ -19,7 +19,7 @@ import {
19
19
  splitHeader,
20
20
  toBase64,
21
21
  toUtf8
22
- } from "./chunk-JYGD5WSN.js";
22
+ } from "./chunk-ZWLDLTJP.js";
23
23
 
24
24
  // ../../node_modules/@smithy/types/dist-es/middleware.js
25
25
  var SMITHY_CONTEXT_KEY = "__smithy_context";
@@ -1386,7 +1386,7 @@ var HttpProtocol = class extends SerdeContext {
1386
1386
  });
1387
1387
  }
1388
1388
  async loadEventStreamCapability() {
1389
- const { EventStreamSerde } = await import("./event-streams-EHRAKL75.js");
1389
+ const { EventStreamSerde } = await import("./event-streams-TR4GAC53.js");
1390
1390
  return new EventStreamSerde({
1391
1391
  marshaller: this.getEventStreamMarshaller(),
1392
1392
  serializer: this.serializer,
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env sh
2
- ":" //# ; exec "$(command -v bun || command -v node)" "$0" "$@"
2
+ ":" //# ; exec "$(command -v node || command -v bun)" "$0" "$@"
3
3
  import { createRequire as __ospCreateRequire } from "node:module";
4
4
  const require = __ospCreateRequire(import.meta.url);
5
5
  import {
6
6
  COMPONENT_INSTALLERS,
7
7
  checkAll,
8
8
  checkComponents
9
- } from "./chunk-NXFIRK2Z.js";
9
+ } from "./chunk-IOT5ZX23.js";
10
10
 
11
11
  // ../../packages/adapters/src/system/state.ts
12
12
  var DEFAULT_STATE_PATH = "/etc/openship/setup-state.json";
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env sh
2
- ":" //# ; exec "$(command -v bun || command -v node)" "$0" "$@"
2
+ ":" //# ; exec "$(command -v node || command -v bun)" "$0" "$@"
3
3
  import { createRequire as __ospCreateRequire } from "node:module";
4
4
  const require = __ospCreateRequire(import.meta.url);
5
5
  import {
6
6
  HttpResponse,
7
7
  buildQueryString
8
- } from "./chunk-W73X43R7.js";
8
+ } from "./chunk-3NQQXMDR.js";
9
9
 
10
10
  // ../../node_modules/@smithy/node-http-handler/dist-es/build-abort-error.js
11
11
  function buildAbortError(abortSignal) {
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env sh
2
- ":" //# ; exec "$(command -v bun || command -v node)" "$0" "$@"
2
+ ":" //# ; exec "$(command -v node || command -v bun)" "$0" "$@"
3
3
  import { createRequire as __ospCreateRequire } from "node:module";
4
4
  const require = __ospCreateRequire(import.meta.url);
5
5
  import {
@@ -8,7 +8,7 @@ import {
8
8
  getLocalShellPath,
9
9
  logEntry,
10
10
  sq
11
- } from "./chunk-FPRHYBY2.js";
11
+ } from "./chunk-ZFJXPCQP.js";
12
12
 
13
13
  // ../../packages/adapters/src/system/local-executor.ts
14
14
  import { exec, spawn } from "child_process";
@@ -41,25 +41,42 @@ var LocalExecutor = class {
41
41
  );
42
42
  });
43
43
  }
44
- streamExec(command, onLog) {
44
+ streamExec(command, onLog, opts) {
45
45
  return new Promise((resolve) => {
46
+ if (opts?.signal?.aborted) {
47
+ resolve({ code: 0, output: "" });
48
+ return;
49
+ }
46
50
  const child = spawn(getLocalShellPath(), getLocalShellArgs(command), {
47
51
  stdio: ["ignore", "pipe", "pipe"],
48
52
  env: getLocalExecEnv()
49
53
  });
54
+ const MAX_RETAINED_CHUNKS = 200;
50
55
  const chunks = [];
51
56
  const onChunk = (data, level) => {
52
57
  const text = data.toString();
53
58
  if (!text) return;
54
59
  chunks.push(text);
60
+ if (chunks.length > MAX_RETAINED_CHUNKS) chunks.shift();
55
61
  onLog(logEntry(text, level, data.toString("base64")));
56
62
  };
63
+ const signal = opts?.signal;
64
+ const onAbort = () => {
65
+ try {
66
+ child.kill("SIGTERM");
67
+ } catch {
68
+ }
69
+ };
70
+ signal?.addEventListener("abort", onAbort, { once: true });
71
+ const cleanup = () => signal?.removeEventListener("abort", onAbort);
57
72
  child.stdout.on("data", (data) => onChunk(data, "info"));
58
73
  child.stderr.on("data", (data) => onChunk(data, "warn"));
59
74
  child.on("close", (code) => {
75
+ cleanup();
60
76
  resolve({ code: code ?? 1, output: chunks.join("") });
61
77
  });
62
78
  child.on("error", (err) => {
79
+ cleanup();
63
80
  onLog(logEntry(`Process error: ${err.message}`, "error"));
64
81
  resolve({ code: 1, output: err.message });
65
82
  });
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env sh
2
- ":" //# ; exec "$(command -v bun || command -v node)" "$0" "$@"
2
+ ":" //# ; exec "$(command -v node || command -v bun)" "$0" "$@"
3
3
  import { createRequire as __ospCreateRequire } from "node:module";
4
4
  const require = __ospCreateRequire(import.meta.url);
5
5
  import {
6
6
  isSshAuthError,
7
7
  systemDebug
8
- } from "./chunk-RPHRPFEH.js";
8
+ } from "./chunk-ZCFVHA25.js";
9
9
  import {
10
10
  PACKAGE_ROOT_ONLY_EXCLUDES
11
- } from "./chunk-UMQP7SYT.js";
11
+ } from "./chunk-OTLSJYAC.js";
12
12
 
13
13
  // ../../packages/adapters/src/archive.ts
14
14
  import { execFile } from "child_process";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env sh
2
- ":" //# ; exec "$(command -v bun || command -v node)" "$0" "$@"
2
+ ":" //# ; exec "$(command -v node || command -v bun)" "$0" "$@"
3
3
  import { createRequire as __ospCreateRequire } from "node:module";
4
4
  const require = __ospCreateRequire(import.meta.url);
5
5
 
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env sh
2
- ":" //# ; exec "$(command -v bun || command -v node)" "$0" "$@"
2
+ ":" //# ; exec "$(command -v node || command -v bun)" "$0" "$@"
3
3
  import { createRequire as __ospCreateRequire } from "node:module";
4
4
  const require = __ospCreateRequire(import.meta.url);
5
5
  import {
6
6
  decorateServiceException,
7
7
  normalizeProvider as normalizeProvider2,
8
8
  setCredentialFeature
9
- } from "./chunk-VWPEKOH6.js";
9
+ } from "./chunk-DRK3MEDS.js";
10
10
  import {
11
11
  HttpRequest,
12
12
  HttpResponse,
@@ -17,14 +17,14 @@ import {
17
17
  getSmithyContext,
18
18
  normalizeProvider,
19
19
  toEndpointV1
20
- } from "./chunk-W73X43R7.js";
20
+ } from "./chunk-3NQQXMDR.js";
21
21
  import {
22
22
  fromHex,
23
23
  fromUtf8,
24
24
  isArrayBuffer,
25
25
  toHex,
26
26
  toUint8Array
27
- } from "./chunk-JYGD5WSN.js";
27
+ } from "./chunk-ZWLDLTJP.js";
28
28
 
29
29
  // ../../node_modules/@smithy/core/dist-es/submodules/schema/schemas/operation.js
30
30
  var operation = (namespace, name, traits, input, output) => ({
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env sh
2
- ":" //# ; exec "$(command -v bun || command -v node)" "$0" "$@"
2
+ ":" //# ; exec "$(command -v node || command -v bun)" "$0" "$@"
3
3
  import { createRequire as __ospCreateRequire } from "node:module";
4
4
  const require = __ospCreateRequire(import.meta.url);
5
5
  import {
@@ -17,11 +17,11 @@ import {
17
17
  loadConfig,
18
18
  normalizeProvider,
19
19
  toEndpointV1
20
- } from "./chunk-W73X43R7.js";
20
+ } from "./chunk-3NQQXMDR.js";
21
21
  import {
22
22
  parseRfc7231DateTime,
23
23
  v4
24
- } from "./chunk-JYGD5WSN.js";
24
+ } from "./chunk-ZWLDLTJP.js";
25
25
 
26
26
  // ../../node_modules/@smithy/core/dist-es/submodules/client/middleware-stack/MiddlewareStack.js
27
27
  var getAllAliases = (name, aliases) => {
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env sh
2
- ":" //# ; exec "$(command -v bun || command -v node)" "$0" "$@"
2
+ ":" //# ; exec "$(command -v node || command -v bun)" "$0" "$@"
3
3
  import { createRequire as __ospCreateRequire } from "node:module";
4
4
  const require = __ospCreateRequire(import.meta.url);
5
5
  import {
@@ -7,18 +7,18 @@ import {
7
7
  localGitSshWriter,
8
8
  materializeGitSsh,
9
9
  sq
10
- } from "./chunk-I6PSTQIR.js";
10
+ } from "./chunk-VDDMADOF.js";
11
11
  import {
12
12
  getTarCreateEnv,
13
13
  prepareSourceTarArgs
14
- } from "./chunk-ZCOQJCZO.js";
14
+ } from "./chunk-6ODUBKUB.js";
15
15
  import {
16
16
  packageManagerEnsureCommand
17
- } from "./chunk-UMQP7SYT.js";
17
+ } from "./chunk-OTLSJYAC.js";
18
18
  import {
19
19
  __commonJS,
20
20
  __toESM
21
- } from "./chunk-KI2EY3WB.js";
21
+ } from "./chunk-PXKCZB2I.js";
22
22
 
23
23
  // ../../node_modules/ignore/index.js
24
24
  var require_ignore = __commonJS({