openship 0.6.9 → 0.7.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.
- package/dist/bare-AB4SMTNJ.js +29 -0
- package/dist/{chunk-P7RCYELG.js → chunk-2BAKEGGF.js} +1 -1
- package/dist/{chunk-VAI5VOOI.js → chunk-2YAY5XHK.js} +1 -1
- package/dist/{chunk-X53JXRS4.js → chunk-37XZTLBJ.js} +3 -3
- package/dist/{chunk-R5DC5PEF.js → chunk-3K65MMYV.js} +39 -10
- package/dist/{chunk-D3OEMXYP.js → chunk-3WBKLDGC.js} +12 -7
- package/dist/{chunk-ENKJ7XIF.js → chunk-3YSSXSC2.js} +12 -12
- package/dist/{chunk-3MP6ACKM.js → chunk-7MCPDYKP.js} +799 -165
- package/dist/{chunk-D6HU4VUZ.js → chunk-7TQP6723.js} +2 -2
- package/dist/{chunk-SK4FFCFR.js → chunk-AMADTKC6.js} +1 -1
- package/dist/{chunk-NPSRGIHV.js → chunk-B2BQX6JX.js} +6 -5
- package/dist/{chunk-MUWVC5R4.js → chunk-BBPKAQ54.js} +12 -9
- package/dist/{chunk-WEZFTL4V.js → chunk-COI4VFRW.js} +217 -2
- package/dist/{chunk-5DJOB7IX.js → chunk-CQ2JOXEQ.js} +3 -3
- package/dist/{chunk-7PEXM2UI.js → chunk-DQR5TPFB.js} +6 -6
- package/dist/{chunk-IAMOUDHY.js → chunk-ETK6IBCH.js} +24 -15
- package/dist/{chunk-T46BQOLY.js → chunk-FNWNUYS3.js} +3 -3
- package/dist/{chunk-UAWY6X7V.js → chunk-GPTBEPUE.js} +485 -67
- package/dist/{chunk-634DDFT5.js → chunk-H36ASAYI.js} +8 -8
- package/dist/{chunk-AHJYP7DG.js → chunk-IVMPA6RC.js} +74 -17
- package/dist/{chunk-5UXHT6ED.js → chunk-IXBOV7BE.js} +113 -20
- package/dist/{chunk-GNOMEMNI.js → chunk-KATXZ5AB.js} +1 -1
- package/dist/{chunk-T6DVUX4F.js → chunk-KCMEWNP7.js} +14 -3
- package/dist/{chunk-N5YZMO33.js → chunk-L4DRH6ZA.js} +12 -1
- package/dist/{chunk-BO6CY4V2.js → chunk-NF7NQOAP.js} +47 -4
- package/dist/{chunk-FCGJN5Q5.js → chunk-NIOLZENU.js} +9 -9
- package/dist/{chunk-7YBWXEM6.js → chunk-OEYXXSAM.js} +4 -4
- package/dist/{chunk-6GU6JSK6.js → chunk-S5GU345P.js} +3 -3
- package/dist/{chunk-TAZZZKYO.js → chunk-TKK5NPDQ.js} +2 -2
- package/dist/{chunk-NUT6HKK6.js → chunk-WG5PDWZ3.js} +5 -5
- package/dist/{chunk-NIYD7MD2.js → chunk-XJSLJLNY.js} +90 -46
- package/dist/{cloud-REV3DPJH.js → cloud-T2JOFEQL.js} +20 -20
- package/dist/{detect-BBFT5GEU.js → detect-SWLZURYX.js} +5 -5
- package/dist/{docker-EG3QSE6I.js → docker-SQNZRZXN.js} +11 -11
- package/dist/{docker-edge-executor-E5TOTLMR.js → docker-edge-executor-BSSQQS76.js} +8 -8
- package/dist/{edge-import-YJVJUGYC.js → edge-import-LUDX77C2.js} +27 -27
- package/dist/{edge-preflight-QUW4BM7N.js → edge-preflight-JAEFWBRI.js} +14 -14
- package/dist/{ensure-container-edge-FOEFQ3PI.js → ensure-container-edge-U7FTLFVJ.js} +12 -12
- package/dist/{executor-NTWDJ3DB.js → executor-GYRZ7RIU.js} +7 -7
- package/dist/host-channel-preflight-U4IZCRXR.js +54 -0
- package/dist/index.js +72 -50
- package/dist/{local-executor-OQ2GRN7K.js → local-executor-JCR46VAP.js} +3 -3
- package/dist/{nginx-4U4C2XUS.js → nginx-YA6IRPJT.js} +10 -10
- package/dist/{openresty-lua-LLWT5XQW.js → openresty-lua-DUOB64TP.js} +8 -8
- package/dist/{privilege-MNDVMDST.js → privilege-4B2TMVW2.js} +6 -6
- package/dist/server/index.js +13286 -5381
- package/dist/server/lua/site_logger.lua +18 -1
- package/dist/server/migrations/0117_github_installation_workspace_scope.sql +24 -0
- package/dist/server/migrations/0118_git_sources.sql +66 -0
- package/dist/server/migrations/0119_backup_run_batch.sql +8 -0
- package/dist/server/migrations/0120_domain_primary_unique.sql +24 -0
- package/dist/server/migrations/0121_host_port_claim_overlap.sql +14 -0
- package/dist/server/migrations/0122_data_transfer_staging.sql +45 -0
- package/dist/server/migrations/meta/_journal.json +42 -0
- package/dist/setup-T3WN3HRS.js +25 -0
- package/dist/{ssh-client-2XWZCMGI.js → ssh-client-FZDWP5PQ.js} +3 -3
- package/dist/up-U73RUN5R.js +61 -0
- package/package.json +1 -1
- package/dist/bare-FA66N7GC.js +0 -29
- package/dist/host-channel-preflight-OI2TRHSG.js +0 -54
- package/dist/setup-IFIMPQZJ.js +0 -25
- package/dist/up-RC5ZQIAD.js +0 -61
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
isCloudFrontedHost,
|
|
20
20
|
luaSourceAvailable,
|
|
21
21
|
reloadBareOpenResty
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-DQR5TPFB.js";
|
|
23
23
|
import {
|
|
24
24
|
edgeDownExplanation,
|
|
25
25
|
explainEdgeDown,
|
|
@@ -30,17 +30,17 @@ import {
|
|
|
30
30
|
} from "./chunk-R4VDPFLS.js";
|
|
31
31
|
import {
|
|
32
32
|
EXECUTOR_DELEGATE
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-B2BQX6JX.js";
|
|
34
34
|
import {
|
|
35
35
|
logEntry,
|
|
36
36
|
sq
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-2BAKEGGF.js";
|
|
38
38
|
import {
|
|
39
39
|
edgeFailureReason
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-37XZTLBJ.js";
|
|
41
41
|
import {
|
|
42
42
|
probeListeningPort
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-NF7NQOAP.js";
|
|
44
44
|
import {
|
|
45
45
|
PROXY_DIRECTIVES,
|
|
46
46
|
parseProxyValue,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
resolveRedirectStatus,
|
|
49
49
|
safeErrorMessage,
|
|
50
50
|
sanitizeProxySettings
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-COI4VFRW.js";
|
|
52
52
|
|
|
53
53
|
// ../../packages/adapters/src/infra/nginx.ts
|
|
54
54
|
import {
|
|
@@ -92,8 +92,9 @@ async function readMaybeInContainer(exec, path, container) {
|
|
|
92
92
|
if (!name) return "";
|
|
93
93
|
return exec.exec(containerCommand(name, `cat ${sq(path)}`)).catch(() => "");
|
|
94
94
|
}
|
|
95
|
-
async function writeEdgeFileIn(inner, container, path, content) {
|
|
96
|
-
await inner.writeFile(path, content);
|
|
95
|
+
async function writeEdgeFileIn(inner, container, path, content, opts) {
|
|
96
|
+
if (opts === void 0) await inner.writeFile(path, content);
|
|
97
|
+
else await inner.writeFile(path, content, opts);
|
|
97
98
|
if (!container) return;
|
|
98
99
|
const visible = await inner.exec(containerCommand(container, `test -e ${sq(path)} && echo visible`)).catch(() => "");
|
|
99
100
|
if (visible.trim() === "visible") return;
|
|
@@ -149,7 +150,7 @@ ${result.output}` };
|
|
|
149
150
|
if (opts?.files === "auto") {
|
|
150
151
|
Object.assign(overrides, {
|
|
151
152
|
readFile: (path) => readMaybeInContainer(inner, path, container),
|
|
152
|
-
writeFile: (path, content) => writeEdgeFileIn(inner, container, path, content),
|
|
153
|
+
writeFile: (path, content, writeOpts) => writeEdgeFileIn(inner, container, path, content, writeOpts),
|
|
153
154
|
exists: async (path) => {
|
|
154
155
|
if (await inner.exists(path).catch(() => false)) return true;
|
|
155
156
|
const { code } = await inner.streamExec(inContainer(`test -e ${sq(path)}`), () => {
|
|
@@ -381,7 +382,13 @@ var WEBHOOK_LOCATION_PREFIX = "/_openship/hooks/";
|
|
|
381
382
|
function renderProxyLocations(route, opts) {
|
|
382
383
|
if (!route.proxyLocations || route.proxyLocations.length === 0) return "";
|
|
383
384
|
const head = `${opts.httpsUpgrade ? HTTPS_UPGRADE : ""}${renderRedirectRules(route, " ")}`;
|
|
384
|
-
const claimed = /* @__PURE__ */ new Set([
|
|
385
|
+
const claimed = /* @__PURE__ */ new Set([
|
|
386
|
+
"prefix:/",
|
|
387
|
+
`prefix:${WEBHOOK_LOCATION_PREFIX}`,
|
|
388
|
+
// An exact webhook match would not be a duplicate, but it would outrank and
|
|
389
|
+
// hijack the edge-owned delivery endpoint just as surely as a prefix would.
|
|
390
|
+
`exact:${WEBHOOK_LOCATION_PREFIX}`
|
|
391
|
+
]);
|
|
385
392
|
const blocks = [];
|
|
386
393
|
for (const loc of route.proxyLocations) {
|
|
387
394
|
assertValidUpstream(loc.targetUrl);
|
|
@@ -389,10 +396,12 @@ function renderProxyLocations(route, opts) {
|
|
|
389
396
|
const headers = loc.external ? externalProxyHeaders(loc.targetUrl) : PROXY_HEADERS;
|
|
390
397
|
if (!loc.pattern || !loc.upstreamPath) {
|
|
391
398
|
assertValidLiteralPath(loc.pathPrefix, "proxy location prefix");
|
|
392
|
-
|
|
393
|
-
|
|
399
|
+
const kind = loc.exact ? "exact" : "prefix";
|
|
400
|
+
const key = `${kind}:${loc.pathPrefix}`;
|
|
401
|
+
if (claimed.has(key)) continue;
|
|
402
|
+
claimed.add(key);
|
|
394
403
|
blocks.push(`
|
|
395
|
-
location ^~ ${loc.pathPrefix} {
|
|
404
|
+
location ${loc.exact ? "=" : "^~"} ${loc.pathPrefix} {
|
|
396
405
|
${head}proxy_pass ${loc.targetUrl};
|
|
397
406
|
${headers}
|
|
398
407
|
}`);
|
|
@@ -403,8 +412,8 @@ function renderProxyLocations(route, opts) {
|
|
|
403
412
|
assertNoNginxInjection(loc.upstreamPath, "rewrite upstream path");
|
|
404
413
|
assertNoRuntimeVariable(loc.upstreamPath, "rewrite upstream path", true);
|
|
405
414
|
const match = `^${toNginxPattern(loc.pattern)}$`;
|
|
406
|
-
if (claimed.has(
|
|
407
|
-
claimed.add(
|
|
415
|
+
if (claimed.has(`regex:${match}`)) continue;
|
|
416
|
+
claimed.add(`regex:${match}`);
|
|
408
417
|
blocks.push(`
|
|
409
418
|
location ~ ${match} {
|
|
410
419
|
${head}rewrite ${match} ${loc.upstreamPath} break;
|
|
@@ -4,15 +4,15 @@ import { createRequire as __ospCreateRequire } from "node:module";
|
|
|
4
4
|
const require = __ospCreateRequire(import.meta.url);
|
|
5
5
|
import {
|
|
6
6
|
hostRefusal
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KATXZ5AB.js";
|
|
8
8
|
import {
|
|
9
9
|
elevatedExecutor,
|
|
10
10
|
resolveEnvironment
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-B2BQX6JX.js";
|
|
12
12
|
import {
|
|
13
13
|
answered,
|
|
14
14
|
refused
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-COI4VFRW.js";
|
|
16
16
|
|
|
17
17
|
// ../../packages/adapters/src/system/privilege.ts
|
|
18
18
|
function rootChecked(executor, why) {
|