@aspectlylabs/mikka 0.0.114 → 0.0.116
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/agents/run-container-entry.mjs +22 -0
- package/cli.js +1662 -2183
- package/client.js +27 -4
- package/harness/Dockerfile +19 -0
- package/harness/cli.mjs +12 -0
- package/harness/install.mjs +113 -0
- package/harness/pins.json +25 -0
- package/http-link.js +28 -4
- package/login.js +25 -4
- package/main.js +1465 -1989
- package/mikka-release-manifest.json +45 -20
- package/mikka.js +1662 -2183
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
- package/paths.js +6 -3
- package/sbom.cdx.json +7 -7
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// First process in a run container (run-container.ts): the container has no
|
|
2
|
+
// network interface, so this relays the CLI's proxy traffic to the run's one
|
|
3
|
+
// mounted egress socket, where the daemon applies the run's network approval.
|
|
4
|
+
// Then it runs the CLI and exits with it.
|
|
5
|
+
import { spawn } from 'node:child_process'
|
|
6
|
+
import { existsSync } from 'node:fs'
|
|
7
|
+
import { startNativeEgress } from './native-egress.mjs'
|
|
8
|
+
|
|
9
|
+
const [command, ...args] = process.argv.slice(2)
|
|
10
|
+
if (!command) process.exit(2)
|
|
11
|
+
const env = { ...process.env }
|
|
12
|
+
if (existsSync('/run/mikka-egress.sock')) {
|
|
13
|
+
const egress = await startNativeEgress()
|
|
14
|
+
Object.assign(env, {
|
|
15
|
+
HTTP_PROXY: egress.url, HTTPS_PROXY: egress.url, http_proxy: egress.url, https_proxy: egress.url,
|
|
16
|
+
NO_PROXY: 'localhost,127.0.0.1,::1', no_proxy: 'localhost,127.0.0.1,::1', NODE_USE_ENV_PROXY: '1',
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
const child = spawn(command, args, { stdio: 'inherit', env })
|
|
20
|
+
for (const signal of ['SIGTERM', 'SIGINT', 'SIGHUP']) process.on(signal, () => child.kill(signal))
|
|
21
|
+
child.on('error', () => process.exit(127))
|
|
22
|
+
child.on('exit', (code, signal) => process.exit(code ?? (signal ? 128 : 1)))
|