@gate-forge/cli 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -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 +4 -10
- package/dist/cli.js.map +1 -1
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +2 -3
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +13 -90
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/test-gates.d.ts.map +1 -1
- package/dist/commands/test-gates.js +6 -14
- package/dist/commands/test-gates.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/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
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `gateforge controller`: the managed controller lifecycle.
|
|
3
|
-
*
|
|
4
|
-
* The current controller owns only a bounded health/heartbeat lifecycle. It
|
|
5
|
-
* deliberately does not execute candidate commands, read candidate settings,
|
|
6
|
-
* or claim to provide commit brokering; those responsibilities remain in the
|
|
7
|
-
* owner-side managed runtime and broker surfaces.
|
|
8
|
-
*/
|
|
9
|
-
import { mkdirSync, renameSync, writeFileSync } from 'node:fs';
|
|
10
|
-
import { dirname } from 'node:path';
|
|
11
|
-
import { parseArgs } from '../args.js';
|
|
12
|
-
import { UsageError } from '../errors.js';
|
|
13
|
-
import { writeLine } from '../io.js';
|
|
14
|
-
import { rejectUnknownFlags } from './common.js';
|
|
15
|
-
export const CONTROLLER_USAGE = 'usage: gateforge controller';
|
|
16
|
-
export const CONTROLLER_STATE_PATH = '/app-state/controller-health.json';
|
|
17
|
-
const HEARTBEAT_INTERVAL_MS = 5_000;
|
|
18
|
-
const systemClock = {
|
|
19
|
-
now: () => Date.now(),
|
|
20
|
-
setInterval: (callback, delayMs) => setInterval(callback, delayMs),
|
|
21
|
-
clearInterval: (timer) => clearInterval(timer),
|
|
22
|
-
};
|
|
23
|
-
const processSignals = {
|
|
24
|
-
add: (signal, handler) => process.on(signal, handler),
|
|
25
|
-
remove: (signal, handler) => process.removeListener(signal, handler),
|
|
26
|
-
};
|
|
27
|
-
function timestamp(clock) {
|
|
28
|
-
return new Date(clock.now()).toISOString();
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Writes one complete health document atomically at the fixed app-state path.
|
|
32
|
-
* The path is never taken from argv or candidate-controlled configuration.
|
|
33
|
-
*/
|
|
34
|
-
function writeHealth(path, health) {
|
|
35
|
-
mkdirSync(dirname(path), { recursive: true });
|
|
36
|
-
const temporaryPath = `${path}.tmp`;
|
|
37
|
-
writeFileSync(temporaryPath, `${JSON.stringify(health)}\n`, { encoding: 'utf8', mode: 0o600 });
|
|
38
|
-
renameSync(temporaryPath, path);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Runs until SIGTERM or SIGINT, refreshing a fixed health document every five
|
|
42
|
-
* seconds and recording a final stopped state before resolving cleanly.
|
|
43
|
-
*/
|
|
44
|
-
export function runController(runtime = {}) {
|
|
45
|
-
const clock = runtime.clock ?? systemClock;
|
|
46
|
-
const signals = runtime.signals ?? processSignals;
|
|
47
|
-
const statePath = runtime.statePath ?? CONTROLLER_STATE_PATH;
|
|
48
|
-
const startedAt = timestamp(clock);
|
|
49
|
-
let timer;
|
|
50
|
-
let settled = false;
|
|
51
|
-
return new Promise((resolve, reject) => {
|
|
52
|
-
const healthy = () => {
|
|
53
|
-
writeHealth(statePath, {
|
|
54
|
-
schemaVersion: 1,
|
|
55
|
-
component: 'gateforge-controller',
|
|
56
|
-
status: 'healthy',
|
|
57
|
-
startedAt,
|
|
58
|
-
heartbeatAt: timestamp(clock),
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
try {
|
|
62
|
-
healthy();
|
|
63
|
-
const stop = (signal) => {
|
|
64
|
-
if (settled)
|
|
65
|
-
return;
|
|
66
|
-
settled = true;
|
|
67
|
-
if (timer !== undefined)
|
|
68
|
-
clock.clearInterval(timer);
|
|
69
|
-
const stoppedAt = timestamp(clock);
|
|
70
|
-
writeHealth(statePath, {
|
|
71
|
-
schemaVersion: 1,
|
|
72
|
-
component: 'gateforge-controller',
|
|
73
|
-
status: 'stopped',
|
|
74
|
-
startedAt,
|
|
75
|
-
heartbeatAt: stoppedAt,
|
|
76
|
-
stoppedAt,
|
|
77
|
-
stopSignal: signal,
|
|
78
|
-
});
|
|
79
|
-
signals.remove('SIGTERM', onSigterm);
|
|
80
|
-
signals.remove('SIGINT', onSigint);
|
|
81
|
-
resolve(0);
|
|
82
|
-
};
|
|
83
|
-
const onSigterm = () => stop('SIGTERM');
|
|
84
|
-
const onSigint = () => stop('SIGINT');
|
|
85
|
-
signals.add('SIGTERM', onSigterm);
|
|
86
|
-
signals.add('SIGINT', onSigint);
|
|
87
|
-
timer = clock.setInterval(healthy, HEARTBEAT_INTERVAL_MS);
|
|
88
|
-
}
|
|
89
|
-
catch (error) {
|
|
90
|
-
reject(error);
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Parses and runs the controller command. With no arguments it enters the
|
|
96
|
-
* lifecycle above and emits no usage text; `--help` is the only usage path.
|
|
97
|
-
*/
|
|
98
|
-
export async function controllerCommand(io, argv, runtime = {}) {
|
|
99
|
-
const { options, positionals } = parseArgs(argv);
|
|
100
|
-
if (options['help'] === true && positionals.length === 0) {
|
|
101
|
-
writeLine(io.stdout, CONTROLLER_USAGE);
|
|
102
|
-
return 0;
|
|
103
|
-
}
|
|
104
|
-
rejectUnknownFlags(options, ['help'], CONTROLLER_USAGE);
|
|
105
|
-
if (positionals.length > 0) {
|
|
106
|
-
throw new UsageError(`controller does not accept positional arguments (${CONTROLLER_USAGE})`);
|
|
107
|
-
}
|
|
108
|
-
return runController(runtime);
|
|
109
|
-
}
|
|
110
|
-
//# sourceMappingURL=controller.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"controller.js","sourceRoot":"","sources":["../../src/commands/controller.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,CAAC,MAAM,gBAAgB,GAAG,6BAA6B,CAAC;AAC9D,MAAM,CAAC,MAAM,qBAAqB,GAAG,mCAAmC,CAAC;AACzE,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAmCpC,MAAM,WAAW,GAAoB;IACnC,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;IACrB,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC;IAClE,aAAa,EAAE,CAAC,KAAK,EA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KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC;QAC5D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,EAAM,EACN,IAAuB,EACvB,UAA6B,EAAE;IAE/B,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IACjD,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzD,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;QACvC,OAAO,CAAC,CAAC;IACX,CAAC;IACD,kBAAkB,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC,CAAC;IACxD,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,UAAU,CAAC,oDAAoD,gBAAgB,GAAG,CAAC,CAAC;IAChG,CAAC;IACD,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC"}
|
package/dist/isolation.d.ts
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
/** The runtime profiles this controller understands. */
|
|
2
|
-
export type IsolationProfile = 'local-unisolated' | 'podman-rootless';
|
|
3
|
-
/** One validated mount of the active runtime. */
|
|
4
|
-
export interface IsolationMount {
|
|
5
|
-
/** Host path (as mounted). */
|
|
6
|
-
source: string;
|
|
7
|
-
/** Container path. */
|
|
8
|
-
target: string;
|
|
9
|
-
/** True only for explicitly read-only mounts. */
|
|
10
|
-
readOnly: boolean;
|
|
11
|
-
}
|
|
12
|
-
/** Authoritative record of the active execution boundary. */
|
|
13
|
-
export interface IsolationRecord {
|
|
14
|
-
/** The profile that actually ran. */
|
|
15
|
-
profile: IsolationProfile;
|
|
16
|
-
/** Active mounts (exactly engine, candidate, and app state for managed runs). */
|
|
17
|
-
mounts: IsolationMount[];
|
|
18
|
-
/** Runtime user inside the container (never root for rootless profiles). */
|
|
19
|
-
user: string | null;
|
|
20
|
-
/** Network mode (`none`/`private` for managed profiles). */
|
|
21
|
-
network: string | null;
|
|
22
|
-
/** True when the candidate had no path to the container socket. */
|
|
23
|
-
containerSocketHidden: boolean;
|
|
24
|
-
/** Profile-class digest sealed into receipts for this execution boundary. */
|
|
25
|
-
boundaryDigest: string;
|
|
26
|
-
}
|
|
27
|
-
/** Request for one supervised launch. */
|
|
28
|
-
export interface IsolationLaunchRequest {
|
|
29
|
-
profile: IsolationProfile;
|
|
30
|
-
/** Absolute path of the frozen candidate checkout (mounted read-only). */
|
|
31
|
-
candidateDir: string;
|
|
32
|
-
/** Absolute path of the approved engine/policy bundle (mounted read-only). */
|
|
33
|
-
engineBundleDir: string;
|
|
34
|
-
/** Absolute path of the disposable app-state directory (writable). */
|
|
35
|
-
appStateDir: string;
|
|
36
|
-
}
|
|
37
|
-
/** Narrow Podman seam used to keep the fixed launch and inspect contract testable. */
|
|
38
|
-
export type PodmanRunner = (args: readonly string[], env: NodeJS.ProcessEnv) => {
|
|
39
|
-
status: number;
|
|
40
|
-
stdout: string;
|
|
41
|
-
stderr: string;
|
|
42
|
-
};
|
|
43
|
-
type ExpectedManagedBoundary = Pick<IsolationLaunchRequest, 'candidateDir' | 'engineBundleDir' | 'appStateDir'> & {
|
|
44
|
-
image?: string;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Validates one active-runtime record against the profile's hard rules and,
|
|
48
|
-
* when supplied, binds each managed mount source to the launch request.
|
|
49
|
-
*
|
|
50
|
-
* Args:
|
|
51
|
-
* record: the record returned by the runtime launcher.
|
|
52
|
-
* expected: request paths and optional owner image expected by inspection.
|
|
53
|
-
*
|
|
54
|
-
* Returns:
|
|
55
|
-
* IsolationRecord: the validated record with a recomputed boundary digest.
|
|
56
|
-
*
|
|
57
|
-
* Throws:
|
|
58
|
-
* UsageError: on any violated rule (fail closed — an invalid boundary
|
|
59
|
-
* record never authorizes a receipt).
|
|
60
|
-
*/
|
|
61
|
-
export declare function validateIsolationRecord(record: IsolationRecord, expected?: ExpectedManagedBoundary): IsolationRecord;
|
|
62
|
-
/**
|
|
63
|
-
* Runs one fixed-argument Podman command without a shell or caller command.
|
|
64
|
-
* Production uses this only through the managed launch/inspection paths.
|
|
65
|
-
*/
|
|
66
|
-
export declare function runPodman(args: readonly string[], env: NodeJS.ProcessEnv): {
|
|
67
|
-
status: number;
|
|
68
|
-
stdout: string;
|
|
69
|
-
stderr: string;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Inspects the active managed controller after a fixed profile launch.
|
|
73
|
-
* Podman inspect is authoritative for mounts, image, user, network, and
|
|
74
|
-
* socket visibility; a role label alone never fabricates those facts.
|
|
75
|
-
*
|
|
76
|
-
* Args:
|
|
77
|
-
* env: owner-controlled orchestrator environment.
|
|
78
|
-
* runner: narrow Podman seam used by production and focused tests.
|
|
79
|
-
* expected: launch paths and immutable image that must match inspection.
|
|
80
|
-
* launchedControllerId: exact successful launch ID; skips stale name discovery.
|
|
81
|
-
*
|
|
82
|
-
* Returns:
|
|
83
|
-
* IsolationRecord: the validated managed boundary, or an honest local
|
|
84
|
-
* boundary when no controller is present.
|
|
85
|
-
*
|
|
86
|
-
* Throws:
|
|
87
|
-
* UsageError: when Podman reports malformed, unrelated, or invalid managed
|
|
88
|
-
* runtime evidence.
|
|
89
|
-
*/
|
|
90
|
-
export declare function inspectManagedRuntime(env: NodeJS.ProcessEnv, runner?: PodmanRunner, expected?: ExpectedManagedBoundary, launchedControllerId?: string): IsolationRecord;
|
|
91
|
-
/**
|
|
92
|
-
* Resolves the intended execution profile from the owner-controlled
|
|
93
|
-
* authority boundary. Candidate configuration is deliberately not read.
|
|
94
|
-
*/
|
|
95
|
-
export declare function isolationProfileForEnvironment(env: NodeJS.ProcessEnv): IsolationProfile;
|
|
96
|
-
/**
|
|
97
|
-
* Resolves a supervised launch against the owner-requested profile. Local
|
|
98
|
-
* mode returns its honest empty boundary without invoking Podman. Managed
|
|
99
|
-
* mode validates owner image and request paths, launches only the fixed
|
|
100
|
-
* profile, then accepts only matching authoritative inspect evidence.
|
|
101
|
-
*/
|
|
102
|
-
export declare function resolveIsolation(request: IsolationLaunchRequest, env: NodeJS.ProcessEnv, runner?: PodmanRunner): IsolationRecord;
|
|
103
|
-
export {};
|
|
104
|
-
//# sourceMappingURL=isolation.d.ts.map
|
package/dist/isolation.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isolation.d.ts","sourceRoot":"","sources":["../src/isolation.ts"],"names":[],"mappings":"AAsBA,wDAAwD;AACxD,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,GAAG,iBAAiB,CAAC;AAEtE,iDAAiD;AACjD,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,6DAA6D;AAC7D,MAAM,WAAW,eAAe;IAC9B,qCAAqC;IACrC,OAAO,EAAE,gBAAgB,CAAC;IAC1B,iFAAiF;IACjF,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,4EAA4E;IAC5E,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,mEAAmE;IACnE,qBAAqB,EAAE,OAAO,CAAC;IAC/B,6EAA6E;IAC7E,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,yCAAyC;AACzC,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,gBAAgB,CAAC;IAC1B,0EAA0E;IAC1E,YAAY,EAAE,MAAM,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YAAwB,GAC/B,eAAe,CAwEjB"}
|
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,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAAuB,EACvB,QAAkC;IAElC,MAAM,IAAI,GAAG,CAAC,MAAc,EAAS,EAAE;QACrC,MAAM,IAAI,UAAU,CAAC,+BAA+B,MAAM,EAAE,CAAC,CAAC;IAChE,CAAC,CAAC;IACF,IAAI,MAAM,CAAC,OAAO,KAAK,kBAAkB,EAAE,CAAC;QAC1C,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,IAAI,MAAM,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;YAClF,IAAI,CAAC,uDAAuD,CAAC,CAAC;QAChE,CAAC;QACD,OAAO,EAAE,GAAG,MAAM,EAAE,cAAc,EAAE,yBAAyB,CAAC,MAAM,CAAC,OAAO,CA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,QAAQ,CAAC,WAAW,gBAAgB;QACvC,KAAK;QACL,YAAY;KACb,EAAE,GAAG,CAAC,CAAC;IACR,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,6BAA6B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5F,MAAM,IAAI,UAAU,CAClB,0EAA0E,MAAM,sDAAsD,CACvI,CAAC;IACJ,CAAC;IACD,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAClD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,UAAU,CAClB,6FAA6F,CAC9F,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,CAAC,CAAC;IAClF,IAAI,MAAM,CAAC,OAAO,KAAK,iBAAiB;QAAE,OAAO,MAAM,CAAC;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
|