@gate-forge/cli 0.5.0 → 0.6.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/README.md +51 -6
- package/dist/args.js +1 -1
- package/dist/args.js.map +1 -1
- package/dist/broker.d.ts.map +1 -1
- package/dist/broker.js +10 -14
- package/dist/broker.js.map +1 -1
- package/dist/cli.d.ts +2 -8
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +9 -10
- package/dist/cli.js.map +1 -1
- package/dist/commands/blocking.d.ts +3 -0
- package/dist/commands/blocking.d.ts.map +1 -1
- package/dist/commands/blocking.js +38 -2
- package/dist/commands/blocking.js.map +1 -1
- package/dist/commands/check.d.ts +40 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +37 -4
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +54 -97
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/pre-commit.d.ts +5 -0
- package/dist/commands/pre-commit.d.ts.map +1 -0
- package/dist/commands/pre-commit.js +213 -0
- package/dist/commands/pre-commit.js.map +1 -0
- package/dist/commands/test-gates.d.ts +51 -0
- package/dist/commands/test-gates.d.ts.map +1 -1
- package/dist/commands/test-gates.js +32 -22
- package/dist/commands/test-gates.js.map +1 -1
- package/dist/execution.d.ts +1 -0
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +9 -0
- package/dist/execution.js.map +1 -1
- package/dist/git-hooks.d.ts +7 -2
- package/dist/git-hooks.d.ts.map +1 -1
- package/dist/git-hooks.js +48 -12
- package/dist/git-hooks.js.map +1 -1
- package/dist/input-snapshot.d.ts +5 -1
- package/dist/input-snapshot.d.ts.map +1 -1
- package/dist/input-snapshot.js +6 -3
- package/dist/input-snapshot.js.map +1 -1
- package/dist/io.d.ts +0 -3
- package/dist/io.d.ts.map +1 -1
- package/dist/io.js.map +1 -1
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +29 -7
- package/dist/pipeline.js.map +1 -1
- package/dist/runtime.d.ts +114 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +682 -0
- package/dist/runtime.js.map +1 -0
- package/dist/staged-candidate.d.ts +1 -1
- package/dist/staged-candidate.d.ts.map +1 -1
- package/dist/staged-candidate.js +5 -4
- package/dist/staged-candidate.js.map +1 -1
- package/package.json +9 -9
- package/dist/commands/controller.d.ts +0 -43
- package/dist/commands/controller.d.ts.map +0 -1
- package/dist/commands/controller.js +0 -110
- package/dist/commands/controller.js.map +0 -1
- package/dist/isolation.d.ts +0 -104
- package/dist/isolation.d.ts.map +0 -1
- package/dist/isolation.js +0 -353
- package/dist/isolation.js.map +0 -1
- package/dist/podman-bootstrap.d.ts +0 -59
- package/dist/podman-bootstrap.d.ts.map +0 -1
- package/dist/podman-bootstrap.js +0 -123
- package/dist/podman-bootstrap.js.map +0 -1
package/dist/isolation.js
DELETED
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Isolation controller interface (plan 2026-09-19 Phase 10 item 2): the
|
|
3
|
-
* narrow boundary between supervised execution and the managed runtime.
|
|
4
|
-
*
|
|
5
|
-
* TRUST MODEL (§4.10): the controller launches the APPROVED profile with
|
|
6
|
-
* FIXED arguments — it never accepts a caller-supplied shell string, a
|
|
7
|
-
* candidate-selected image, or ambient container env. It validates the
|
|
8
|
-
* ACTIVE runtime (mounts read-only, dedicated users, no host paths, no
|
|
9
|
-
* container socket) and returns an authoritative boundary record that
|
|
10
|
-
* receipts seal via `executionBoundaryDigestOf`.
|
|
11
|
-
*
|
|
12
|
-
* This module defines the complete controller boundary contract. Launching
|
|
13
|
-
* real containers requires the owner-provisioned managed host (rootless
|
|
14
|
-
* Podman + service accounts); inspection alone reports an honest
|
|
15
|
-
* `local-unisolated` record, while a managed request fails closed if the
|
|
16
|
-
* approved controller cannot be launched and inspected (see `broker.ts`).
|
|
17
|
-
*/
|
|
18
|
-
import { spawnSync } from 'node:child_process';
|
|
19
|
-
import { isAbsolute, resolve as resolvePath } from 'node:path';
|
|
20
|
-
import { executionBoundaryDigestOf } from '@gate-forge/core';
|
|
21
|
-
import { UsageError } from './errors.js';
|
|
22
|
-
/**
|
|
23
|
-
* Detects any known container-management socket in a mount source or target.
|
|
24
|
-
* This single predicate is shared by record validation and Podman inspection.
|
|
25
|
-
*/
|
|
26
|
-
function socketExposure(mount) {
|
|
27
|
-
return mount.source.includes('docker.sock') ||
|
|
28
|
-
mount.source.includes('podman.sock') ||
|
|
29
|
-
mount.target.includes('docker.sock') ||
|
|
30
|
-
mount.target.includes('podman.sock');
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Validates one active-runtime record against the profile's hard rules and,
|
|
34
|
-
* when supplied, binds each managed mount source to the launch request.
|
|
35
|
-
*
|
|
36
|
-
* Args:
|
|
37
|
-
* record: the record returned by the runtime launcher.
|
|
38
|
-
* expected: request paths and optional owner image expected by inspection.
|
|
39
|
-
*
|
|
40
|
-
* Returns:
|
|
41
|
-
* IsolationRecord: the validated record with a recomputed boundary digest.
|
|
42
|
-
*
|
|
43
|
-
* Throws:
|
|
44
|
-
* UsageError: on any violated rule (fail closed — an invalid boundary
|
|
45
|
-
* record never authorizes a receipt).
|
|
46
|
-
*/
|
|
47
|
-
export function validateIsolationRecord(record, expected) {
|
|
48
|
-
const fail = (detail) => {
|
|
49
|
-
throw new UsageError(`isolation boundary invalid: ${detail}`);
|
|
50
|
-
};
|
|
51
|
-
if (record.profile === 'local-unisolated') {
|
|
52
|
-
if (record.mounts.length !== 0 || record.user !== null || record.network !== null) {
|
|
53
|
-
fail('local-unisolated records carry no mounts/user/network');
|
|
54
|
-
}
|
|
55
|
-
return { ...record, boundaryDigest: executionBoundaryDigestOf(record.profile) };
|
|
56
|
-
}
|
|
57
|
-
if (record.profile !== 'podman-rootless')
|
|
58
|
-
fail(`unknown profile '${String(record.profile)}'`);
|
|
59
|
-
const userIdentity = typeof record.user === 'string' ? record.user.split(':', 1)[0] : '';
|
|
60
|
-
if (record.user === null ||
|
|
61
|
-
record.user === '' ||
|
|
62
|
-
userIdentity === '0' ||
|
|
63
|
-
userIdentity === 'root') {
|
|
64
|
-
fail('podman-rootless must run as a dedicated non-root user');
|
|
65
|
-
}
|
|
66
|
-
if (record.network !== 'none' && record.network !== 'private') {
|
|
67
|
-
fail(`podman-rootless network must be 'none' or 'private' (got '${String(record.network)}')`);
|
|
68
|
-
}
|
|
69
|
-
if (!record.containerSocketHidden) {
|
|
70
|
-
fail('podman-rootless must hide the container socket from the candidate');
|
|
71
|
-
}
|
|
72
|
-
const targets = new Set();
|
|
73
|
-
for (const mount of record.mounts) {
|
|
74
|
-
if (targets.has(mount.target))
|
|
75
|
-
fail(`duplicate managed mount target: ${mount.target}`);
|
|
76
|
-
targets.add(mount.target);
|
|
77
|
-
if (mount.source !== resolvePath(mount.source) || !isAbsolute(mount.source) || mount.source.includes('\0')) {
|
|
78
|
-
fail(`managed mount source must be a canonical absolute path: ${mount.source}`);
|
|
79
|
-
}
|
|
80
|
-
if (mount.source.includes(':') || mount.source.includes(',')) {
|
|
81
|
-
fail(`managed mount source contains Podman volume syntax: ${mount.source}`);
|
|
82
|
-
}
|
|
83
|
-
if (mount.source.startsWith('/home/'))
|
|
84
|
-
fail(`host home mount is forbidden: ${mount.source}`);
|
|
85
|
-
if (mount.source.includes('/.git'))
|
|
86
|
-
fail(`host Git directory mount is forbidden: ${mount.source}`);
|
|
87
|
-
if (socketExposure(mount)) {
|
|
88
|
-
fail(`container socket mount is forbidden: ${mount.source} -> ${mount.target}`);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
const engine = record.mounts.find((mount) => mount.target === '/engine');
|
|
92
|
-
const candidate = record.mounts.find((mount) => mount.target === '/candidate');
|
|
93
|
-
const appState = record.mounts.find((mount) => mount.target === '/app-state');
|
|
94
|
-
if (engine === undefined || !engine.readOnly)
|
|
95
|
-
fail('the engine bundle must be mounted read-only at /engine');
|
|
96
|
-
if (candidate === undefined || !candidate.readOnly)
|
|
97
|
-
fail('the candidate must be mounted read-only at /candidate');
|
|
98
|
-
if (appState === undefined || appState.readOnly)
|
|
99
|
-
fail('the app state dir must be writable at /app-state');
|
|
100
|
-
if (record.mounts.length !== 3) {
|
|
101
|
-
fail('podman-rootless must have exactly the engine, candidate, and app-state mounts');
|
|
102
|
-
}
|
|
103
|
-
const expectedTargets = { '/engine': true, '/candidate': true, '/app-state': true };
|
|
104
|
-
if (targets.size !== Object.keys(expectedTargets).length || Object.keys(expectedTargets).some((target) => !targets.has(target))) {
|
|
105
|
-
fail('managed mounts must target exactly /engine, /candidate, and /app-state');
|
|
106
|
-
}
|
|
107
|
-
if (expected !== undefined) {
|
|
108
|
-
const expectedSources = {
|
|
109
|
-
'/engine': canonicalRequestPath(expected.engineBundleDir, fail),
|
|
110
|
-
'/candidate': canonicalRequestPath(expected.candidateDir, fail),
|
|
111
|
-
'/app-state': canonicalRequestPath(expected.appStateDir, fail),
|
|
112
|
-
};
|
|
113
|
-
for (const mount of record.mounts) {
|
|
114
|
-
if (mount.source !== expectedSources[mount.target]) {
|
|
115
|
-
fail(`managed mount source for ${mount.target} does not match the launch request`);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return { ...record, boundaryDigest: executionBoundaryDigestOf(record.profile) };
|
|
120
|
-
}
|
|
121
|
-
function canonicalRequestPath(value, fail) {
|
|
122
|
-
if (!isAbsolute(value) || value.includes('\0') || value.includes(':') || value.includes(',')) {
|
|
123
|
-
fail(`launch path must be a canonical absolute path: ${value}`);
|
|
124
|
-
}
|
|
125
|
-
const canonical = resolvePath(value);
|
|
126
|
-
if (canonical !== value)
|
|
127
|
-
fail(`launch path must not use a path alias: ${value}`);
|
|
128
|
-
return canonical;
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Runs one fixed-argument Podman command without a shell or caller command.
|
|
132
|
-
* Production uses this only through the managed launch/inspection paths.
|
|
133
|
-
*/
|
|
134
|
-
export function runPodman(args, env) {
|
|
135
|
-
const result = spawnSync('podman', [...args], { env, encoding: 'utf8', maxBuffer: 16 * 1024 * 1024 });
|
|
136
|
-
if (result.error !== undefined) {
|
|
137
|
-
return { status: -1, stdout: '', stderr: `podman unavailable: ${result.error.message}` };
|
|
138
|
-
}
|
|
139
|
-
return {
|
|
140
|
-
status: result.status ?? -1,
|
|
141
|
-
stdout: result.stdout ?? '',
|
|
142
|
-
stderr: result.stderr ?? '',
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
const MANAGED_IMAGE_ENV = 'GATEFORGE_MANAGED_CONTROLLER_IMAGE';
|
|
146
|
-
const MANAGED_CONTAINER_NAME = 'gateforge-managed-controller';
|
|
147
|
-
const IMMUTABLE_IMAGE = /^[a-z0-9](?:[a-z0-9._/-]*[a-z0-9])?@sha256:[0-9a-f]{64}$/i;
|
|
148
|
-
const CONTAINER_ID = /^[0-9a-f]{12,64}$/i;
|
|
149
|
-
/**
|
|
150
|
-
* Inspects the active managed controller after a fixed profile launch.
|
|
151
|
-
* Podman inspect is authoritative for mounts, image, user, network, and
|
|
152
|
-
* socket visibility; a role label alone never fabricates those facts.
|
|
153
|
-
*
|
|
154
|
-
* Args:
|
|
155
|
-
* env: owner-controlled orchestrator environment.
|
|
156
|
-
* runner: narrow Podman seam used by production and focused tests.
|
|
157
|
-
* expected: launch paths and immutable image that must match inspection.
|
|
158
|
-
* launchedControllerId: exact successful launch ID; skips stale name discovery.
|
|
159
|
-
*
|
|
160
|
-
* Returns:
|
|
161
|
-
* IsolationRecord: the validated managed boundary, or an honest local
|
|
162
|
-
* boundary when no controller is present.
|
|
163
|
-
*
|
|
164
|
-
* Throws:
|
|
165
|
-
* UsageError: when Podman reports malformed, unrelated, or invalid managed
|
|
166
|
-
* runtime evidence.
|
|
167
|
-
*/
|
|
168
|
-
export function inspectManagedRuntime(env, runner = runPodman, expected, launchedControllerId) {
|
|
169
|
-
const controllerId = launchedControllerId ?? (() => {
|
|
170
|
-
const probe = runner(['ps', '--filter', `name=^${MANAGED_CONTAINER_NAME}$`, '--format', '{{.ID}}\t{{.Label "gateforge.role"}}'], env);
|
|
171
|
-
return probe.status === 0
|
|
172
|
-
? probe.stdout
|
|
173
|
-
.split('\n')
|
|
174
|
-
.map((line) => {
|
|
175
|
-
const parts = line.trim().split(/\s+/);
|
|
176
|
-
const label = parts.slice(1).join(' ');
|
|
177
|
-
return parts.length > 1 &&
|
|
178
|
-
(label === 'controller' ||
|
|
179
|
-
label.includes('gateforge.role=controller') ||
|
|
180
|
-
label.includes('gateforge.role:controller'))
|
|
181
|
-
? parts[0]
|
|
182
|
-
: null;
|
|
183
|
-
})
|
|
184
|
-
.find((id) => id !== null)
|
|
185
|
-
: undefined;
|
|
186
|
-
})();
|
|
187
|
-
if (controllerId === undefined) {
|
|
188
|
-
return validateIsolationRecord({
|
|
189
|
-
profile: 'local-unisolated',
|
|
190
|
-
mounts: [],
|
|
191
|
-
user: null,
|
|
192
|
-
network: null,
|
|
193
|
-
containerSocketHidden: false,
|
|
194
|
-
boundaryDigest: '',
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
const inspected = runner(['inspect', '--format', '{{json .}}', controllerId], env);
|
|
198
|
-
if (inspected.status !== 0 || inspected.stdout.trim() === '') {
|
|
199
|
-
throw new UsageError('isolation boundary unavailable: Podman identified a managed controller but could not inspect its runtime record');
|
|
200
|
-
}
|
|
201
|
-
let document;
|
|
202
|
-
try {
|
|
203
|
-
document = JSON.parse(inspected.stdout);
|
|
204
|
-
}
|
|
205
|
-
catch {
|
|
206
|
-
throw new UsageError('isolation boundary unavailable: Podman returned malformed controller inspect JSON');
|
|
207
|
-
}
|
|
208
|
-
if (Array.isArray(document))
|
|
209
|
-
document = document[0];
|
|
210
|
-
if (typeof document !== 'object' || document === null || Array.isArray(document)) {
|
|
211
|
-
throw new UsageError('isolation boundary unavailable: controller inspect JSON is not an object');
|
|
212
|
-
}
|
|
213
|
-
const raw = document;
|
|
214
|
-
const config = raw['Config'];
|
|
215
|
-
const hostConfig = raw['HostConfig'];
|
|
216
|
-
const mountsRaw = raw['Mounts'];
|
|
217
|
-
if (typeof config !== 'object' ||
|
|
218
|
-
config === null ||
|
|
219
|
-
Array.isArray(config) ||
|
|
220
|
-
typeof hostConfig !== 'object' ||
|
|
221
|
-
hostConfig === null ||
|
|
222
|
-
Array.isArray(hostConfig) ||
|
|
223
|
-
!Array.isArray(mountsRaw)) {
|
|
224
|
-
throw new UsageError('isolation boundary unavailable: controller inspect record lacks Config, HostConfig, or Mounts');
|
|
225
|
-
}
|
|
226
|
-
const configRecord = config;
|
|
227
|
-
const user = configRecord['User'];
|
|
228
|
-
const image = configRecord['Image'];
|
|
229
|
-
const network = hostConfig['NetworkMode'];
|
|
230
|
-
if (typeof user !== 'string' || typeof network !== 'string') {
|
|
231
|
-
throw new UsageError('isolation boundary unavailable: controller inspect record lacks user or network mode');
|
|
232
|
-
}
|
|
233
|
-
if (expected?.image !== undefined && image !== expected.image) {
|
|
234
|
-
throw new UsageError('isolation boundary invalid: active controller image is not the owner-approved immutable image');
|
|
235
|
-
}
|
|
236
|
-
const mounts = [];
|
|
237
|
-
for (const mount of mountsRaw) {
|
|
238
|
-
if (typeof mount !== 'object' || mount === null || Array.isArray(mount)) {
|
|
239
|
-
throw new UsageError('isolation boundary unavailable: controller inspect contains a malformed mount');
|
|
240
|
-
}
|
|
241
|
-
const entry = mount;
|
|
242
|
-
const source = entry['Source'];
|
|
243
|
-
const target = entry['Destination'];
|
|
244
|
-
const readWrite = entry['RW'];
|
|
245
|
-
if (typeof source !== 'string' || typeof target !== 'string' || typeof readWrite !== 'boolean') {
|
|
246
|
-
throw new UsageError('isolation boundary unavailable: controller inspect contains an incomplete mount');
|
|
247
|
-
}
|
|
248
|
-
mounts.push({ source, target, readOnly: !readWrite });
|
|
249
|
-
}
|
|
250
|
-
const socketMount = mounts.some(socketExposure);
|
|
251
|
-
return validateIsolationRecord({
|
|
252
|
-
profile: 'podman-rootless',
|
|
253
|
-
mounts,
|
|
254
|
-
user,
|
|
255
|
-
network,
|
|
256
|
-
containerSocketHidden: !socketMount,
|
|
257
|
-
boundaryDigest: '',
|
|
258
|
-
}, expected);
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Resolves the intended execution profile from the owner-controlled
|
|
262
|
-
* authority boundary. Candidate configuration is deliberately not read.
|
|
263
|
-
*/
|
|
264
|
-
export function isolationProfileForEnvironment(env) {
|
|
265
|
-
const boundary = env['GATEFORGE_AUTHORITY_BOUNDARY'];
|
|
266
|
-
if (boundary === undefined || boundary === '' || boundary === 'local-unisolated') {
|
|
267
|
-
return 'local-unisolated';
|
|
268
|
-
}
|
|
269
|
-
if (boundary === 'managed-authoritative')
|
|
270
|
-
return 'podman-rootless';
|
|
271
|
-
throw new UsageError(`unknown authority boundary '${boundary}'`);
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* Resolves a supervised launch against the owner-requested profile. Local
|
|
275
|
-
* mode returns its honest empty boundary without invoking Podman. Managed
|
|
276
|
-
* mode validates owner image and request paths, launches only the fixed
|
|
277
|
-
* profile, then accepts only matching authoritative inspect evidence.
|
|
278
|
-
*/
|
|
279
|
-
export function resolveIsolation(request, env, runner = runPodman) {
|
|
280
|
-
if (request.profile !== 'podman-rootless' && request.profile !== 'local-unisolated') {
|
|
281
|
-
throw new UsageError(`unknown isolation profile '${String(request.profile)}'`);
|
|
282
|
-
}
|
|
283
|
-
if (request.profile === 'local-unisolated') {
|
|
284
|
-
return validateIsolationRecord({
|
|
285
|
-
profile: 'local-unisolated',
|
|
286
|
-
mounts: [],
|
|
287
|
-
user: null,
|
|
288
|
-
network: null,
|
|
289
|
-
containerSocketHidden: false,
|
|
290
|
-
boundaryDigest: '',
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
const image = validatedManagedImage(env);
|
|
294
|
-
const expected = {
|
|
295
|
-
candidateDir: canonicalRequestPath(request.candidateDir, (detail) => {
|
|
296
|
-
throw new UsageError(`isolation launch invalid: ${detail}`);
|
|
297
|
-
}),
|
|
298
|
-
engineBundleDir: canonicalRequestPath(request.engineBundleDir, (detail) => {
|
|
299
|
-
throw new UsageError(`isolation launch invalid: ${detail}`);
|
|
300
|
-
}),
|
|
301
|
-
appStateDir: canonicalRequestPath(request.appStateDir, (detail) => {
|
|
302
|
-
throw new UsageError(`isolation launch invalid: ${detail}`);
|
|
303
|
-
}),
|
|
304
|
-
image,
|
|
305
|
-
};
|
|
306
|
-
// The controller currently owns only the health heartbeat and needs no
|
|
307
|
-
// network. Podman's rootless `private` token resolves to `pasta`, which is
|
|
308
|
-
// not an isolated network mode; `none` is the authoritative fail-closed
|
|
309
|
-
// choice until a separately provisioned internal app/worker network exists.
|
|
310
|
-
const launch = runner([
|
|
311
|
-
'run',
|
|
312
|
-
'--rm',
|
|
313
|
-
'--detach',
|
|
314
|
-
'--name',
|
|
315
|
-
MANAGED_CONTAINER_NAME,
|
|
316
|
-
'--label',
|
|
317
|
-
'gateforge.role=controller',
|
|
318
|
-
'--read-only',
|
|
319
|
-
'--user',
|
|
320
|
-
'gateforge-runner',
|
|
321
|
-
'--network',
|
|
322
|
-
'none',
|
|
323
|
-
'--volume',
|
|
324
|
-
`${expected.engineBundleDir}:/engine:ro`,
|
|
325
|
-
'--volume',
|
|
326
|
-
`${expected.candidateDir}:/candidate:ro`,
|
|
327
|
-
'--volume',
|
|
328
|
-
`${expected.appStateDir}:/app-state:rw`,
|
|
329
|
-
image,
|
|
330
|
-
'controller',
|
|
331
|
-
], env);
|
|
332
|
-
if (launch.status !== 0) {
|
|
333
|
-
const detail = launch.stderr.trim() || `Podman exited with status ${String(launch.status)}`;
|
|
334
|
-
throw new UsageError(`managed isolation requested but the approved controller launch failed: ${detail} (fail closed; refusing stale-controller inspection)`);
|
|
335
|
-
}
|
|
336
|
-
const launchedControllerId = launch.stdout.trim();
|
|
337
|
-
if (!CONTAINER_ID.test(launchedControllerId)) {
|
|
338
|
-
throw new UsageError('managed isolation requested but Podman returned no single valid controller ID (fail closed)');
|
|
339
|
-
}
|
|
340
|
-
const active = inspectManagedRuntime(env, runner, expected, launchedControllerId);
|
|
341
|
-
if (active.profile === 'podman-rootless')
|
|
342
|
-
return active;
|
|
343
|
-
const detail = 'the newly launched controller was not inspectable as a valid managed runtime';
|
|
344
|
-
throw new UsageError(`managed isolation requested but ${detail} (fail closed; refusing local downgrade)`);
|
|
345
|
-
}
|
|
346
|
-
function validatedManagedImage(env) {
|
|
347
|
-
const image = env[MANAGED_IMAGE_ENV];
|
|
348
|
-
if (typeof image !== 'string' || !IMMUTABLE_IMAGE.test(image)) {
|
|
349
|
-
throw new UsageError(`managed isolation requested but ${MANAGED_IMAGE_ENV} must be an owner-provisioned immutable sha256 image digest`);
|
|
350
|
-
}
|
|
351
|
-
return image;
|
|
352
|
-
}
|
|
353
|
-
//# sourceMappingURL=isolation.js.map
|
package/dist/isolation.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isolation.js","sourceRoot":"","sources":["../src/isolation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAoDzC;;;GAGG;AACH,SAAS,cAAc,CAAC,KAAqB;IAC3C,OAAO,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC;QACzC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC;QACpC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC;QACpC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;AACzC,CA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AAC;IACxD,MAAM,MAAM,GAAG,8EAA8E,CAAC;IAC9F,MAAM,IAAI,UAAU,CAClB,mCAAmC,MAAM,0CAA0C,CACpF,CAAC;AAEJ,CAAC;AACD,SAAS,qBAAqB,CAAC,GAAsB;IACnD,MAAM,KAAK,GAAG,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACrC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9D,MAAM,IAAI,UAAU,CAClB,mCAAmC,iBAAiB,6DAA6D,CAClH,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/** Result returned by one host command invocation. */
|
|
2
|
-
export interface HostCommandResult {
|
|
3
|
-
/** Process exit status, or null when the process could not report one. */
|
|
4
|
-
status: number | null;
|
|
5
|
-
/** Captured stdout when the command was run without inherited stdio. */
|
|
6
|
-
stdout: string;
|
|
7
|
-
/** Captured stderr when the command was run without inherited stdio. */
|
|
8
|
-
stderr: string;
|
|
9
|
-
}
|
|
10
|
-
/** Options for the injected host command runner. */
|
|
11
|
-
export interface HostCommandOptions {
|
|
12
|
-
/** Pass the terminal directly to an installer so the owner can approve sudo. */
|
|
13
|
-
inheritStdio?: boolean;
|
|
14
|
-
/** Environment used for the host command. */
|
|
15
|
-
env?: NodeJS.ProcessEnv;
|
|
16
|
-
}
|
|
17
|
-
/** Narrow command seam used by bootstrap tests and the real host runner. */
|
|
18
|
-
export type HostCommandRunner = (command: string, args: readonly string[], options?: HostCommandOptions) => HostCommandResult;
|
|
19
|
-
/** Inputs that control bootstrap without reading candidate-owned settings. */
|
|
20
|
-
export interface PodmanBootstrapOptions {
|
|
21
|
-
/** Injected command runner; production defaults to spawnSync. */
|
|
22
|
-
runner?: HostCommandRunner;
|
|
23
|
-
/** Owner process environment. */
|
|
24
|
-
env?: NodeJS.ProcessEnv;
|
|
25
|
-
/** Platform override used by deterministic tests. */
|
|
26
|
-
platform?: NodeJS.Platform;
|
|
27
|
-
/** UID override used by deterministic tests. */
|
|
28
|
-
uid?: number | null;
|
|
29
|
-
/** Owner confirmation for a package-manager full-system upgrade fallback. */
|
|
30
|
-
confirmSystemUpgrade?: (message: string) => boolean | Promise<boolean>;
|
|
31
|
-
}
|
|
32
|
-
/** Verified Podman readiness returned by the bootstrap. */
|
|
33
|
-
export interface PodmanReadiness {
|
|
34
|
-
/** Reported Podman version line. */
|
|
35
|
-
version: string;
|
|
36
|
-
/** Rootless mode was verified through `podman info`. */
|
|
37
|
-
rootless: true;
|
|
38
|
-
/** Whether this invocation installed Podman. */
|
|
39
|
-
installedNow: boolean;
|
|
40
|
-
/** Package manager used for installation, when installation occurred. */
|
|
41
|
-
packageManager: string | null;
|
|
42
|
-
}
|
|
43
|
-
/** Runs one fixed executable without a shell and optionally inherits the terminal. */
|
|
44
|
-
export declare function runHostCommand(command: string, args: readonly string[], options?: HostCommandOptions): HostCommandResult;
|
|
45
|
-
/**
|
|
46
|
-
* Detects or installs Podman, then verifies rootless readiness for managed init.
|
|
47
|
-
*
|
|
48
|
-
* Args:
|
|
49
|
-
* options (PodmanBootstrapOptions): owner environment, confirmation, and test seams.
|
|
50
|
-
*
|
|
51
|
-
* Returns:
|
|
52
|
-
* Promise<PodmanReadiness>: verified version and installation details.
|
|
53
|
-
*
|
|
54
|
-
* Throws:
|
|
55
|
-
* UsageError: when the platform, package manager, installation, or rootless
|
|
56
|
-
* runtime is unavailable. No project files should be written before this.
|
|
57
|
-
*/
|
|
58
|
-
export declare function ensurePodman(options?: PodmanBootstrapOptions): Promise<PodmanReadiness>;
|
|
59
|
-
//# sourceMappingURL=podman-bootstrap.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"podman-bootstrap.d.ts","sourceRoot":"","sources":["../src/podman-bootstrap.ts"],"names":[],"mappings":"AAWA,sDAAsD;AACtD,MAAM,WAAW,iBA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AE,kBAAuB,GAC/B,iBAAiB,CAWnB;AA2CD;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,CAAC,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,eAAe,CAAC,CA8DjG"}
|
package/dist/podman-bootstrap.js
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gateforge-managed Podman bootstrap for the existing `init --managed` path.
|
|
3
|
-
*
|
|
4
|
-
* This module deliberately owns only host-runtime setup: it detects Podman,
|
|
5
|
-
* invokes a native package manager with fixed arguments when needed, and
|
|
6
|
-
* verifies that the current user can run Podman rootlessly. It never invokes a
|
|
7
|
-
* shell, reads candidate configuration, or installs from npm lifecycle hooks.
|
|
8
|
-
*/
|
|
9
|
-
import { spawnSync } from 'node:child_process';
|
|
10
|
-
import { UsageError } from './errors.js';
|
|
11
|
-
/** Runs one fixed executable without a shell and optionally inherits the terminal. */
|
|
12
|
-
export function runHostCommand(command, args, options = {}) {
|
|
13
|
-
const result = spawnSync(command, [...args], {
|
|
14
|
-
encoding: 'utf8',
|
|
15
|
-
env: options.env,
|
|
16
|
-
...(options.inheritStdio ? { stdio: 'inherit' } : {}),
|
|
17
|
-
});
|
|
18
|
-
return {
|
|
19
|
-
status: result.status,
|
|
20
|
-
stdout: typeof result.stdout === 'string' ? result.stdout : '',
|
|
21
|
-
stderr: typeof result.stderr === 'string' ? result.stderr : '',
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
/** Lists the supported native package-manager installers for a platform. */
|
|
25
|
-
function packageManagers(platform) {
|
|
26
|
-
if (platform !== 'linux')
|
|
27
|
-
return [];
|
|
28
|
-
return [
|
|
29
|
-
{
|
|
30
|
-
name: 'pacman',
|
|
31
|
-
command: 'pacman',
|
|
32
|
-
versionArgs: ['--version'],
|
|
33
|
-
installArgs: ['-S', '--needed', 'podman'],
|
|
34
|
-
fullUpgradeArgs: ['-Syu', '--needed', 'podman'],
|
|
35
|
-
},
|
|
36
|
-
{ name: 'apt-get', command: 'apt-get', versionArgs: ['--version'], installArgs: ['install', '-y', 'podman'] },
|
|
37
|
-
{ name: 'dnf', command: 'dnf', versionArgs: ['--version'], installArgs: ['install', '-y', 'podman'] },
|
|
38
|
-
];
|
|
39
|
-
}
|
|
40
|
-
/** Finds the first available supported package manager without invoking a shell. */
|
|
41
|
-
function findPackageManager(runner, env, platform) {
|
|
42
|
-
for (const manager of packageManagers(platform)) {
|
|
43
|
-
if (runner(manager.command, manager.versionArgs, { env }).status === 0)
|
|
44
|
-
return manager;
|
|
45
|
-
}
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
/** Reads a working Podman version, returning null when Podman is absent or broken. */
|
|
49
|
-
function probeVersion(runner, env) {
|
|
50
|
-
const result = runner('podman', ['--version'], { env });
|
|
51
|
-
if (result.status !== 0)
|
|
52
|
-
return null;
|
|
53
|
-
const version = result.stdout.trim();
|
|
54
|
-
return version.length > 0 ? version : null;
|
|
55
|
-
}
|
|
56
|
-
/** Verifies that the current user can use Podman without a rootful fallback. */
|
|
57
|
-
function verifyRootless(runner, env) {
|
|
58
|
-
const result = runner('podman', ['info', '--format', '{{.Host.Security.Rootless}}'], { env });
|
|
59
|
-
if (result.status !== 0 || result.stdout.trim().toLowerCase() !== 'true') {
|
|
60
|
-
const detail = result.stderr.trim() || result.stdout.trim() || 'Podman did not report rootless=true';
|
|
61
|
-
throw new UsageError(`managed initialization requires rootless Podman: ${detail}`);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Detects or installs Podman, then verifies rootless readiness for managed init.
|
|
66
|
-
*
|
|
67
|
-
* Args:
|
|
68
|
-
* options (PodmanBootstrapOptions): owner environment, confirmation, and test seams.
|
|
69
|
-
*
|
|
70
|
-
* Returns:
|
|
71
|
-
* Promise<PodmanReadiness>: verified version and installation details.
|
|
72
|
-
*
|
|
73
|
-
* Throws:
|
|
74
|
-
* UsageError: when the platform, package manager, installation, or rootless
|
|
75
|
-
* runtime is unavailable. No project files should be written before this.
|
|
76
|
-
*/
|
|
77
|
-
export async function ensurePodman(options = {}) {
|
|
78
|
-
const runner = options.runner ?? runHostCommand;
|
|
79
|
-
const env = options.env ?? process.env;
|
|
80
|
-
const platform = options.platform ?? process.platform;
|
|
81
|
-
if (platform !== 'linux') {
|
|
82
|
-
throw new UsageError(`managed initialization currently supports Linux rootless Podman only; '${platform}' requires a dedicated runtime backend`);
|
|
83
|
-
}
|
|
84
|
-
const uid = options.uid ?? (typeof process.getuid === 'function' ? process.getuid() : null);
|
|
85
|
-
let version = probeVersion(runner, env);
|
|
86
|
-
let installedNow = false;
|
|
87
|
-
let packageManager = null;
|
|
88
|
-
if (version === null) {
|
|
89
|
-
const manager = findPackageManager(runner, env, platform);
|
|
90
|
-
if (manager === null) {
|
|
91
|
-
throw new UsageError(`managed initialization cannot install Podman automatically on '${platform}': ` +
|
|
92
|
-
'supported Linux package managers are pacman, apt-get, and dnf');
|
|
93
|
-
}
|
|
94
|
-
const command = uid === 0 ? manager.command : 'sudo';
|
|
95
|
-
let installed = runner(command, uid === 0 ? manager.installArgs : [manager.command, ...manager.installArgs], { env, inheritStdio: true });
|
|
96
|
-
if (installed.status !== 0 && manager.fullUpgradeArgs !== undefined) {
|
|
97
|
-
const detail = installed.stderr.trim() || `installer exited with status ${String(installed.status)}`;
|
|
98
|
-
const question = `${manager.name} could not install Podman directly (${detail}). ` +
|
|
99
|
-
'A full system upgrade is the fallback and may update many packages. Continue? [y/N] ';
|
|
100
|
-
const approved = options.confirmSystemUpgrade === undefined
|
|
101
|
-
? false
|
|
102
|
-
: await options.confirmSystemUpgrade(question);
|
|
103
|
-
if (!approved) {
|
|
104
|
-
throw new UsageError(`managed initialization did not install Podman: ${manager.name} targeted install failed; ` +
|
|
105
|
-
'the full system upgrade fallback was not approved');
|
|
106
|
-
}
|
|
107
|
-
installed = runner(command, uid === 0 ? manager.fullUpgradeArgs : [manager.command, ...manager.fullUpgradeArgs], { env, inheritStdio: true });
|
|
108
|
-
}
|
|
109
|
-
if (installed.status !== 0) {
|
|
110
|
-
const detail = installed.stderr.trim() || `installer exited with status ${String(installed.status)}`;
|
|
111
|
-
throw new UsageError(`managed initialization could not install Podman with ${manager.name}: ${detail}`);
|
|
112
|
-
}
|
|
113
|
-
version = probeVersion(runner, env);
|
|
114
|
-
if (version === null) {
|
|
115
|
-
throw new UsageError('managed initialization installed Podman but could not execute `podman --version` afterward');
|
|
116
|
-
}
|
|
117
|
-
installedNow = true;
|
|
118
|
-
packageManager = manager.name;
|
|
119
|
-
}
|
|
120
|
-
verifyRootless(runner, env);
|
|
121
|
-
return { version, rootless: true, installedNow, packageManager };
|
|
122
|
-
}
|
|
123
|
-
//# sourceMappingURL=podman-bootstrap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"podman-bootstrap.js","sourceRoot":"","sources":["../src/podman-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA8DzC,sFAAsF;AACtF,MAAM,UAAU,cAAc,CAC5B,OAAe,EACf,IAAuB,EACvB,UAA8B,EAAE;IAEhC,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE;QAC3C,QAAQ,EAAE,MAAM;QAChB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,SAAkB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC/D,CAAC,CAAC;IACH,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;QAC9D,MAA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