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/README.md
CHANGED
|
@@ -77,10 +77,13 @@ From the desktop app you connect a server (SSH) or Openship Cloud and deploy to
|
|
|
77
77
|
Install the CLI (it bundles the API + dashboard), then run **`openship`** — an interactive wizard creates the first admin, wires your domain, and installs Openship as a boot service. Run it again anytime to manage the instance.
|
|
78
78
|
|
|
79
79
|
```bash
|
|
80
|
-
curl -fsSL https://get.openship.io | sh # install (or: npm i -g openship)
|
|
80
|
+
curl -fsSL https://get.openship.io | sh # install (or: npm i -g openship — needs Node 22+)
|
|
81
81
|
openship # guided setup, then control panel
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
+
The install script brings its own Node when your system one is older than 22; a package-manager
|
|
85
|
+
install runs on the Node you already have.
|
|
86
|
+
|
|
84
87
|
For CI / headless boxes, skip the wizard and drive `openship up` directly:
|
|
85
88
|
|
|
86
89
|
```bash
|
|
@@ -154,7 +157,9 @@ docker compose --env-file .env -f docker/docker-compose.yml up -d
|
|
|
154
157
|
|
|
155
158
|
The stack is **postgres + redis + api + dashboard + edge**. The `edge` is OpenResty on **:80/:443** as a container (`network_mode: host`) — routing + Let's Encrypt, no bare host install. **Linux only** (host networking); on mac/win use `openship up` (bare). The `api` container mounts the host Docker socket so the control plane can build + run your apps as host containers — it's host-privileged through the socket, so run it only on a trusted host.
|
|
156
159
|
|
|
157
|
-
**Upgrade:** pin `OPENSHIP_VERSION` in `.env` for reproducible pulls, then `docker compose --env-file .env -f docker/docker-compose.yml pull && … up -d`
|
|
160
|
+
**Upgrade:** pin `OPENSHIP_VERSION` in `.env` for reproducible pulls, then `docker compose --env-file .env -f docker/docker-compose.yml pull && … up -d`. `openship update` only reconciles a stack the CLI installed, and `openship up` would *adopt* this one — don't reach for either here. **Build from source instead:** add `-f docker/docker-compose.build.yml … up -d --build`.
|
|
161
|
+
|
|
162
|
+
**Host operations** (`:80`/`:443` takeover, the mail engine, host terminal/port scans) need the container→host SSH channel, which `openship up` provisions and this path does not — the five manual steps are in `.env.example` under *Host operations from the container*, and the failure it produces is [Troubleshooting → Host control channel](https://openship.io/docs/troubleshooting/host-channel). Everything else, including deploys, works without it.
|
|
158
163
|
|
|
159
164
|
> The **root** `docker-compose.yml` is a different file: it's the SaaS / from-source **control plane** (builds from source, ships the marketing site, no edge/socket). It does **not** self-host your apps — use `docker/docker-compose.yml` above or `openship up`.
|
|
160
165
|
|
|
@@ -5,17 +5,19 @@ 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-
|
|
14
|
-
import "./chunk-ZCFVHA25.js";
|
|
8
|
+
} from "./chunk-LFE5KQ7Y.js";
|
|
9
|
+
import "./chunk-YIMOCZBZ.js";
|
|
10
|
+
import "./chunk-LH2PLRQO.js";
|
|
11
|
+
import "./chunk-MLYSEZQB.js";
|
|
12
|
+
import "./chunk-Q7WGTQQ5.js";
|
|
13
|
+
import "./chunk-PCPVTH6M.js";
|
|
15
14
|
import "./chunk-6FH4AXVY.js";
|
|
16
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-4I2BM2DT.js";
|
|
16
|
+
import "./chunk-YMMQRE5J.js";
|
|
17
|
+
import "./chunk-UVNMQM7W.js";
|
|
17
18
|
import "./chunk-ZFJXPCQP.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-SM26HDS2.js";
|
|
20
|
+
import "./chunk-UJ6JZM65.js";
|
|
19
21
|
import "./chunk-PXKCZB2I.js";
|
|
20
22
|
export {
|
|
21
23
|
BareRuntime,
|
|
@@ -5,11 +5,12 @@ const require = __ospCreateRequire(import.meta.url);
|
|
|
5
5
|
import {
|
|
6
6
|
describeProcess,
|
|
7
7
|
probeListeningPort,
|
|
8
|
+
tryExec,
|
|
8
9
|
waitForPortFree
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SM26HDS2.js";
|
|
10
11
|
import {
|
|
11
12
|
AppError
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-UJ6JZM65.js";
|
|
13
14
|
|
|
14
15
|
// ../../packages/adapters/src/system/proxy/detect.ts
|
|
15
16
|
var EDGE_PORTS = [80, 443];
|
|
@@ -33,13 +34,6 @@ var EdgeMigrateRequested = class extends Error {
|
|
|
33
34
|
this.name = "EdgeMigrateRequested";
|
|
34
35
|
}
|
|
35
36
|
};
|
|
36
|
-
async function tryExec(executor, command) {
|
|
37
|
-
try {
|
|
38
|
-
return await executor.exec(command);
|
|
39
|
-
} catch {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
37
|
function classifyProxy(text) {
|
|
44
38
|
if (!text) return void 0;
|
|
45
39
|
const t = text.toLowerCase();
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
hostRefusal
|
|
7
|
+
} from "./chunk-YMMQRE5J.js";
|
|
8
|
+
import {
|
|
9
|
+
elevatedExecutor,
|
|
10
|
+
resolveEnvironment
|
|
11
|
+
} from "./chunk-UVNMQM7W.js";
|
|
12
|
+
import {
|
|
13
|
+
answered,
|
|
14
|
+
refused
|
|
15
|
+
} from "./chunk-UJ6JZM65.js";
|
|
16
|
+
|
|
17
|
+
// ../../packages/adapters/src/system/privilege.ts
|
|
18
|
+
function rootChecked(executor, why) {
|
|
19
|
+
void why;
|
|
20
|
+
return executor;
|
|
21
|
+
}
|
|
22
|
+
var REFUSES_HOST = {
|
|
23
|
+
refuse: true,
|
|
24
|
+
proceed: false
|
|
25
|
+
};
|
|
26
|
+
async function privilegedExecutor(executor, purpose, opts = {}) {
|
|
27
|
+
const profile = await resolveEnvironment(executor);
|
|
28
|
+
const refusal = hostRefusal(profile);
|
|
29
|
+
if (refusal && REFUSES_HOST[opts.onRefusedHost ?? "refuse"]) return refused(refusal);
|
|
30
|
+
const grant = (elevation, why, exec = executor) => answered({ executor: rootChecked(exec, why), profile, elevation });
|
|
31
|
+
if (profile.isRoot) return grant("root", "the login is root");
|
|
32
|
+
if (profile.canSudo) {
|
|
33
|
+
return grant("sudo", "non-root login with passwordless sudo", elevatedExecutor(executor));
|
|
34
|
+
}
|
|
35
|
+
if (refusal) return grant("none", "caller chose to proceed unprivileged on a refused host");
|
|
36
|
+
return refused(
|
|
37
|
+
`${purpose} needs root. Connect this server as root, or as a user with passwordless sudo.`
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
async function rootOrDegrade(executor, opts) {
|
|
41
|
+
const grant = await privilegedExecutor(executor, opts.purpose, {
|
|
42
|
+
// A host we won't PROVISION we can still write files on — none of this installs
|
|
43
|
+
// packages. Refusing here would take a working edge away from an openSUSE box.
|
|
44
|
+
onRefusedHost: "proceed"
|
|
45
|
+
}).catch((err) => {
|
|
46
|
+
opts.report(
|
|
47
|
+
`${opts.purpose}: could not check this host's privileges (${err instanceof Error ? err.message : String(err)}). ${opts.consequence}`
|
|
48
|
+
);
|
|
49
|
+
return null;
|
|
50
|
+
});
|
|
51
|
+
if (!grant) return rootChecked(executor, "host unmeasurable; reported and degraded");
|
|
52
|
+
if (!grant.supported) {
|
|
53
|
+
opts.report(`${grant.reason} ${opts.consequence}`);
|
|
54
|
+
return rootChecked(executor, "gate refused the host; reported and degraded");
|
|
55
|
+
}
|
|
56
|
+
if (grant.value.elevation === "none") {
|
|
57
|
+
opts.report(
|
|
58
|
+
`${opts.purpose} needs root, and this host's login is neither root nor able to sudo. ${opts.consequence}`
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
return grant.value.executor;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
rootChecked,
|
|
66
|
+
privilegedExecutor,
|
|
67
|
+
rootOrDegrade
|
|
68
|
+
};
|