openship 0.4.8 → 0.5.0
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/README.md +1 -0
- package/dist/{bare-JY5Y5ELU.js → bare-VRGE5MXH.js} +7 -7
- package/dist/{chunk-TGIINPVM.js → chunk-6LKHXB6T.js} +22 -7
- package/dist/{chunk-2D3I5G6P.js → chunk-6PIYRG5I.js} +23 -3
- package/dist/{chunk-BBHX7T4R.js → chunk-BS2AXYZX.js} +401 -76
- package/dist/{chunk-SJIFLLX4.js → chunk-CUJXGK7R.js} +321 -85
- package/dist/{chunk-VFINNTUL.js → chunk-EAAGSQXN.js} +23 -8
- package/dist/{chunk-4Z5QO7N6.js → chunk-I6PSTQIR.js} +2 -2
- package/dist/{chunk-5NYUCONN.js → chunk-JLKKYUZA.js} +31 -49
- package/dist/{chunk-XPPZ7B2J.js → chunk-K2RPVGPN.js} +2 -2
- package/dist/{chunk-MZ2WEHHY.js → chunk-KNTJ7PSF.js} +1 -1
- package/dist/{chunk-L2VOGB2X.js → chunk-KZOBYJUW.js} +1 -1
- package/dist/{chunk-GKHUSZCD.js → chunk-NNPEG6HM.js} +1 -1
- package/dist/{chunk-SLTYVHU7.js → chunk-NXFIRK2Z.js} +381 -72
- package/dist/{chunk-FXTBHTWY.js → chunk-RB35YN3J.js} +271 -35
- package/dist/{chunk-6APULWSU.js → chunk-UMQP7SYT.js} +429 -66
- package/dist/{chunk-V6AN6XLZ.js → chunk-V7BZMGOT.js} +123 -45
- package/dist/{chunk-VDMQJHPI.js → chunk-YWMODKWL.js} +67 -4
- package/dist/{chunk-OXWDY22G.js → chunk-ZCOQJCZO.js} +1 -1
- package/dist/{cloud-KYWY3RP4.js → cloud-3M2WZ624.js} +12 -12
- package/dist/{detect-AZLOHUFX.js → detect-BAJMY6KM.js} +3 -3
- package/dist/{docker-LODK5Y2S.js → docker-2NGBRJFJ.js} +9 -7
- package/dist/{docker-edge-executor-VHW3JPJS.js → docker-edge-executor-5I4M5QT7.js} +1 -1
- package/dist/{edge-import-ABUDKKJI.js → edge-import-RIWNEIXQ.js} +21 -19
- package/dist/{ensure-container-edge-SW6HENSG.js → ensure-container-edge-3NSYKHRX.js} +6 -6
- package/dist/{executor-XJ6RP4Q2.js → executor-LOYMPU67.js} +3 -3
- package/dist/index.js +269 -331
- package/dist/{nginx-3L4SIBJA.js → nginx-QE4DOM5J.js} +4 -4
- package/dist/{openresty-lua-4WLGDSER.js → openresty-lua-BTAKECCF.js} +2 -2
- package/dist/server/index.js +51643 -45322
- package/dist/server/migrations/0073_project_volumes_object_storage.sql +3 -0
- package/dist/server/migrations/0074_project_compose_path.sql +1 -0
- package/dist/server/migrations/0075_service_command_argv.sql +1 -0
- package/dist/server/migrations/0076_rollback_retention.sql +17 -0
- package/dist/server/migrations/0077_domain_redirect.sql +13 -0
- package/dist/server/migrations/0078_grant_source_scope.sql +30 -0
- package/dist/server/migrations/0079_project_readiness.sql +18 -0
- package/dist/server/migrations/0080_deployment_error_classification.sql +26 -0
- package/dist/server/migrations/0081_project_readiness_repair.sql +34 -0
- package/dist/server/migrations/meta/_journal.json +63 -0
- package/dist/{setup-NU6T2PDU.js → setup-KELALK7H.js} +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
<a href="docs/i18n/README.pt.md"><img src="https://img.shields.io/badge/lang-Português-555" alt="Português" /></a>
|
|
36
36
|
<a href="docs/i18n/README.de.md"><img src="https://img.shields.io/badge/lang-Deutsch-555" alt="Deutsch" /></a>
|
|
37
37
|
<a href="docs/i18n/README.tr.md"><img src="https://img.shields.io/badge/lang-Türkçe-555" alt="Türkçe" /></a>
|
|
38
|
+
<a href="docs/i18n/README.ko.md"><img src="https://img.shields.io/badge/lang-한국어-555" alt="한국어" /></a>
|
|
38
39
|
</p>
|
|
39
40
|
|
|
40
41
|
<p align="center">
|
|
@@ -5,17 +5,17 @@ const require = __ospCreateRequire(import.meta.url);
|
|
|
5
5
|
import {
|
|
6
6
|
BareRuntime,
|
|
7
7
|
STATIC_RELEASE_BASE
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-YWMODKWL.js";
|
|
9
|
+
import "./chunk-KNTJ7PSF.js";
|
|
10
|
+
import "./chunk-KZOBYJUW.js";
|
|
11
|
+
import "./chunk-I6PSTQIR.js";
|
|
12
|
+
import "./chunk-K2RPVGPN.js";
|
|
13
|
+
import "./chunk-ZCOQJCZO.js";
|
|
14
14
|
import "./chunk-RPHRPFEH.js";
|
|
15
15
|
import "./chunk-TYVME3XD.js";
|
|
16
16
|
import "./chunk-FPRHYBY2.js";
|
|
17
17
|
import "./chunk-ILFETZOM.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-UMQP7SYT.js";
|
|
19
19
|
import "./chunk-KI2EY3WB.js";
|
|
20
20
|
export {
|
|
21
21
|
BareRuntime,
|
|
@@ -14,6 +14,15 @@ import {
|
|
|
14
14
|
import Dockerode from "dockerode";
|
|
15
15
|
import { PassThrough } from "stream";
|
|
16
16
|
var DEFAULT_SOCKET = "/var/run/docker.sock";
|
|
17
|
+
function explainEdgeExecError(err, containerName) {
|
|
18
|
+
const msg = err?.message ?? String(err);
|
|
19
|
+
if (/is not running|not running|409/i.test(msg)) {
|
|
20
|
+
return new Error(
|
|
21
|
+
`edge container "${containerName}" is not running yet (still starting, or stopped) \u2014 wait for it to be up (docker start ${containerName}) and retry.`
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
return err instanceof Error ? err : new Error(msg);
|
|
25
|
+
}
|
|
17
26
|
var WRITE_CHUNK = 6e4;
|
|
18
27
|
var DockerEdgeExecutor = class {
|
|
19
28
|
docker;
|
|
@@ -30,13 +39,19 @@ var DockerEdgeExecutor = class {
|
|
|
30
39
|
/** Run one command inside the edge container, capturing stdout/stderr + exit. */
|
|
31
40
|
async run(command) {
|
|
32
41
|
const container = this.docker.getContainer(this.containerName);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
let exec;
|
|
43
|
+
let stream;
|
|
44
|
+
try {
|
|
45
|
+
exec = await container.exec({
|
|
46
|
+
Cmd: ["/bin/sh", "-c", command],
|
|
47
|
+
AttachStdout: true,
|
|
48
|
+
AttachStderr: true,
|
|
49
|
+
Tty: false
|
|
50
|
+
});
|
|
51
|
+
stream = await exec.start({ stdin: false });
|
|
52
|
+
} catch (err) {
|
|
53
|
+
throw explainEdgeExecError(err, this.containerName);
|
|
54
|
+
}
|
|
40
55
|
const outStream = new PassThrough();
|
|
41
56
|
const errStream = new PassThrough();
|
|
42
57
|
let stdout = "";
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
} from "./chunk-ILFETZOM.js";
|
|
9
9
|
import {
|
|
10
10
|
OPENRESTY_LUA_DIR
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-EAAGSQXN.js";
|
|
12
12
|
import {
|
|
13
13
|
AppError
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-UMQP7SYT.js";
|
|
15
15
|
|
|
16
16
|
// ../../packages/adapters/src/system/proxy/detect.ts
|
|
17
17
|
var EDGE_PORTS = [80, 443];
|
|
@@ -65,7 +65,21 @@ function vhostLog(message, level = "info") {
|
|
|
65
65
|
async function sanitizeEdgeVhosts(executor, sitesDir, onLog) {
|
|
66
66
|
const script = [
|
|
67
67
|
`for f in ${sq(sitesDir)}/*.conf; do`,
|
|
68
|
-
|
|
68
|
+
// A host-side vhost may be a symlink into /etc/nginx/sites-available. That
|
|
69
|
+
// target is deliberately not mounted in the edge container, so leaving the
|
|
70
|
+
// link here makes nginx's include glob fail at startup. Materialize valid
|
|
71
|
+
// links before the container mounts this directory; remove dangling ones.
|
|
72
|
+
` [ -e "$f" ] || [ -L "$f" ] || continue;`,
|
|
73
|
+
` if [ -L "$f" ]; then`,
|
|
74
|
+
` if [ ! -e "$f" ]; then`,
|
|
75
|
+
` echo "dropped-dangling-link $f"; rm -f "$f"; continue;`,
|
|
76
|
+
` fi;`,
|
|
77
|
+
` if cat "$f" > "$f.osh-link"; then`,
|
|
78
|
+
` rm -f "$f"; mv "$f.osh-link" "$f"; echo "materialized-link $f";`,
|
|
79
|
+
` else`,
|
|
80
|
+
` rm -f "$f.osh-link"; echo "dropped-unreadable-link $f"; rm -f "$f"; continue;`,
|
|
81
|
+
` fi;`,
|
|
82
|
+
` fi;`,
|
|
69
83
|
// A real server_name is anything that isn't the `_` wildcard.
|
|
70
84
|
` if ! grep -qE '^[[:space:]]*server_name[[:space:]]+[^_;[:space:]]' "$f"; then`,
|
|
71
85
|
` echo "dropped-catchall $f"; rm -f "$f"; continue;`,
|
|
@@ -82,6 +96,12 @@ async function sanitizeEdgeVhosts(executor, sitesDir, onLog) {
|
|
|
82
96
|
onLog(vhostLog(`Dropped catch-all vhost ${file} \u2014 the edge image provides it.`, "warn"));
|
|
83
97
|
} else if (action === "unset-default") {
|
|
84
98
|
onLog(vhostLog(`Removed default_server from ${file} \u2014 the edge image owns it.`, "warn"));
|
|
99
|
+
} else if (action === "materialized-link") {
|
|
100
|
+
onLog(vhostLog(`Materialized linked edge vhost ${file} for the container mount.`, "warn"));
|
|
101
|
+
} else if (action === "dropped-dangling-link") {
|
|
102
|
+
onLog(vhostLog(`Dropped dangling edge vhost link ${file}.`, "warn"));
|
|
103
|
+
} else if (action === "dropped-unreadable-link") {
|
|
104
|
+
onLog(vhostLog(`Dropped unreadable edge vhost link ${file}.`, "warn"));
|
|
85
105
|
}
|
|
86
106
|
}
|
|
87
107
|
}
|