openship 0.6.0 → 0.6.5

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 (63) hide show
  1. package/README.md +7 -2
  2. package/dist/{bare-FSUAM5V5.js → bare-XQIPDO4R.js} +10 -9
  3. package/dist/{chunk-PSZSKEPA.js → chunk-3ZAGC5NT.js} +64 -17
  4. package/dist/{chunk-6ODUBKUB.js → chunk-5OUWIPOB.js} +69 -7
  5. package/dist/chunk-6HOA5JT7.js +124 -0
  6. package/dist/{chunk-TWJCLD4W.js → chunk-6JELW75A.js} +4 -4
  7. package/dist/{chunk-GUQ3QCJ7.js → chunk-7334NSJL.js} +399 -369
  8. package/dist/chunk-7S4USQYF.js +1753 -0
  9. package/dist/{chunk-3LDWWY7U.js → chunk-A7EWM2KA.js} +41 -7
  10. package/dist/chunk-ELGRMZOW.js +25 -0
  11. package/dist/chunk-EZPPTWJQ.js +292 -0
  12. package/dist/{chunk-IXM5245F.js → chunk-GRTXMUHA.js} +553 -538
  13. package/dist/chunk-HPXP6LXZ.js +428 -0
  14. package/dist/{chunk-OTLSJYAC.js → chunk-LEYSL46B.js} +2135 -85
  15. package/dist/{chunk-EMXI4UCU.js → chunk-LFCSC4IU.js} +29 -10
  16. package/dist/{chunk-JIMUYEKN.js → chunk-MSZUCNPV.js} +1 -1
  17. package/dist/{chunk-OGY63DGD.js → chunk-PZRRL5PC.js} +71 -28
  18. package/dist/{chunk-VE2YOK4I.js → chunk-QLX7NBEA.js} +1218 -588
  19. package/dist/chunk-RFWJE7ZN.js +68 -0
  20. package/dist/{chunk-VDDMADOF.js → chunk-TM2IQPYU.js} +16 -2
  21. package/dist/{chunk-3FYIXVX5.js → chunk-VDESJSG6.js} +451 -106
  22. package/dist/{chunk-B3CE2OMR.js → chunk-VHMOQL5Y.js} +276 -50
  23. package/dist/{chunk-QEH4QUBX.js → chunk-VLQ3UIVO.js} +393 -53
  24. package/dist/{chunk-VZ2ZHPS2.js → chunk-WE7BXW6L.js} +3 -9
  25. package/dist/chunk-WFRXYWK2.js +444 -0
  26. package/dist/chunk-XRNRT37W.js +316 -0
  27. package/dist/{chunk-EP2TNALB.js → chunk-XVOBL7BC.js} +31 -8
  28. package/dist/cloud-3DODOWTR.js +36 -0
  29. package/dist/{detect-ALF4GXRX.js → detect-P4CIQBRH.js} +3 -3
  30. package/dist/{docker-QECQJ5P4.js → docker-3K2NEBD6.js} +15 -8
  31. package/dist/{docker-edge-executor-62N64MGS.js → docker-edge-executor-YZZ6P7IC.js} +5 -5
  32. package/dist/{edge-import-CQWHN2Q3.js → edge-import-MCJNVTZ2.js} +26 -23
  33. package/dist/edge-preflight-ES6FH4JK.js +42 -0
  34. package/dist/{ensure-container-edge-MJVXJQG5.js → ensure-container-edge-YPITNH45.js} +9 -8
  35. package/dist/{executor-JELARVKC.js → executor-DZGX55K2.js} +12 -5
  36. package/dist/host-channel-preflight-MUXE3KZU.js +49 -0
  37. package/dist/index.js +3668 -4063
  38. package/dist/{nginx-AXGNWRKZ.js → nginx-NSAHWGJV.js} +11 -5
  39. package/dist/node-bootstrap.js +241 -0
  40. package/dist/node-entry.js +52 -1
  41. package/dist/{openresty-lua-IE4P5YQX.js → openresty-lua-DR4D3EZ6.js} +6 -2
  42. package/dist/privilege-YTVI4SKF.js +19 -0
  43. package/dist/server/engine/samples/fail2ban/jail.d/sshd.local +4 -1
  44. package/dist/server/index.js +21501 -13137
  45. package/dist/server/lua/geo_country.lua +4 -3
  46. package/dist/server/lua/pipe_stream.lua +52 -39
  47. package/dist/server/lua/site_logger.lua +22 -24
  48. package/dist/server/migrations/0098_instance_product_mode.sql +12 -0
  49. package/dist/server/migrations/0099_mail_webmail_project.sql +24 -0
  50. package/dist/server/migrations/0100_server_ssh_private_key.sql +11 -0
  51. package/dist/server/migrations/0101_mail_resume_step.sql +12 -0
  52. package/dist/server/migrations/0102_project_workload_axes.sql +19 -0
  53. package/dist/server/migrations/0103_dns_credential.sql +41 -0
  54. package/dist/server/migrations/0104_instance_host_control.sql +15 -0
  55. package/dist/server/migrations/meta/_journal.json +49 -0
  56. package/dist/{setup-FA4PW4NU.js → setup-WUUZURHS.js} +10 -9
  57. package/dist/up-XEO3SR6Z.js +58 -0
  58. package/package.json +4 -2
  59. package/dist/chunk-IW2UKBVF.js +0 -144
  60. package/dist/chunk-ZCFVHA25.js +0 -89
  61. package/dist/cloud-E5M6VMCG.js +0 -31
  62. package/dist/server/lua/pipe_log.lua +0 -77
  63. /package/dist/{dist-es-JGBPABJI.js → dist-es-ZP5QDSJ3.js} +0 -0
