openship 0.6.1 → 0.6.6
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 +7 -2
- package/dist/{bare-IWS2QHJ3.js → bare-OXJVW3AK.js} +11 -9
- package/dist/{chunk-VZ2ZHPS2.js → chunk-2YM3NI2E.js} +3 -9
- package/dist/chunk-4I2BM2DT.js +68 -0
- package/dist/{chunk-2NZSUXOB.js → chunk-5DMWSTOM.js} +310 -1459
- package/dist/{chunk-3FYIXVX5.js → chunk-77QDF6UD.js} +581 -122
- package/dist/{chunk-IOT5ZX23.js → chunk-A4GXYE4L.js} +449 -383
- package/dist/chunk-CBLD2HS5.js +428 -0
- package/dist/chunk-ELGRMZOW.js +25 -0
- package/dist/{chunk-TWJCLD4W.js → chunk-FE7ZZQSE.js} +5 -5
- package/dist/{chunk-3NZICQHF.js → chunk-HKRQXPTI.js} +31 -8
- package/dist/{chunk-IXM5245F.js → chunk-LFE5KQ7Y.js} +553 -538
- package/dist/{chunk-VDDMADOF.js → chunk-LH2PLRQO.js} +16 -2
- package/dist/{chunk-EMXI4UCU.js → chunk-LUKYPVJ4.js} +29 -10
- package/dist/{chunk-UC7YIEHT.js → chunk-MLYSEZQB.js} +352 -47
- package/dist/chunk-NK5N5LXN.js +1681 -0
- package/dist/{chunk-RRJJGVKE.js → chunk-OBPKYXQL.js} +75 -17
- package/dist/{chunk-6ODUBKUB.js → chunk-PCPVTH6M.js} +78 -88
- package/dist/chunk-Q7WGTQQ5.js +88 -0
- package/dist/{chunk-EW6KB2J7.js → chunk-QVW76WDL.js} +440 -74
- package/dist/{chunk-YIPMDGG6.js → chunk-RSR7PFIQ.js} +79 -23
- package/dist/{chunk-3LDWWY7U.js → chunk-SM26HDS2.js} +41 -7
- package/dist/{chunk-OTLSJYAC.js → chunk-UJ6JZM65.js} +5185 -341
- package/dist/chunk-UVNMQM7W.js +444 -0
- package/dist/chunk-VTGPEC6B.js +308 -0
- package/dist/chunk-WVAML4H6.js +2145 -0
- package/dist/{chunk-JIMUYEKN.js → chunk-YIMOCZBZ.js} +1 -1
- package/dist/chunk-YMMQRE5J.js +292 -0
- package/dist/cloud-75VIT4KV.js +37 -0
- package/dist/{detect-ALF4GXRX.js → detect-OIE5V3VZ.js} +3 -3
- package/dist/{docker-QECQJ5P4.js → docker-VTR2GK5Y.js} +16 -8
- package/dist/{docker-edge-executor-62N64MGS.js → docker-edge-executor-22IBXNYJ.js} +5 -5
- package/dist/{edge-import-SAYTRJLO.js → edge-import-WJUB4M7F.js} +27 -23
- package/dist/edge-preflight-GBNCPNVU.js +42 -0
- package/dist/{ensure-container-edge-CFSCPGZK.js → ensure-container-edge-KPI2CVXJ.js} +9 -8
- package/dist/{executor-PT6UEJ5M.js → executor-7LXXZPBR.js} +15 -5
- package/dist/host-channel-preflight-KE6OONYK.js +50 -0
- package/dist/index.js +3783 -4221
- package/dist/{nginx-YOEEFBTE.js → nginx-KUFMLMAC.js} +13 -5
- package/dist/node-bootstrap.js +241 -0
- package/dist/node-entry.js +52 -1
- package/dist/{openresty-lua-WGBO2M3Z.js → openresty-lua-ATTH35BE.js} +8 -2
- package/dist/privilege-I4W3ZNZK.js +19 -0
- package/dist/server/engine/samples/amavisd/amavisd.conf +25 -0
- package/dist/server/engine/samples/fail2ban/jail.d/sshd.local +4 -1
- package/dist/server/engine/samples/postfix/master.cf +14 -0
- package/dist/server/index.js +77659 -61909
- package/dist/server/migrations/0098_instance_product_mode.sql +12 -0
- package/dist/server/migrations/0099_mail_webmail_project.sql +24 -0
- package/dist/server/migrations/0100_server_ssh_private_key.sql +11 -0
- package/dist/server/migrations/0101_mail_resume_step.sql +12 -0
- package/dist/server/migrations/0102_project_workload_axes.sql +19 -0
- package/dist/server/migrations/0103_dns_credential.sql +41 -0
- package/dist/server/migrations/0104_instance_host_control.sql +15 -0
- package/dist/server/migrations/0105_mail_inbound_rules.sql +80 -0
- package/dist/server/migrations/0106_mcp_call_tracking.sql +23 -0
- package/dist/server/migrations/0107_build_minute_metering_indexes.sql +20 -0
- package/dist/server/migrations/0108_credential.sql +68 -0
- package/dist/server/migrations/meta/_journal.json +77 -0
- package/dist/{setup-M2ZDGH3O.js → setup-XGLGUUFW.js} +10 -9
- package/dist/ssh-client-JBMA7SN4.js +28 -0
- package/dist/up-K4BV7466.js +57 -0
- package/package.json +4 -2
- package/dist/chunk-IW2UKBVF.js +0 -144
- package/dist/chunk-ZCFVHA25.js +0 -89
- package/dist/cloud-M2YLWEXO.js +0 -31
- /package/dist/{dist-es-JGBPABJI.js → dist-es-AXFRS7PS.js} +0 -0
package/dist/chunk-IW2UKBVF.js
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env sh
|
|
2
|
-
":" //# ; exec "$(command -v node || command -v bun)" "$0" "$@"
|
|
3
|
-
import { createRequire as __ospCreateRequire } from "node:module";
|
|
4
|
-
const require = __ospCreateRequire(import.meta.url);
|
|
5
|
-
import {
|
|
6
|
-
formatDuration,
|
|
7
|
-
isRemoteConnectionError,
|
|
8
|
-
systemDebug
|
|
9
|
-
} from "./chunk-ZCFVHA25.js";
|
|
10
|
-
import {
|
|
11
|
-
safeErrorMessage
|
|
12
|
-
} from "./chunk-OTLSJYAC.js";
|
|
13
|
-
|
|
14
|
-
// ../../packages/adapters/src/system/environment.ts
|
|
15
|
-
var profileCache = /* @__PURE__ */ new WeakMap();
|
|
16
|
-
async function execSafe(executor, command, timeout = 5e3) {
|
|
17
|
-
const startedAt = Date.now();
|
|
18
|
-
systemDebug("environment", `exec:start ${command}`);
|
|
19
|
-
try {
|
|
20
|
-
const result = await executor.exec(command, { timeout });
|
|
21
|
-
systemDebug(
|
|
22
|
-
"environment",
|
|
23
|
-
`exec:ok ${command} (${formatDuration(startedAt)})`
|
|
24
|
-
);
|
|
25
|
-
return result;
|
|
26
|
-
} catch (err) {
|
|
27
|
-
if (isRemoteConnectionError(err)) {
|
|
28
|
-
systemDebug(
|
|
29
|
-
"environment",
|
|
30
|
-
`exec:abort ${command} (${formatDuration(startedAt)}) ${safeErrorMessage(err)}`
|
|
31
|
-
);
|
|
32
|
-
throw err;
|
|
33
|
-
}
|
|
34
|
-
const msg = safeErrorMessage(err);
|
|
35
|
-
systemDebug(
|
|
36
|
-
"environment",
|
|
37
|
-
`exec:fail ${command} (${formatDuration(startedAt)}) ${msg}`
|
|
38
|
-
);
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function parseOs(uname) {
|
|
43
|
-
const value = uname?.trim().toLowerCase();
|
|
44
|
-
if (value === "linux") return "linux";
|
|
45
|
-
if (value === "darwin") return "darwin";
|
|
46
|
-
return "unknown";
|
|
47
|
-
}
|
|
48
|
-
function parseArch(uname) {
|
|
49
|
-
const value = uname?.trim().toLowerCase() ?? "";
|
|
50
|
-
if (["x86_64", "amd64"].includes(value)) return "amd64";
|
|
51
|
-
if (["aarch64", "arm64"].includes(value)) return "arm64";
|
|
52
|
-
return "unknown";
|
|
53
|
-
}
|
|
54
|
-
function parseDistro(osRelease) {
|
|
55
|
-
if (!osRelease) return null;
|
|
56
|
-
const lower = osRelease.toLowerCase();
|
|
57
|
-
const match = lower.match(/^id=(.+)$/m);
|
|
58
|
-
const id = match?.[1]?.replaceAll('"', "").trim();
|
|
59
|
-
switch (id) {
|
|
60
|
-
case "ubuntu":
|
|
61
|
-
return "ubuntu";
|
|
62
|
-
case "debian":
|
|
63
|
-
return "debian";
|
|
64
|
-
case "fedora":
|
|
65
|
-
return "fedora";
|
|
66
|
-
case "rhel":
|
|
67
|
-
case "rhel server":
|
|
68
|
-
return "rhel";
|
|
69
|
-
case "centos":
|
|
70
|
-
return "centos";
|
|
71
|
-
case "alpine":
|
|
72
|
-
return "alpine";
|
|
73
|
-
default:
|
|
74
|
-
return "unknown";
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
async function detectPackageManager(executor) {
|
|
78
|
-
const checks = [
|
|
79
|
-
["apt", "command -v apt-get"],
|
|
80
|
-
["dnf", "command -v dnf"],
|
|
81
|
-
["yum", "command -v yum"],
|
|
82
|
-
["apk", "command -v apk"],
|
|
83
|
-
["brew", "command -v brew"]
|
|
84
|
-
];
|
|
85
|
-
for (const [pm, command] of checks) {
|
|
86
|
-
if (await execSafe(executor, command)) return pm;
|
|
87
|
-
}
|
|
88
|
-
return "none";
|
|
89
|
-
}
|
|
90
|
-
async function detectServiceManager(executor) {
|
|
91
|
-
if (await execSafe(executor, "command -v systemctl")) return "systemd";
|
|
92
|
-
if (await execSafe(executor, "command -v launchctl")) return "launchd";
|
|
93
|
-
return "none";
|
|
94
|
-
}
|
|
95
|
-
async function detectPrivilege(executor) {
|
|
96
|
-
const uid = await execSafe(executor, "id -u");
|
|
97
|
-
const isRoot = uid?.trim() === "0";
|
|
98
|
-
if (isRoot) return { isRoot: true, canSudo: false };
|
|
99
|
-
const sudo = await execSafe(
|
|
100
|
-
executor,
|
|
101
|
-
"sudo -n true 2>/dev/null && echo yes || echo no"
|
|
102
|
-
);
|
|
103
|
-
return { isRoot: false, canSudo: sudo?.trim() === "yes" };
|
|
104
|
-
}
|
|
105
|
-
async function detectProfile(executor) {
|
|
106
|
-
const startedAt = Date.now();
|
|
107
|
-
systemDebug("environment", "detect:start");
|
|
108
|
-
const unameOs = await execSafe(executor, "uname -s");
|
|
109
|
-
const unameArch = await execSafe(executor, "uname -m");
|
|
110
|
-
const osRelease = await execSafe(executor, "cat /etc/os-release");
|
|
111
|
-
const packageManager = await detectPackageManager(executor);
|
|
112
|
-
const serviceManager = await detectServiceManager(executor);
|
|
113
|
-
const { isRoot, canSudo } = await detectPrivilege(executor);
|
|
114
|
-
const os = parseOs(unameOs);
|
|
115
|
-
const profile = {
|
|
116
|
-
os,
|
|
117
|
-
arch: parseArch(unameArch),
|
|
118
|
-
distro: os === "linux" ? parseDistro(osRelease) : null,
|
|
119
|
-
packageManager,
|
|
120
|
-
serviceManager,
|
|
121
|
-
isRoot,
|
|
122
|
-
canSudo
|
|
123
|
-
};
|
|
124
|
-
systemDebug(
|
|
125
|
-
"environment",
|
|
126
|
-
`detect:done (${formatDuration(startedAt)}) ${JSON.stringify(profile)}`
|
|
127
|
-
);
|
|
128
|
-
return profile;
|
|
129
|
-
}
|
|
130
|
-
async function resolveEnvironment(executor) {
|
|
131
|
-
let promise = profileCache.get(executor);
|
|
132
|
-
if (!promise) {
|
|
133
|
-
systemDebug("environment", "cache:miss");
|
|
134
|
-
promise = detectProfile(executor);
|
|
135
|
-
profileCache.set(executor, promise);
|
|
136
|
-
} else {
|
|
137
|
-
systemDebug("environment", "cache:hit");
|
|
138
|
-
}
|
|
139
|
-
return promise;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export {
|
|
143
|
-
resolveEnvironment
|
|
144
|
-
};
|
package/dist/chunk-ZCFVHA25.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env sh
|
|
2
|
-
":" //# ; exec "$(command -v node || command -v bun)" "$0" "$@"
|
|
3
|
-
import { createRequire as __ospCreateRequire } from "node:module";
|
|
4
|
-
const require = __ospCreateRequire(import.meta.url);
|
|
5
|
-
|
|
6
|
-
// ../../packages/adapters/src/system/errors.ts
|
|
7
|
-
var SSH_AUTH_ERROR_PATTERNS = [
|
|
8
|
-
"All configured authentication methods failed"
|
|
9
|
-
];
|
|
10
|
-
var RETRYABLE_CONNECTION_ERROR_PATTERNS = [
|
|
11
|
-
"ECONNRESET",
|
|
12
|
-
"ECONNREFUSED",
|
|
13
|
-
"ETIMEDOUT",
|
|
14
|
-
"EHOSTUNREACH",
|
|
15
|
-
"ENETUNREACH",
|
|
16
|
-
"Timed out",
|
|
17
|
-
"Not connected",
|
|
18
|
-
"Connection lost",
|
|
19
|
-
"read ECONNRESET",
|
|
20
|
-
"Handshake failed",
|
|
21
|
-
"keepalive timeout",
|
|
22
|
-
"SSH connection closed before ready",
|
|
23
|
-
// ssh2 emits "Channel open failure: open failed" / "Channel open failure: …"
|
|
24
|
-
// when the SSH SERVER refuses a new channel - typically because the cached
|
|
25
|
-
// connection has gone half-dead (peer-side LOGOUT, network blip,
|
|
26
|
-
// remote sshd MaxSessions). The inner SshExecutor retries `exec`/
|
|
27
|
-
// `streamExec` on this, but `pipeLocal`, `transferIn`, and any other
|
|
28
|
-
// channel-bearing op bubble it up. Listing it here lets `withExecutor`
|
|
29
|
-
// drop the dead connection and retry transparently - fixes the
|
|
30
|
-
// "first redeploy fails, second click works" pattern.
|
|
31
|
-
"Channel open failure",
|
|
32
|
-
"open failed"
|
|
33
|
-
];
|
|
34
|
-
var SshDisconnectedError = class extends Error {
|
|
35
|
-
constructor(message = "SSH connection lost") {
|
|
36
|
-
super(message);
|
|
37
|
-
this.name = "SshDisconnectedError";
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
function isSshDisconnectedError(err) {
|
|
41
|
-
return err instanceof SshDisconnectedError || err instanceof Error && err.name === "SshDisconnectedError";
|
|
42
|
-
}
|
|
43
|
-
function isSshAuthError(err) {
|
|
44
|
-
if (!(err instanceof Error)) return false;
|
|
45
|
-
return SSH_AUTH_ERROR_PATTERNS.some((pattern) => err.message.includes(pattern));
|
|
46
|
-
}
|
|
47
|
-
function isRetryableRemoteConnectionError(err) {
|
|
48
|
-
if (isSshDisconnectedError(err)) return true;
|
|
49
|
-
if (!(err instanceof Error)) return false;
|
|
50
|
-
return RETRYABLE_CONNECTION_ERROR_PATTERNS.some(
|
|
51
|
-
(pattern) => err.message.includes(pattern)
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
function isRemoteConnectionError(err) {
|
|
55
|
-
return isSshAuthError(err) || isRetryableRemoteConnectionError(err);
|
|
56
|
-
}
|
|
57
|
-
function isRuntimeNotFoundError(err) {
|
|
58
|
-
if (!err || typeof err !== "object") return false;
|
|
59
|
-
const e = err;
|
|
60
|
-
if (e.statusCode === 404) return true;
|
|
61
|
-
return typeof e.message === "string" && /no such (container|image|volume|network)/i.test(e.message);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// ../../packages/adapters/src/system/debug.ts
|
|
65
|
-
function isTruthy(value) {
|
|
66
|
-
if (!value) return false;
|
|
67
|
-
return ["1", "true", "yes", "on", "debug"].includes(value.toLowerCase());
|
|
68
|
-
}
|
|
69
|
-
function isSystemDebugEnabled() {
|
|
70
|
-
return isTruthy(process.env.SYSTEM_DEBUG_LOGS);
|
|
71
|
-
}
|
|
72
|
-
function systemDebug(scope, message) {
|
|
73
|
-
if (!isSystemDebugEnabled()) return;
|
|
74
|
-
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
75
|
-
console.log(`[system-debug] ${timestamp} [${scope}] ${message}`);
|
|
76
|
-
}
|
|
77
|
-
function formatDuration(startMs) {
|
|
78
|
-
return `${Date.now() - startMs}ms`;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export {
|
|
82
|
-
SshDisconnectedError,
|
|
83
|
-
isSshAuthError,
|
|
84
|
-
isRetryableRemoteConnectionError,
|
|
85
|
-
isRemoteConnectionError,
|
|
86
|
-
isRuntimeNotFoundError,
|
|
87
|
-
systemDebug,
|
|
88
|
-
formatDuration
|
|
89
|
-
};
|
package/dist/cloud-M2YLWEXO.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env sh
|
|
2
|
-
":" //# ; exec "$(command -v node || command -v bun)" "$0" "$@"
|
|
3
|
-
import { createRequire as __ospCreateRequire } from "node:module";
|
|
4
|
-
const require = __ospCreateRequire(import.meta.url);
|
|
5
|
-
import {
|
|
6
|
-
CloudRuntime,
|
|
7
|
-
PAGE_CONTAINER_PREFIX,
|
|
8
|
-
provisionCloudWorkspace
|
|
9
|
-
} from "./chunk-RRJJGVKE.js";
|
|
10
|
-
import "./chunk-IOT5ZX23.js";
|
|
11
|
-
import "./chunk-EMXI4UCU.js";
|
|
12
|
-
import "./chunk-JIMUYEKN.js";
|
|
13
|
-
import "./chunk-IW2UKBVF.js";
|
|
14
|
-
import "./chunk-VDDMADOF.js";
|
|
15
|
-
import "./chunk-UC7YIEHT.js";
|
|
16
|
-
import "./chunk-6ODUBKUB.js";
|
|
17
|
-
import "./chunk-ZCFVHA25.js";
|
|
18
|
-
import "./chunk-6FH4AXVY.js";
|
|
19
|
-
import "./chunk-EW6KB2J7.js";
|
|
20
|
-
import "./chunk-I3DPMTSF.js";
|
|
21
|
-
import "./chunk-VZ2ZHPS2.js";
|
|
22
|
-
import "./chunk-3LDWWY7U.js";
|
|
23
|
-
import "./chunk-YIPMDGG6.js";
|
|
24
|
-
import "./chunk-ZFJXPCQP.js";
|
|
25
|
-
import "./chunk-OTLSJYAC.js";
|
|
26
|
-
import "./chunk-PXKCZB2I.js";
|
|
27
|
-
export {
|
|
28
|
-
CloudRuntime,
|
|
29
|
-
PAGE_CONTAINER_PREFIX,
|
|
30
|
-
provisionCloudWorkspace
|
|
31
|
-
};
|
|
File without changes
|