@ours.network/install 1.2.1-nightly.14 → 1.2.1-nightly.16
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 +71 -0
- package/ROOTLESS_PODMAN_VALIDATION.md +210 -0
- package/assets/Dockerfile.gateway +3 -2
- package/assets/gateway-entrypoint.sh +37 -0
- package/assets/release-lock.json +10 -10
- package/assets/release.json +3 -3
- package/assets/scripts/maintenance/docker-layout-conversion.mjs +4 -2
- package/assets/sources.json +4 -4
- package/lib/container-engine.mjs +127 -0
- package/lib/docker-conversion-runtime.mjs +3 -2
- package/lib/docker-layout-installation.mjs +2 -1
- package/lib/docker-runtime-repair.mjs +8 -7
- package/lib/effects.mjs +115 -51
- package/lib/gateway.mjs +1 -1
- package/lib/legacy-migration.mjs +13 -2
- package/lib/orchestrate.mjs +2 -1
- package/lib/plan.mjs +5 -2
- package/lib/podman-preflight.mjs +40 -0
- package/lib/setup-options.mjs +2 -1
- package/lib/setup.mjs +1 -0
- package/lib/target.mjs +3 -2
- package/lib/usage.mjs +1 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -443,3 +443,74 @@ separately for Compose port isolation with a client container. That routing test
|
|
|
443
443
|
uses echo upstreams; the real-service test covers Fleet room operations, browser
|
|
444
444
|
paths, external authentication and Messenger WebSocket access. Neither test is
|
|
445
445
|
cross-platform Docker Desktop qualification or a live deployment test.
|
|
446
|
+
|
|
447
|
+
### Rootless Podman (qualification in progress)
|
|
448
|
+
|
|
449
|
+
Container installations can select a local Linux rootless backend explicitly:
|
|
450
|
+
|
|
451
|
+
```sh
|
|
452
|
+
export PODMAN_COMPOSE_PROVIDER=/absolute/path/to/docker-compose
|
|
453
|
+
ours-install server install --mode docker --container-engine podman \
|
|
454
|
+
--state-dir "$HOME/.ours-server-podman" --identity-name "Your Name"
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
`mode: docker` remains the legacy container-layout name. `containerEngine` and
|
|
458
|
+
`containerBinding` retain Podman, the invoking UID, native storage paths, socket
|
|
459
|
+
and standalone Compose provider, plus the UID/GID mapping fingerprint. Records without `containerEngine` continue to
|
|
460
|
+
use Docker. Package/client installs reject the engine option. Existing records
|
|
461
|
+
cannot change engines through a flag or ambient connection change; automatic
|
|
462
|
+
Docker-to-Podman data migration is not provided. Legacy local-daemon migration
|
|
463
|
+
(`--migrate-from`) to Podman is also unsupported and is refused before source
|
|
464
|
+
shutdown or managed CLI publication, including migration retries. Use a fresh
|
|
465
|
+
Podman installation, or migrate the legacy daemon with Docker/packages.
|
|
466
|
+
|
|
467
|
+
Podman uses its native build command, with the same resolved Compose build
|
|
468
|
+
context, target, architecture, arguments and secret references, followed by
|
|
469
|
+
Compose `--no-build` startup. It does not require the Docker CLI or daemon.
|
|
470
|
+
The selected standalone Docker Compose provider must be version 2.35 or newer;
|
|
471
|
+
version checks do not replace the behavioral capability probe. `podman-compose`
|
|
472
|
+
is not an interchangeable provider for this implementation. Secrets sourced
|
|
473
|
+
from environment variables use Podman's native build-secret mechanism, never
|
|
474
|
+
build arguments or temporary copies.
|
|
475
|
+
|
|
476
|
+
Prerequisites include a working rootless API socket, sufficient subordinate
|
|
477
|
+
UID/GID mappings, and native volume-subpath isolation. Before setup/start, an
|
|
478
|
+
isolated disposable project tests Compose `!reset`, health waiting, JSON status,
|
|
479
|
+
service DNS, private UID-1000 storage and subpath isolation. A failed check stops
|
|
480
|
+
installation rather than substituting the whole volume. Existing volumes must
|
|
481
|
+
have this installation's project and volume labels. Docker contexts, unrelated
|
|
482
|
+
containers and host directory ownership are not changed.
|
|
483
|
+
|
|
484
|
+
Server boot recovery requires an enabled user `podman.socket`, an enabled
|
|
485
|
+
`podman-restart.service` using `--filter should-start-on-boot=true`, and user
|
|
486
|
+
linger. The standard user-service environment/default socket must select the
|
|
487
|
+
same storage; custom XDG paths and sockets are rejected for server startup.
|
|
488
|
+
The installer diagnoses missing prerequisites and never runs hidden sudo or
|
|
489
|
+
rewrites the vendor unit. Long-running Podman services get `unless-stopped`;
|
|
490
|
+
administration jobs do not. Stop/status remain available when boot prerequisites
|
|
491
|
+
are missing, provided the retained backend is accessible. Runtime-only test
|
|
492
|
+
harnesses may select a separate local socket with `OURS_PODMAN_SOCKET`; its
|
|
493
|
+
storage must match native Podman and the selection cannot change afterward.
|
|
494
|
+
|
|
495
|
+
Gateway images read and validate IPv4/IPv6 nameservers from their container at
|
|
496
|
+
startup. Only the resolver placeholder is replaced; nginx variables and existing
|
|
497
|
+
authentication/routes remain intact. UID 101, read-only rootfs, dropped
|
|
498
|
+
capabilities and tmpfs are retained. Setup and start verify authenticated
|
|
499
|
+
upstream requests in addition to liveness.
|
|
500
|
+
|
|
501
|
+
This change is **not yet a fully qualified server-support release**. Debian's
|
|
502
|
+
Podman 5.4.2 with Compose 5.5.1 failed subpath isolation and has incompatible boot
|
|
503
|
+
recovery semantics. Podman 6.1.2 passed the isolated capability probe on native
|
|
504
|
+
Linux amd64; production and prerelease-source builds, service lifecycle, rebuild and scoped maintenance also passed. See [validation evidence](ROOTLESS_PODMAN_VALIDATION.md). The full public installer/maintenance matrix,
|
|
505
|
+
SELinux Enforcing, logout/reboot, explicit-stop recovery, and Docker regression
|
|
506
|
+
matrix must all be recorded before declaring a supported engine/provider pair.
|
|
507
|
+
The supplied ARM VM results are historical feasibility evidence, not this
|
|
508
|
+
release's qualification.
|
|
509
|
+
|
|
510
|
+
Opt-in gateway fixture (isolated project, only owned resources removed):
|
|
511
|
+
|
|
512
|
+
```sh
|
|
513
|
+
OURS_TEST_DOCKER=1 node --test test/gateway-docker.test.mjs
|
|
514
|
+
PODMAN_COMPOSE_PROVIDER=/absolute/path/to/docker-compose \
|
|
515
|
+
OURS_TEST_PODMAN=1 node --test test/gateway-docker.test.mjs
|
|
516
|
+
```
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# Rootless Podman integration validation
|
|
2
|
+
|
|
3
|
+
Status: implementation under review; **not a qualified server-support release**.
|
|
4
|
+
Validation date: 2026-09-25. No production deployment, migration, restart or merge.
|
|
5
|
+
|
|
6
|
+
## Scope and source baseline
|
|
7
|
+
|
|
8
|
+
The supplied `rootless-podman-support.zip` was inspected as design/evidence,
|
|
9
|
+
not executable authority. SHA-256:
|
|
10
|
+
`0eafc865566be71bcb87d432a98384da47e6d153e4395d9cfe721b4def168e96`.
|
|
11
|
+
It contains six substantive Markdown documents and no implementation patches.
|
|
12
|
+
Its historical ARM VM observations do not establish current Linux amd64 support.
|
|
13
|
+
|
|
14
|
+
All referenced repositories were fetched into isolated checkouts at these
|
|
15
|
+
`prerelease` commits. SDK, CLI and daemon share the SDK repository; the MCP
|
|
16
|
+
repository also supplies Codex and Claude Code integrations.
|
|
17
|
+
|
|
18
|
+
| Repository | Commit |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| ours-network | a9ae420d2878a304911e94d53d0cdd2cff06f299 |
|
|
21
|
+
| ours-sdk | 737e1028cabadcbb8837548923c7a92b49e9e575 |
|
|
22
|
+
| ours-cowork | 2d2ff8979756678068b8f6b85c619f6d811010ff |
|
|
23
|
+
| ours-messenger-server | 5e2ca2be5789a5300fcbed08a0dd26b9b59780ef |
|
|
24
|
+
| ours-tg-connector | 21f4bf92b52e1d61261987f298bcc76248cddb78 |
|
|
25
|
+
| ours-fleet | 717f6d8a09e6173b9b8a017fc5efb08d71927524 |
|
|
26
|
+
| ours-mcp | ce6e3e0298b83aec0257c4ae3773d785d8b38889 |
|
|
27
|
+
|
|
28
|
+
Runtime launch/build/maintenance and gateway packaging belong to ours-network;
|
|
29
|
+
no source changes were required in the other repositories. Host Fleet and harness
|
|
30
|
+
integrations continue using their existing client paths. Their unrelated feature
|
|
31
|
+
suites are not implied by the installer results below.
|
|
32
|
+
|
|
33
|
+
## Corrections established by testing
|
|
34
|
+
|
|
35
|
+
- This prerelease already checks authenticated gateway readiness during install.
|
|
36
|
+
The added lifecycle check covers full starts and preserves intentionally stopped
|
|
37
|
+
applications during partial runtime restoration.
|
|
38
|
+
- Podman 5.4.2 with Compose 5.5.1 exposes the whole named volume instead of the
|
|
39
|
+
requested subpath. Its vendor restart unit also lacks `should-start-on-boot`.
|
|
40
|
+
The new preflight rejects this combination rather than weakening isolation.
|
|
41
|
+
- Local and API Podman must select the same rootless store. Compose is passed an
|
|
42
|
+
explicit Unix socket; native builds use the retained root/runroot/driver.
|
|
43
|
+
Both report the same retained UID/GID mapping fingerprint.
|
|
44
|
+
- Podman image IDs need Docker-compatible `sha256:` normalization at the adapter
|
|
45
|
+
boundary. Missing-object detection must not reinterpret inspect error 125 as
|
|
46
|
+
permission to create or replace an object.
|
|
47
|
+
- Compose excludes maintenance profiles from ordinary configuration output and
|
|
48
|
+
implicitly builds absent administration images. Native build resolution enables
|
|
49
|
+
all profiles and builds the selected missing administration image first.
|
|
50
|
+
- Fresh schema-2 installations omit embedded `networkMcp`; the shared rebuild
|
|
51
|
+
validator previously required it. Validation now accepts absence and still
|
|
52
|
+
rejects malformed or conflicting embedded configuration, while retaining
|
|
53
|
+
standalone-profile, credential, provenance and strict legacy conversion checks.
|
|
54
|
+
- Gateway COPY destinations must remain accessible to UID 101 on both engines.
|
|
55
|
+
Runtime DNS comes from validated container nameservers, retaining nginx variables.
|
|
56
|
+
|
|
57
|
+
## Observed environment and results
|
|
58
|
+
|
|
59
|
+
Native Debian 13 Linux amd64, unprivileged UID 1000, subordinate UID/GID ranges,
|
|
60
|
+
SELinux disabled, standalone Docker Compose 5.5.1. Podman 6.1.2 was built from
|
|
61
|
+
upstream tag commit `04f3aa430e6df81bea059978bc5bafbc846ba3e7` with systemd and
|
|
62
|
+
seccomp support, using netavark/aardvark-dns 2.1.0. A separate task store and API
|
|
63
|
+
socket isolated all Podman tests from the installed 5.4.2 default backend.
|
|
64
|
+
|
|
65
|
+
- Behavioral preflight: PASS on 6.1.2, including UID-1000 private storage,
|
|
66
|
+
volume subpath isolation, DNS, Compose reset/wait/JSON status.
|
|
67
|
+
- Native synthetic secret/cache build: PASS; secret absent from command arguments,
|
|
68
|
+
build output, image inspect/history and final filesystem.
|
|
69
|
+
- Production runtime: native build of the shipped exact package/integrity policy,
|
|
70
|
+
runtime metadata and gateway artifact capability qualification PASS.
|
|
71
|
+
- Development runtime: native build from all exact prerelease commits above,
|
|
72
|
+
including private SDK/submodule acquisition through an environment build secret,
|
|
73
|
+
native compilation and gateway capability qualification PASS. The source-built
|
|
74
|
+
five-service lifecycle and authenticated gateway also PASS.
|
|
75
|
+
- Real runtime: prepare, access-init/access-issue, test Human identity, all five
|
|
76
|
+
services, authenticated gateway readiness, stop/status/start PASS.
|
|
77
|
+
- Maintenance: server backup/restore and Cowork backup/reset/restore PASS; all
|
|
78
|
+
services subsequently restarted with authenticated gateway readiness.
|
|
79
|
+
- Rebuild: the initial fresh-layout validator defect was reproduced and fixed;
|
|
80
|
+
retained transition recovery PASS after rebuilding the maintenance helper. A
|
|
81
|
+
second complete rebuild using final code and the real installation lock PASS,
|
|
82
|
+
including offline state validation and authenticated gateway readiness.
|
|
83
|
+
- Gateway runtime: Docker 2/2 and Podman 2/2 PASS for root/nested paths,
|
|
84
|
+
authentication, WebSockets and changed backend IPs. Combined Podman native
|
|
85
|
+
capability/build-secret and gateway tests: 4/4 PASS.
|
|
86
|
+
- Installer suite: 756 passed, 0 failed, 11 opt-in tests skipped; subsequent
|
|
87
|
+
adapter-only addition separately passed (13 adapter tests).
|
|
88
|
+
- Independent Critic reruns confirmed the behavioral/native-secret tests and
|
|
89
|
+
adapter regressions. Final review is recorded separately from these observations.
|
|
90
|
+
|
|
91
|
+
The runtime harness called actual installer effects against owned resources.
|
|
92
|
+
It deliberately did not claim a complete public install: the isolated custom
|
|
93
|
+
store/socket cannot satisfy standard vendor boot-unit selection, and the public
|
|
94
|
+
preflight rejects that configuration. A harness backup label collision was
|
|
95
|
+
correctly rejected; separate per-domain labels were used afterward.
|
|
96
|
+
|
|
97
|
+
## Reproduction and remaining release gates
|
|
98
|
+
|
|
99
|
+
From `packages/installer`, with installed package dependencies:
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
umask 022
|
|
103
|
+
node --test
|
|
104
|
+
OURS_TEST_DOCKER=1 node --test test/gateway-docker.test.mjs
|
|
105
|
+
PODMAN_COMPOSE_PROVIDER=/absolute/path/to/docker-compose \
|
|
106
|
+
OURS_TEST_PODMAN=1 node --test test/podman-integration.test.mjs test/gateway-docker.test.mjs
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The gateway fixture covers root and nested base paths, discovery, service routing,
|
|
110
|
+
forged-host denial, Telegram authentication, WebSocket upgrade and backend IP
|
|
111
|
+
replacement without restarting nginx. Test projects and their resources are
|
|
112
|
+
uniquely named and cleaned up. The Podman tests require a functional matching API
|
|
113
|
+
socket; `OURS_PODMAN_SOCKET` can select an isolated harness socket.
|
|
114
|
+
|
|
115
|
+
Before advertising a supported engine/provider pair, run the full public installer
|
|
116
|
+
and update/rebuild/legacy-conversion matrix on a disposable native Linux amd64
|
|
117
|
+
host with SELinux Enforcing, standard vendor user units, logout/linger, reboot,
|
|
118
|
+
unexpected exit and explicit-stop behavior. Include Docker parity for the full
|
|
119
|
+
maintenance matrix. This shared host is not a safe reboot/SELinux test target.
|
|
120
|
+
No fallback to privileged containers, whole-volume service mounts, host chown,
|
|
121
|
+
keep-id, or globally disabled SELinux is permitted.
|
|
122
|
+
|
|
123
|
+
### Disposable VM handoff
|
|
124
|
+
|
|
125
|
+
Provision a dedicated x86_64 VM (at least 4 vCPU, 8 GiB RAM, 40 GiB free disk)
|
|
126
|
+
whose distribution supplies Podman 6.1.2, compatible netavark/aardvark, subordinate
|
|
127
|
+
UID/GID support and vendor `podman-restart.service` with
|
|
128
|
+
`--filter should-start-on-boot=true`. Use an unprivileged test account, cgroup v2,
|
|
129
|
+
standard HOME/XDG paths, SELinux **Enforcing**, Node.js 22+, npm, Python 3.9+
|
|
130
|
+
with `os.pidfd_open`/`signal.pidfd_send_signal` support, and standalone
|
|
131
|
+
Docker Compose 5.5.1. The Podman pass must have no Docker CLI/daemon dependency.
|
|
132
|
+
The VM owner must explicitly authorize reboots and terminate all sessions for the
|
|
133
|
+
logout test. These commands are for that disposable VM, not the shared host.
|
|
134
|
+
|
|
135
|
+
After checking out this PR and preparing installer assets/dependencies, run as the
|
|
136
|
+
test user (administrator provisions subordinate ranges and linger beforehand):
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
uname -m # x86_64
|
|
140
|
+
getenforce # Enforcing
|
|
141
|
+
podman version # native client 6.1.2
|
|
142
|
+
export PODMAN_COMPOSE_PROVIDER=/absolute/path/to/docker-compose
|
|
143
|
+
unset OURS_PODMAN_SOCKET DOCKER_HOST DOCKER_CONTEXT CONTAINER_HOST CONTAINER_CONNECTION
|
|
144
|
+
unset CONTAINERS_CONF CONTAINERS_STORAGE_CONF PODMAN_USERNS
|
|
145
|
+
systemctl --user enable --now podman.socket
|
|
146
|
+
systemctl --user enable podman-restart.service
|
|
147
|
+
systemctl --user show podman-restart.service --property=ExecStart
|
|
148
|
+
loginctl show-user "$(id -u)" --property=Linger # yes
|
|
149
|
+
export PODMAN_TEST_ROOT="$HOME/ours-podman-qualification"
|
|
150
|
+
node install.mjs server install --mode docker --container-engine podman \
|
|
151
|
+
--state-dir "$PODMAN_TEST_ROOT" --identity-name RootlessQualification
|
|
152
|
+
node install.mjs server status --state-dir "$PODMAN_TEST_ROOT"
|
|
153
|
+
node install.mjs server backup server before-rebuild --state-dir "$PODMAN_TEST_ROOT"
|
|
154
|
+
node install.mjs server rebuild --state-dir "$PODMAN_TEST_ROOT"
|
|
155
|
+
node install.mjs server restore server before-rebuild --state-dir "$PODMAN_TEST_ROOT"
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Record all five healthy services and authenticated gateway requests. From an
|
|
159
|
+
external controller, end **all** test-user sessions, wait, reconnect, and repeat
|
|
160
|
+
status/authenticated checks. Then reboot the VM and repeat the same checks before
|
|
161
|
+
running any explicit start command. Capture relevant user-unit journal and
|
|
162
|
+
SELinux AVC evidence; no denial should be bypassed by changing enforcement.
|
|
163
|
+
|
|
164
|
+
Next explicitly stop the installation, verify empty running status, reboot, and
|
|
165
|
+
verify it remains stopped. Only then start explicitly and verify all services.
|
|
166
|
+
For unexpected-exit recovery, select the exact project from its retained record
|
|
167
|
+
and terminate only its verified container-init host process through a PID handle,
|
|
168
|
+
then verify automatic recovery and retained identity/credentials. Do not use
|
|
169
|
+
`podman kill` for this case: an explicit engine stop suppresses restart policy.
|
|
170
|
+
The following refuses a PID whose cgroup does not identify the selected container:
|
|
171
|
+
|
|
172
|
+
```sh
|
|
173
|
+
node install.mjs server stop --state-dir "$PODMAN_TEST_ROOT"
|
|
174
|
+
node install.mjs server status --state-dir "$PODMAN_TEST_ROOT" # no running services
|
|
175
|
+
# Disposable-VM controller reboots here; reconnect and repeat status before start.
|
|
176
|
+
node install.mjs server start --state-dir "$PODMAN_TEST_ROOT"
|
|
177
|
+
PODMAN_TEST_PROJECT=$(node -e 'console.log(require(process.argv[1]).project)' "$PODMAN_TEST_ROOT/installation.json")
|
|
178
|
+
podman inspect --format '{{.State.StartedAt}} {{.RestartCount}}' "${PODMAN_TEST_PROJECT}-daemon-1"
|
|
179
|
+
python3 - "$PODMAN_TEST_PROJECT" <<'PYTHON'
|
|
180
|
+
import json, subprocess, sys
|
|
181
|
+
project = sys.argv[1]
|
|
182
|
+
container = json.loads(subprocess.check_output(['podman', 'inspect', project+'-daemon-1']))[0]
|
|
183
|
+
assert container['Config']['Labels']['com.docker.compose.project'] == project
|
|
184
|
+
assert container['State']['Running'] and container['State']['Pid'] > 1
|
|
185
|
+
script = """
|
|
186
|
+
import os, signal, sys
|
|
187
|
+
pid, cid = int(sys.argv[1]), sys.argv[2]
|
|
188
|
+
fd = os.pidfd_open(pid)
|
|
189
|
+
try:
|
|
190
|
+
assert cid in open('/proc/'+str(pid)+'/cgroup').read(), 'Container identity mismatch'
|
|
191
|
+
assert os.stat('/proc/'+str(pid)).st_uid == 1000, 'Unexpected runtime owner'
|
|
192
|
+
signal.pidfd_send_signal(fd, signal.SIGKILL)
|
|
193
|
+
finally:
|
|
194
|
+
os.close(fd)
|
|
195
|
+
"""
|
|
196
|
+
subprocess.run(['podman','unshare','python3','-c',script,str(container['State']['Pid']),container['Id']],check=True)
|
|
197
|
+
PYTHON
|
|
198
|
+
# Wait for recovery; assert changed StartedAt, increased RestartCount and health.
|
|
199
|
+
podman inspect --format '{{.State.StartedAt}} {{.RestartCount}} {{.State.Health.Status}}' "${PODMAN_TEST_PROJECT}-daemon-1"
|
|
200
|
+
# Verify retained identities and authenticated gateway as well.
|
|
201
|
+
node install.mjs server status --state-dir "$PODMAN_TEST_ROOT"
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Still required: repeat component backup/reset/restore for daemon, Telegram,
|
|
205
|
+
Cowork and messenger; source update and interrupted retry; fresh schema-1 legacy
|
|
206
|
+
conversion fixtures; foreign/malformed volume refusal; and the equivalent full
|
|
207
|
+
Docker maintenance matrix. These require owned fixture data and before/after
|
|
208
|
+
identity, credential, provenance and mount-boundary assertions; a command exit
|
|
209
|
+
code alone is insufficient. The existing unit conversion tests are not a claim
|
|
210
|
+
that this real-engine legacy fixture matrix has run.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
FROM nginx:1.28-alpine@sha256:a8b39bd9cf0f83869a2162827a0caf6137ddf759d50a171451b335cecc87d236
|
|
2
|
-
COPY --chmod=644 nginx.conf /etc/nginx/
|
|
2
|
+
COPY --chmod=644 nginx.conf /etc/nginx/ours.conf.template
|
|
3
|
+
COPY --chmod=644 gateway-entrypoint.sh /gateway-entrypoint.sh
|
|
3
4
|
USER 101:101
|
|
4
|
-
ENTRYPOINT ["
|
|
5
|
+
ENTRYPOINT ["/bin/sh", "/gateway-entrypoint.sh"]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -eu
|
|
3
|
+
# Replace only our resolver marker. Never expand nginx's $variables.
|
|
4
|
+
resolvers=$(awk '
|
|
5
|
+
function ipv4(s, a,n,i) {
|
|
6
|
+
n=split(s,a,"."); if(n!=4)return 0;
|
|
7
|
+
for(i=1;i<=n;i++) if(a[i]!~/^[0-9]+$/ || length(a[i])>3 || a[i]+0>255 || (length(a[i])>1 && substr(a[i],1,1)=="0"))return 0;
|
|
8
|
+
return 1
|
|
9
|
+
}
|
|
10
|
+
function ipv6(s, a,n,i,count,copy,compressed) {
|
|
11
|
+
if(s!~/:/ || s~/[^0-9a-fA-F:.]/ || s~/:::/)return 0;
|
|
12
|
+
copy=s; compressed=gsub(/::/,"X",copy); if(compressed>1)return 0;
|
|
13
|
+
if(!compressed && (s~/^:/ || s~/:$/))return 0;
|
|
14
|
+
n=split(s,a,":"); count=0;
|
|
15
|
+
for(i=1;i<=n;i++) {
|
|
16
|
+
if(a[i]=="")continue;
|
|
17
|
+
if(a[i]~/\./) {if(i!=n || !ipv4(a[i]))return 0; count+=2}
|
|
18
|
+
else {if(a[i]!~/^[0-9a-fA-F]+$/ || length(a[i])>4)return 0; count++}
|
|
19
|
+
}
|
|
20
|
+
return compressed ? count<8 : count==8
|
|
21
|
+
}
|
|
22
|
+
$1=="nameserver" {
|
|
23
|
+
if(ipv4($2))address=$2;
|
|
24
|
+
else if(ipv6($2))address="[" $2 "]";
|
|
25
|
+
else next;
|
|
26
|
+
if(!seen[address]++) {printf "%s%s",sep,address; sep=" "}
|
|
27
|
+
}
|
|
28
|
+
' "${OURS_RESOLV_CONF:-/etc/resolv.conf}")
|
|
29
|
+
if [ -z "$resolvers" ]; then echo 'Gateway: no valid runtime DNS nameserver' >&2; exit 1; fi
|
|
30
|
+
umask 077
|
|
31
|
+
config=$(mktemp /tmp/ours-nginx.XXXXXX)
|
|
32
|
+
trap 'rm -f "$config"' EXIT HUP INT TERM
|
|
33
|
+
sed "s/@@OURS_RESOLVERS@@/$resolvers/g" "${OURS_NGINX_TEMPLATE:-/etc/nginx/ours.conf.template}" > "$config"
|
|
34
|
+
nginx -t -c "$config"
|
|
35
|
+
# nginx opens the config before the shell exits; exec leaves this file in tmpfs.
|
|
36
|
+
trap - EXIT HUP INT TERM
|
|
37
|
+
exec nginx -c "$config" -g 'daemon off;'
|
package/assets/release-lock.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@ours.network/codex": "1.2.0-nightly.7",
|
|
14
14
|
"@ours.network/cowork": "1.3.3-nightly.20260923.2d2ff89",
|
|
15
15
|
"@ours.network/daemon": "3.8.1-nightly.3",
|
|
16
|
-
"@ours.network/fleet": "1.2.0-nightly.
|
|
16
|
+
"@ours.network/fleet": "1.2.0-nightly.14",
|
|
17
17
|
"@ours.network/mcp": "1.2.0-nightly.7",
|
|
18
18
|
"@ours.network/messenger-server": "1.0.31-nightly.6",
|
|
19
19
|
"@ours.network/sdk": "3.8.1-nightly.11",
|
|
@@ -1145,9 +1145,9 @@
|
|
|
1145
1145
|
}
|
|
1146
1146
|
},
|
|
1147
1147
|
"node_modules/@ours.network/fleet": {
|
|
1148
|
-
"version": "1.2.0-nightly.
|
|
1149
|
-
"resolved": "https://registry.npmjs.org/@ours.network/fleet/-/fleet-1.2.0-nightly.
|
|
1150
|
-
"integrity": "sha512-
|
|
1148
|
+
"version": "1.2.0-nightly.14",
|
|
1149
|
+
"resolved": "https://registry.npmjs.org/@ours.network/fleet/-/fleet-1.2.0-nightly.14.tgz",
|
|
1150
|
+
"integrity": "sha512-IBWPR7FDjjRmtCaUQZZk491PsGf4hKG4XRMHjcvGc/pcViRaZOOZu3cDGG0NJ38dhxubSAk5+DLVD2iYHzJxTA==",
|
|
1151
1151
|
"license": "FSL-1.1-Apache-2.0",
|
|
1152
1152
|
"dependencies": {
|
|
1153
1153
|
"@agentclientprotocol/sdk": "^1.3.0",
|
|
@@ -6734,9 +6734,9 @@
|
|
|
6734
6734
|
}
|
|
6735
6735
|
},
|
|
6736
6736
|
"node_modules/undici": {
|
|
6737
|
-
"version": "7.
|
|
6738
|
-
"resolved": "https://registry.npmjs.org/undici/-/undici-7.
|
|
6739
|
-
"integrity": "sha512-
|
|
6737
|
+
"version": "7.30.0",
|
|
6738
|
+
"resolved": "https://registry.npmjs.org/undici/-/undici-7.30.0.tgz",
|
|
6739
|
+
"integrity": "sha512-dkrQXeHSaoamnItlYbmzG0wFYrM0ZwDxCIg0A7aKjTyyhh9svRzCNFEzV+Vm05/yehjCzjDZ31KXfGEjYSztDQ==",
|
|
6740
6740
|
"license": "MIT",
|
|
6741
6741
|
"engines": {
|
|
6742
6742
|
"node": ">=20.18.1"
|
|
@@ -6947,9 +6947,9 @@
|
|
|
6947
6947
|
}
|
|
6948
6948
|
},
|
|
6949
6949
|
"node_modules/vscode-jsonrpc": {
|
|
6950
|
-
"version": "9.0.
|
|
6951
|
-
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-9.0.
|
|
6952
|
-
"integrity": "sha512-
|
|
6950
|
+
"version": "9.0.3",
|
|
6951
|
+
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-9.0.3.tgz",
|
|
6952
|
+
"integrity": "sha512-qETYf9PCl1lVfwR+oBmMfc4vP2nqLNA35ABxorw3j06+xlKRgDVxbLgKm4Y/xPL0YWdeDjLoI4ImICIT3nB0zQ==",
|
|
6953
6953
|
"license": "MIT",
|
|
6954
6954
|
"optional": true,
|
|
6955
6955
|
"engines": {
|
package/assets/release.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
3
|
"channel": "nightly",
|
|
4
|
-
"installerVersion": "1.2.1-nightly.
|
|
4
|
+
"installerVersion": "1.2.1-nightly.16",
|
|
5
5
|
"packages": {
|
|
6
6
|
"@ours.network/sdk": {
|
|
7
7
|
"version": "3.8.1-nightly.11",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"integrity": "sha512-enlos6BWfKiHdUNLRoPMzb0yfxRLWvfxH6uNaOjfAG88BK5qo74hQLwQ7CR4HbVE6OCDAGPLBe1BV7dQSRsbxw=="
|
|
25
25
|
},
|
|
26
26
|
"@ours.network/fleet": {
|
|
27
|
-
"version": "1.2.0-nightly.
|
|
28
|
-
"integrity": "sha512-
|
|
27
|
+
"version": "1.2.0-nightly.14",
|
|
28
|
+
"integrity": "sha512-IBWPR7FDjjRmtCaUQZZk491PsGf4hKG4XRMHjcvGc/pcViRaZOOZu3cDGG0NJ38dhxubSAk5+DLVD2iYHzJxTA=="
|
|
29
29
|
},
|
|
30
30
|
"@ours.network/mcp": {
|
|
31
31
|
"version": "1.2.0-nightly.7",
|
|
@@ -115,12 +115,14 @@ export function validateDockerLayout(tree, options) {
|
|
|
115
115
|
const config = join(tree, component, 'config.json');
|
|
116
116
|
if (fs.existsSync(config)) objectAt(config, options);
|
|
117
117
|
}
|
|
118
|
+
// Fresh managed installs keep the MCP profile separately until configured.
|
|
119
|
+
// Retained embedded configuration, when present, must still match exactly.
|
|
118
120
|
const daemon = objectAt(join(tree, 'daemon/config.json'), options);
|
|
119
121
|
const profile = objectAt(join(tree, 'mcp/profile.json'), options);
|
|
120
122
|
validateProfile(profile, options.instanceId);
|
|
121
123
|
if (daemon.stateDir !== DAEMON_STATE || daemon.port !== 3050
|
|
122
|
-
|| daemon.networkMcp?.applicationConfigPath !== join(MCP_STATE, 'config.json')
|
|
123
|
-
|
|
124
|
+
|| (daemon.networkMcp !== undefined && (daemon.networkMcp?.applicationConfigPath !== join(MCP_STATE, 'config.json')
|
|
125
|
+
|| JSON.stringify(daemon.networkMcp?.profile) !== JSON.stringify(profile)))
|
|
124
126
|
|| objectAt(join(tree, 'cowork/config.json'), options).stateDir !== '/var/lib/ours-cowork') {
|
|
125
127
|
throw new Error('Converted Docker deployment configuration is inconsistent');
|
|
126
128
|
}
|
package/assets/sources.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"release": {
|
|
3
3
|
"schema": 1,
|
|
4
4
|
"channel": "nightly",
|
|
5
|
-
"installerVersion": "1.2.1-nightly.
|
|
5
|
+
"installerVersion": "1.2.1-nightly.16",
|
|
6
6
|
"packages": {
|
|
7
7
|
"@ours.network/sdk": {
|
|
8
8
|
"version": "3.8.1-nightly.11",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"integrity": "sha512-enlos6BWfKiHdUNLRoPMzb0yfxRLWvfxH6uNaOjfAG88BK5qo74hQLwQ7CR4HbVE6OCDAGPLBe1BV7dQSRsbxw=="
|
|
26
26
|
},
|
|
27
27
|
"@ours.network/fleet": {
|
|
28
|
-
"version": "1.2.0-nightly.
|
|
29
|
-
"integrity": "sha512-
|
|
28
|
+
"version": "1.2.0-nightly.14",
|
|
29
|
+
"integrity": "sha512-IBWPR7FDjjRmtCaUQZZk491PsGf4hKG4XRMHjcvGc/pcViRaZOOZu3cDGG0NJ38dhxubSAk5+DLVD2iYHzJxTA=="
|
|
30
30
|
},
|
|
31
31
|
"@ours.network/mcp": {
|
|
32
32
|
"version": "1.2.0-nightly.7",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
},
|
|
80
80
|
"@ours.network/fleet": {
|
|
81
81
|
"type": "npm",
|
|
82
|
-
"version": "1.2.0-nightly.
|
|
82
|
+
"version": "1.2.0-nightly.14"
|
|
83
83
|
},
|
|
84
84
|
"@ours.network/mcp": {
|
|
85
85
|
"type": "npm",
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { isAbsolute, resolve } from 'node:path';
|
|
3
|
+
|
|
4
|
+
export const engineName = record => record.containerEngine === undefined ? 'docker' : record.containerEngine;
|
|
5
|
+
const path = value => typeof value === 'string' && isAbsolute(value) && resolve(value) === value && !/[\x00-\x1f]/.test(value);
|
|
6
|
+
export function validateContainerEngine(record) {
|
|
7
|
+
const engine = engineName(record);
|
|
8
|
+
if (!['docker', 'podman'].includes(engine) || (record.mode !== 'docker' && (record.containerEngine !== undefined || record.containerBinding !== undefined))) throw new Error('Invalid container engine selection');
|
|
9
|
+
const b = record.containerBinding;
|
|
10
|
+
if (engine === 'docker') {
|
|
11
|
+
if (b !== undefined) throw new Error('Unexpected Docker backend binding');
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (!b || b.version !== 1 || !Number.isInteger(b.uid) || b.uid <= 0 || !path(b.graphRoot) || !path(b.runRoot)
|
|
15
|
+
|| !/^[a-f0-9]{64}$/.test(b.namespaceDigest ?? '') || !path(b.socket) || !path(b.provider) || typeof b.driver !== 'string' || !/^[a-z0-9]+$/.test(b.driver)
|
|
16
|
+
|| Object.keys(b).some(k => !['version', 'uid', 'graphRoot', 'runRoot', 'socket', 'provider', 'driver', 'namespaceDigest'].includes(k))) throw new Error('Invalid rootless Podman backend binding');
|
|
17
|
+
}
|
|
18
|
+
function podmanEnvironment(record, env, uid) {
|
|
19
|
+
validateContainerEngine(record);
|
|
20
|
+
const b = record.containerBinding;
|
|
21
|
+
if (uid !== b.uid) throw new Error('Podman installation belongs to another rootless owner');
|
|
22
|
+
for (const key of ['CONTAINER_HOST', 'CONTAINER_CONNECTION', 'CONTAINERS_STORAGE_CONF', 'CONTAINERS_CONF', 'PODMAN_USERNS', 'STORAGE_DRIVER', 'STORAGE_OPTS']) {
|
|
23
|
+
if (env[key]) throw new Error(`${key} conflicts with the retained local Podman backend`);
|
|
24
|
+
}
|
|
25
|
+
if ((env.OURS_PODMAN_SOCKET && env.OURS_PODMAN_SOCKET !== b.socket) || env.DOCKER_CONTEXT || (env.DOCKER_HOST && env.DOCKER_HOST !== `unix://${b.socket}`)
|
|
26
|
+
|| (env.PODMAN_COMPOSE_PROVIDER && env.PODMAN_COMPOSE_PROVIDER !== b.provider)) throw new Error('Environment conflicts with the retained Podman backend/provider');
|
|
27
|
+
return { DOCKER_CONTEXT: undefined, DOCKER_HOST: `unix://${b.socket}`, PODMAN_COMPOSE_PROVIDER: b.provider, PODMAN_COMPOSE_WARNING_LOGS: 'false' };
|
|
28
|
+
}
|
|
29
|
+
/** The only container command boundary. Legacy records keep their Docker path. */
|
|
30
|
+
export async function runContainer(effects, record, args, options = {}) {
|
|
31
|
+
if (engineName(record) === 'docker') return effects.run('docker', args, options);
|
|
32
|
+
const env = { ...(effects.env ?? {}), ...(options.env ?? {}) };
|
|
33
|
+
const selected = podmanEnvironment(record, env, process.getuid?.());
|
|
34
|
+
const b = record.containerBinding;
|
|
35
|
+
if (args[0] === 'build' && !args.some(arg => arg === '--format' || arg.startsWith('--format='))) args = ['build', '--format', 'docker', ...args.slice(1)];
|
|
36
|
+
// Docker reports a missing object as 1; Podman inspect uses 125. Probe exact
|
|
37
|
+
// existence separately so transport/permission failures are never absence.
|
|
38
|
+
if (['image', 'volume'].includes(args[0]) && args[1] === 'inspect' && options.allowCodes?.includes(1)) {
|
|
39
|
+
const found = await runContainer(effects, record, [args[0], 'exists', args.at(-1)], { ...options, allowCodes: [1] });
|
|
40
|
+
if (found.code === 1) return { code: 1, stdout: '', ok: false };
|
|
41
|
+
}
|
|
42
|
+
// Native commands and the Compose provider must address the SAME local store.
|
|
43
|
+
const prefix = args[0] === 'compose' ? ['--remote', '--url', `unix://${b.socket}`] : ['--remote=false', '--root', b.graphRoot, '--runroot', b.runRoot, '--storage-driver', b.driver];
|
|
44
|
+
const result = await effects.run('podman', [...prefix, ...args],
|
|
45
|
+
{ ...options, env: { ...options.env, ...selected } });
|
|
46
|
+
if (args[0] === 'image' && args[1] === 'inspect' && !args.includes('--format') && result.code === 0) {
|
|
47
|
+
const images = JSON.parse(result.stdout);
|
|
48
|
+
for (const value of images) if (/^[a-f0-9]{64}$/.test(value.Id)) value.Id = `sha256:${value.Id}`;
|
|
49
|
+
return { ...result, stdout: JSON.stringify(images) };
|
|
50
|
+
}
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
export function namespaceDigest(info) {
|
|
54
|
+
const maps = info.host?.idMappings;
|
|
55
|
+
const normalized = ['uidmap', 'gidmap'].map(key => {
|
|
56
|
+
const rows = maps?.[key];
|
|
57
|
+
if (!Array.isArray(rows) || !rows.length) throw new Error('Podman user namespace mappings are unavailable');
|
|
58
|
+
return rows.map(row => {
|
|
59
|
+
const values = [row.container_id, row.host_id, row.size];
|
|
60
|
+
if (values.some(value => !Number.isInteger(value) || value < 0) || row.size < 1) throw new Error('Invalid Podman namespace mapping');
|
|
61
|
+
return values;
|
|
62
|
+
}).sort((a, b) => a[0] - b[0]);
|
|
63
|
+
});
|
|
64
|
+
return createHash('sha256').update(JSON.stringify(normalized)).digest('hex');
|
|
65
|
+
}
|
|
66
|
+
export async function bindPodman(effects, record) {
|
|
67
|
+
if (effects.platform.platform !== 'linux' || process.getuid?.() === 0) throw new Error('Podman server installation requires a non-root Linux user');
|
|
68
|
+
const env = effects.env ?? {};
|
|
69
|
+
const provider = record.containerBinding?.provider ?? env.PODMAN_COMPOSE_PROVIDER;
|
|
70
|
+
if (!path(provider)) throw new Error('Set PODMAN_COMPOSE_PROVIDER to an absolute standalone Docker Compose executable path');
|
|
71
|
+
// Reject ambient redirection before even probing an unbound store.
|
|
72
|
+
for (const key of ['CONTAINER_HOST', 'CONTAINER_CONNECTION', 'CONTAINERS_STORAGE_CONF', 'CONTAINERS_CONF', 'PODMAN_USERNS', 'STORAGE_DRIVER', 'STORAGE_OPTS', 'DOCKER_CONTEXT']) {
|
|
73
|
+
if (env[key]) throw new Error(`${key} conflicts with local rootless Podman`);
|
|
74
|
+
}
|
|
75
|
+
const info = JSON.parse((await effects.run('podman', ['--remote=false', 'info', '--format', 'json'])).stdout);
|
|
76
|
+
if (info.host?.security?.rootless !== true) throw new Error('Podman must report rootless=true');
|
|
77
|
+
const socket = record.containerBinding?.socket ?? env.OURS_PODMAN_SOCKET ?? info.host.remoteSocket?.path;
|
|
78
|
+
const observed = { version: 1, uid: process.getuid(), graphRoot: info.store?.graphRoot, runRoot: info.store?.runRoot, driver: info.store?.graphDriverName, socket, provider, namespaceDigest: namespaceDigest(info) };
|
|
79
|
+
validateContainerEngine({ ...record, containerBinding: observed });
|
|
80
|
+
if (record.containerBinding && Object.keys(observed).some(k => observed[k] !== record.containerBinding[k])) throw new Error('Podman backend differs from retained installation');
|
|
81
|
+
podmanEnvironment({ ...record, containerBinding: observed }, env, process.getuid());
|
|
82
|
+
const api = JSON.parse((await effects.run('podman', ['--remote', '--url', `unix://${socket}`, 'info', '--format', 'json'])).stdout);
|
|
83
|
+
if (api.host?.security?.rootless !== true || api.store?.graphRoot !== observed.graphRoot || api.store?.runRoot !== observed.runRoot || api.store?.graphDriverName !== observed.driver || namespaceDigest(api) !== observed.namespaceDigest) throw new Error('Podman socket does not address the selected rootless storage; enable the user podman.socket');
|
|
84
|
+
const version = (await effects.run(provider, ['version', '--short'])).stdout.trim();
|
|
85
|
+
const match = /^v?(\d+)\.(\d+)\./.exec(version);
|
|
86
|
+
if (!match || +match[1] < 2 || (+match[1] === 2 && +match[2] < 35)) throw new Error('Standalone Docker Compose 2.35+ is required');
|
|
87
|
+
record.containerBinding = observed;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** Resolve Compose rather than maintaining a second, drifting build definition. */
|
|
91
|
+
export function nativeBuildCommands(config, services, env = {}) {
|
|
92
|
+
const commands = [], seen = new Set();
|
|
93
|
+
for (const name of services) {
|
|
94
|
+
const service = config.services?.[name], build = service?.build;
|
|
95
|
+
if (!build || typeof build !== 'object' || !path(build.context) || !service.image) throw new Error(`Missing resolved build definition for ${name}`);
|
|
96
|
+
const supported = ['context', 'dockerfile', 'target', 'args', 'secrets', 'cache_from', 'cache_to', 'platforms', 'labels', 'no_cache', 'pull'];
|
|
97
|
+
if (Object.keys(build).some(k => !supported.includes(k))) throw new Error(`Unsupported Podman build option for ${name}`);
|
|
98
|
+
const args = ['build', '--format', 'docker', '--layers', '--file', resolve(build.context, build.dockerfile ?? 'Dockerfile'), '--tag', service.image];
|
|
99
|
+
if (build.target) args.push('--target', build.target);
|
|
100
|
+
const platforms = build.platforms ?? (service.platform ? [service.platform] : []);
|
|
101
|
+
if (platforms.length > 1) throw new Error('Multi-platform Podman builds are not supported');
|
|
102
|
+
if (platforms.length) args.push('--platform', platforms[0]);
|
|
103
|
+
for (const [key, value] of Object.entries(build.args ?? {})) {
|
|
104
|
+
if (value === null) throw new Error(`Unresolved build argument: ${key}`);
|
|
105
|
+
args.push('--build-arg', `${key}=${value}`);
|
|
106
|
+
}
|
|
107
|
+
for (const [key, value] of Object.entries(build.labels ?? {})) args.push('--label', `${key}=${value}`);
|
|
108
|
+
for (const key of ['cache_from', 'cache_to']) for (const value of build[key] ?? []) args.push('--' + key.replace('_', '-'), value);
|
|
109
|
+
if (build.no_cache) args.push('--no-cache');
|
|
110
|
+
if (build.pull) args.push('--pull=always');
|
|
111
|
+
for (const secret of build.secrets ?? []) {
|
|
112
|
+
const source = typeof secret === 'string' ? secret : secret.source;
|
|
113
|
+
const id = typeof secret === 'string' ? source : secret.target ?? source;
|
|
114
|
+
const definition = config.secrets?.[source];
|
|
115
|
+
if (!/^[A-Za-z0-9_-]+$/.test(id)) throw new Error('Invalid build secret ID');
|
|
116
|
+
if (definition?.environment) {
|
|
117
|
+
// Native local Podman supports type=env; values never enter argv/files.
|
|
118
|
+
if (env[definition.environment]) args.push('--secret', `id=${id},type=env,env=${definition.environment}`);
|
|
119
|
+
} else if (definition?.file && path(definition.file)) args.push('--secret', `id=${id},src=${definition.file}`);
|
|
120
|
+
else throw new Error(`Unsupported build secret: ${source}`);
|
|
121
|
+
}
|
|
122
|
+
args.push(build.context);
|
|
123
|
+
const key = JSON.stringify(args);
|
|
124
|
+
if (!seen.has(key)) { seen.add(key); commands.push(args); }
|
|
125
|
+
}
|
|
126
|
+
return commands;
|
|
127
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { runContainer } from './container-engine.mjs';
|
|
1
2
|
import * as fs from 'node:fs';
|
|
2
3
|
import { join } from 'node:path';
|
|
3
4
|
import { randomUUID } from 'node:crypto';
|
|
@@ -33,7 +34,7 @@ ENTRYPOINT ["node", "/opt/ours/docker/state-operation.mjs"]
|
|
|
33
34
|
`);
|
|
34
35
|
// Build maintenance first: both targets inherit the same retained runtime.
|
|
35
36
|
for (const target of ['maintenance', 'runtime']) {
|
|
36
|
-
await effects
|
|
37
|
+
await runContainer(effects, record, ['build', '--platform', 'linux/amd64', '--target', target,
|
|
37
38
|
'--tag', `${record.project}:${target}`, context]);
|
|
38
39
|
}
|
|
39
40
|
atomicWriteConfig(compose, fs.readFileSync(join(assets, 'docker-compose.yaml')));
|
|
@@ -82,7 +83,7 @@ export async function runDockerConversion(record, selected, operation, label, ef
|
|
|
82
83
|
const path = join(record.root, `.conversion-compose-${randomUUID()}.json`);
|
|
83
84
|
try {
|
|
84
85
|
fs.writeFileSync(path, JSON.stringify(definition), { mode: 0o600, flag: 'wx' });
|
|
85
|
-
const result = await effects
|
|
86
|
+
const result = await runContainer(effects, record, ['compose', '--file', path, '--project-name', record.project,
|
|
86
87
|
'run', '--rm', '--no-deps', '-T', 'state-operation', operation, ...(label ? [label] : [])]);
|
|
87
88
|
if (operation === 'cleanup') {
|
|
88
89
|
const summary = JSON.parse(result.stdout);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { runContainer } from './container-engine.mjs';
|
|
1
2
|
import * as fs from 'node:fs';
|
|
2
3
|
import { join, basename } from 'node:path';
|
|
3
4
|
import { randomUUID } from 'node:crypto';
|
|
@@ -46,7 +47,7 @@ export async function convertDockerInstallation(record, operation, effects) {
|
|
|
46
47
|
await effects.serverLifecycle(record, 'start', running);
|
|
47
48
|
const cleanup = await effects.runDockerConversion(record, volumes, 'cleanup');
|
|
48
49
|
if (cleanup.emptyVolumes.length) {
|
|
49
|
-
await effects
|
|
50
|
+
await runContainer(effects, record, ['volume', 'rm', ...cleanup.emptyVolumes.map(alias => volumes.sources[alias])]);
|
|
50
51
|
}
|
|
51
52
|
try {
|
|
52
53
|
const stat = fs.lstatSync(source.configPath);
|