@@ -7,14 +7,14 @@ import {
7
7
  localGitSshWriter,
8
8
  materializeGitSsh,
9
9
  sq
10
- } from "./chunk-VDDMADOF.js";
10
+ } from "./chunk-TM2IQPYU.js";
11
11
  import {
12
12
  getTarCreateEnv,
13
13
  prepareSourceTarArgs
14
- } from "./chunk-6ODUBKUB.js";
14
+ } from "./chunk-5OUWIPOB.js";
15
15
  import {
16
16
  packageManagerEnsureCommand
17
- } from "./chunk-OTLSJYAC.js";
17
+ } from "./chunk-LEYSL46B.js";
18
18
  import {
19
19
  __commonJS,
20
20
  __toESM
@@ -480,16 +480,34 @@ var require_ignore = __commonJS({
480
480
 
481
481
  // ../../packages/adapters/src/runtime/docker-paths.ts
482
482
  import { access, readdir } from "fs/promises";
483
- import { isAbsolute, join, relative, sep } from "path";
483
+ import { isAbsolute, join, relative, resolve, sep } from "path";
484
484
  function toPosixPath(value) {
485
485
  return value.split(sep).filter(Boolean).join("/");
486
486
  }
487
+ function toSafeSegments(value, label) {
488
+ const segments = value.split(/[\\/]/).filter((segment) => segment && segment !== ".");
489
+ if (segments.includes("..")) {
490
+ throw new Error(
491
+ `Invalid ${label} ${JSON.stringify(value)}: path segments must not contain "..".`
492
+ );
493
+ }
494
+ return segments;
495
+ }
487
496
  function normalizeDockerRelativePath(value) {
488
497
  const normalized = value?.trim().replace(/^\.\//, "").replace(/^\/+|\/+$/g, "");
489
498
  if (!normalized || normalized === ".") {
490
499
  return "";
491
500
  }
492
- return normalized.split(/[\\/]/).filter(Boolean).join("/");
501
+ return toSafeSegments(normalized, "path").join("/");
502
+ }
503
+ function resolveWithinDirectory(baseDir, relativePath) {
504
+ const base = resolve(baseDir);
505
+ const target = resolve(base, ...toSafeSegments(relativePath?.trim() ?? "", "path"));
506
+ const escape = relative(base, target);
507
+ if (escape === ".." || escape.startsWith(`..${sep}`) || isAbsolute(escape)) {
508
+ throw new Error(`Resolved path ${JSON.stringify(target)} escapes ${JSON.stringify(base)}.`);
509
+ }
510
+ return target;
493
511
  }
494
512
  function normalizeDockerRootDirectory(rootDirectory, localPath) {
495
513
  let normalized = rootDirectory?.trim() ?? "";
@@ -509,7 +527,7 @@ function normalizeDockerRootDirectory(rootDirectory, localPath) {
509
527
  if (!normalized || normalized === ".") {
510
528
  return "";
511
529
  }
512
- return toPosixPath(normalized);
530
+ return toSafeSegments(normalized, "rootDirectory").join("/");
513
531
  }
514
532
  function resolveExplicitDockerfileCandidate(rootDirectory, dockerfilePath) {
515
533
  const normalizedRootDirectory = normalizeDockerRelativePath(rootDirectory);
@@ -904,7 +922,7 @@ import { join as join2, relative as relative2, sep as sep2 } from "path";
904
922
  var GIT_CLONE_IDLE_TIMEOUT_MS = 5 * 6e4;
905
923
  var GIT_CHECKOUT_IDLE_TIMEOUT_MS = 6e4;
906
924
  function spawnGit(args, opts) {
907
- return new Promise((resolve, reject) => {
925
+ return new Promise((resolve2, reject) => {
908
926
  const child = spawn("git", args, {
909
927
  stdio: ["ignore", "pipe", "pipe"],
910
928
  env: {
@@ -954,7 +972,7 @@ function spawnGit(args, opts) {
954
972
  });
955
973
  child.on("close", (code) => {
956
974
  clearTimeout(idleTimer);
957
- if (code === 0) resolve();
975
+ if (code === 0) resolve2();
958
976
  else reject(new Error(`git exited with code ${code}: ${stderr.trim().slice(-500) || "no stderr"}`));
959
977
  });
960
978
  });
@@ -1014,7 +1032,7 @@ async function applyDockerignore(contextDir, config) {
1014
1032
  async function materializeLocalSource(sourcePath, targetPath) {
1015
1033
  const { args, cleanup } = await prepareSourceTarArgs(sourcePath);
1016
1034
  try {
1017
- await new Promise((resolve, reject) => {
1035
+ await new Promise((resolve2, reject) => {
1018
1036
  const create = spawn("tar", args, { env: getTarCreateEnv() });
1019
1037
  const extract = spawn("tar", ["-xzf", "-", "-C", targetPath]);
1020
1038
  let err = "";
@@ -1027,7 +1045,7 @@ async function materializeLocalSource(sourcePath, targetPath) {
1027
1045
  create.on("close", (code) => createCode = code);
1028
1046
  create.stdout.pipe(extract.stdin);
1029
1047
  extract.on("close", (code) => {
1030
- if (code === 0 && (createCode ?? 0) === 0) return resolve();
1048
+ if (code === 0 && (createCode ?? 0) === 0) return resolve2();
1031
1049
  const parts = [
1032
1050
  createCode ? `pack exited ${createCode}: ${createErr.trim().slice(-500)}` : "",
1033
1051
  code ? `extract exited ${code}: ${err.trim().slice(-500)}` : ""
@@ -1173,6 +1191,7 @@ async function createDockerBuildContext(config, opts) {
1173
1191
 
1174
1192
  export {
1175
1193
  normalizeDockerRelativePath,
1194
+ resolveWithinDirectory,
1176
1195
  resolveDockerfileCandidates,
1177
1196
  staticBuilderOutputPath,
1178
1197
  generateDockerfile,
@@ -6,7 +6,7 @@ import {
6
6
  detectBuildKillHint,
7
7
  runBuildPipeline,
8
8
  transferLocalDirectory
9
- } from "./chunk-VDDMADOF.js";
9
+ } from "./chunk-TM2IQPYU.js";
10
10
  import {
11
11
  LocalExecutor
12
12
  } from "./chunk-6FH4AXVY.js";