@forgezero/agent 0.1.77 → 0.1.79
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/dist/agent-heartbeat.js +1 -1
- package/dist/bootstrap.js +1 -1
- package/dist/community-rehearsal-host.js +29 -7
- package/dist/definition.js +29 -7
- package/dist/deploy-file.js +29 -7
- package/dist/fz-agent.js +45 -18
- package/dist/fz.js +1 -1
- package/dist/metal-bootstrap.js +1 -1
- package/dist/metal-helper-socket.js +29 -7
- package/dist/metal-provision.js +29 -7
- package/dist/operator-bootstrap.js +1 -1
- package/dist/platform-bootstrap-runtime.js +29 -7
- package/dist/platform-fleet-verification.js +30 -8
- package/dist/platform-genesis.js +29 -7
- package/dist/provision.js +30 -8
- package/dist/software-helper.js +29 -7
- package/dist/software.d.ts +1 -0
- package/dist/software.js +30 -7
- package/dist/stdin.d.ts +4 -2
- package/dist/ubuntu.js +29 -7
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/agent-heartbeat.js
CHANGED
package/dist/bootstrap.js
CHANGED
|
@@ -165,16 +165,38 @@ var runSoftwareCommand = async (argv, env = {}) => {
|
|
|
165
165
|
return { exitCode, output: `${stdout}${stderr}` };
|
|
166
166
|
};
|
|
167
167
|
var run = runSoftwareCommand;
|
|
168
|
+
var softwareDownloadCommand = (url, destination, maximumBytes) => {
|
|
169
|
+
const source = new URL(url);
|
|
170
|
+
if (source.protocol !== "https:" || source.username || source.password)
|
|
171
|
+
throw new Error("software download must use credential-free HTTPS");
|
|
172
|
+
if (!Number.isSafeInteger(maximumBytes) || maximumBytes < 1)
|
|
173
|
+
throw new Error("software download size bound is invalid");
|
|
174
|
+
return [
|
|
175
|
+
"/usr/bin/curl",
|
|
176
|
+
"--fail",
|
|
177
|
+
"--location",
|
|
178
|
+
"--silent",
|
|
179
|
+
"--show-error",
|
|
180
|
+
"--proto",
|
|
181
|
+
"=https",
|
|
182
|
+
"--tlsv1.2",
|
|
183
|
+
"--max-time",
|
|
184
|
+
"1800",
|
|
185
|
+
"--max-filesize",
|
|
186
|
+
String(maximumBytes),
|
|
187
|
+
"--output",
|
|
188
|
+
destination,
|
|
189
|
+
source.href
|
|
190
|
+
];
|
|
191
|
+
};
|
|
168
192
|
var download = async (url, destination, sha256, maximumBytes = 512 * 1024 * 1024) => {
|
|
169
|
-
const response = await fetch(url, { redirect: "follow", signal: AbortSignal.timeout(30 * 60000) });
|
|
170
|
-
if (!response.ok)
|
|
171
|
-
throw new Error(`download failed with HTTP ${response.status}`);
|
|
172
|
-
const declared = Number(response.headers.get("content-length") ?? 0);
|
|
173
|
-
if (declared > maximumBytes)
|
|
174
|
-
throw new Error("download exceeds reviewed size bound");
|
|
175
193
|
if (existsSync(destination))
|
|
176
194
|
throw new Error("download destination already exists");
|
|
177
|
-
await
|
|
195
|
+
const received = await run(softwareDownloadCommand(url, destination, maximumBytes));
|
|
196
|
+
if (received.exitCode !== 0) {
|
|
197
|
+
rmSync(destination, { force: true });
|
|
198
|
+
throw new Error(`software download failed (${received.exitCode}): ${received.output.trim()}`);
|
|
199
|
+
}
|
|
178
200
|
chmodSync(destination, 384);
|
|
179
201
|
if (statSync(destination).size > maximumBytes) {
|
|
180
202
|
rmSync(destination, { force: true });
|
package/dist/definition.js
CHANGED
|
@@ -165,16 +165,38 @@ var runSoftwareCommand = async (argv, env = {}) => {
|
|
|
165
165
|
return { exitCode, output: `${stdout}${stderr}` };
|
|
166
166
|
};
|
|
167
167
|
var run = runSoftwareCommand;
|
|
168
|
+
var softwareDownloadCommand = (url, destination, maximumBytes) => {
|
|
169
|
+
const source = new URL(url);
|
|
170
|
+
if (source.protocol !== "https:" || source.username || source.password)
|
|
171
|
+
throw new Error("software download must use credential-free HTTPS");
|
|
172
|
+
if (!Number.isSafeInteger(maximumBytes) || maximumBytes < 1)
|
|
173
|
+
throw new Error("software download size bound is invalid");
|
|
174
|
+
return [
|
|
175
|
+
"/usr/bin/curl",
|
|
176
|
+
"--fail",
|
|
177
|
+
"--location",
|
|
178
|
+
"--silent",
|
|
179
|
+
"--show-error",
|
|
180
|
+
"--proto",
|
|
181
|
+
"=https",
|
|
182
|
+
"--tlsv1.2",
|
|
183
|
+
"--max-time",
|
|
184
|
+
"1800",
|
|
185
|
+
"--max-filesize",
|
|
186
|
+
String(maximumBytes),
|
|
187
|
+
"--output",
|
|
188
|
+
destination,
|
|
189
|
+
source.href
|
|
190
|
+
];
|
|
191
|
+
};
|
|
168
192
|
var download = async (url, destination, sha256, maximumBytes = 512 * 1024 * 1024) => {
|
|
169
|
-
const response = await fetch(url, { redirect: "follow", signal: AbortSignal.timeout(30 * 60000) });
|
|
170
|
-
if (!response.ok)
|
|
171
|
-
throw new Error(`download failed with HTTP ${response.status}`);
|
|
172
|
-
const declared = Number(response.headers.get("content-length") ?? 0);
|
|
173
|
-
if (declared > maximumBytes)
|
|
174
|
-
throw new Error("download exceeds reviewed size bound");
|
|
175
193
|
if (existsSync(destination))
|
|
176
194
|
throw new Error("download destination already exists");
|
|
177
|
-
await
|
|
195
|
+
const received = await run(softwareDownloadCommand(url, destination, maximumBytes));
|
|
196
|
+
if (received.exitCode !== 0) {
|
|
197
|
+
rmSync(destination, { force: true });
|
|
198
|
+
throw new Error(`software download failed (${received.exitCode}): ${received.output.trim()}`);
|
|
199
|
+
}
|
|
178
200
|
chmodSync(destination, 384);
|
|
179
201
|
if (statSync(destination).size > maximumBytes) {
|
|
180
202
|
rmSync(destination, { force: true });
|
package/dist/deploy-file.js
CHANGED
|
@@ -165,16 +165,38 @@ var runSoftwareCommand = async (argv, env = {}) => {
|
|
|
165
165
|
return { exitCode, output: `${stdout}${stderr}` };
|
|
166
166
|
};
|
|
167
167
|
var run = runSoftwareCommand;
|
|
168
|
+
var softwareDownloadCommand = (url, destination, maximumBytes) => {
|
|
169
|
+
const source = new URL(url);
|
|
170
|
+
if (source.protocol !== "https:" || source.username || source.password)
|
|
171
|
+
throw new Error("software download must use credential-free HTTPS");
|
|
172
|
+
if (!Number.isSafeInteger(maximumBytes) || maximumBytes < 1)
|
|
173
|
+
throw new Error("software download size bound is invalid");
|
|
174
|
+
return [
|
|
175
|
+
"/usr/bin/curl",
|
|
176
|
+
"--fail",
|
|
177
|
+
"--location",
|
|
178
|
+
"--silent",
|
|
179
|
+
"--show-error",
|
|
180
|
+
"--proto",
|
|
181
|
+
"=https",
|
|
182
|
+
"--tlsv1.2",
|
|
183
|
+
"--max-time",
|
|
184
|
+
"1800",
|
|
185
|
+
"--max-filesize",
|
|
186
|
+
String(maximumBytes),
|
|
187
|
+
"--output",
|
|
188
|
+
destination,
|
|
189
|
+
source.href
|
|
190
|
+
];
|
|
191
|
+
};
|
|
168
192
|
var download = async (url, destination, sha256, maximumBytes = 512 * 1024 * 1024) => {
|
|
169
|
-
const response = await fetch(url, { redirect: "follow", signal: AbortSignal.timeout(30 * 60000) });
|
|
170
|
-
if (!response.ok)
|
|
171
|
-
throw new Error(`download failed with HTTP ${response.status}`);
|
|
172
|
-
const declared = Number(response.headers.get("content-length") ?? 0);
|
|
173
|
-
if (declared > maximumBytes)
|
|
174
|
-
throw new Error("download exceeds reviewed size bound");
|
|
175
193
|
if (existsSync(destination))
|
|
176
194
|
throw new Error("download destination already exists");
|
|
177
|
-
await
|
|
195
|
+
const received = await run(softwareDownloadCommand(url, destination, maximumBytes));
|
|
196
|
+
if (received.exitCode !== 0) {
|
|
197
|
+
rmSync(destination, { force: true });
|
|
198
|
+
throw new Error(`software download failed (${received.exitCode}): ${received.output.trim()}`);
|
|
199
|
+
}
|
|
178
200
|
chmodSync(destination, 384);
|
|
179
201
|
if (statSync(destination).size > maximumBytes) {
|
|
180
202
|
rmSync(destination, { force: true });
|
package/dist/fz-agent.js
CHANGED
|
@@ -5114,16 +5114,38 @@ var runSoftwareCommand = async (argv, env = {}) => {
|
|
|
5114
5114
|
return { exitCode, output: `${stdout}${stderr}` };
|
|
5115
5115
|
};
|
|
5116
5116
|
var run = runSoftwareCommand;
|
|
5117
|
+
var softwareDownloadCommand = (url, destination, maximumBytes) => {
|
|
5118
|
+
const source = new URL(url);
|
|
5119
|
+
if (source.protocol !== "https:" || source.username || source.password)
|
|
5120
|
+
throw new Error("software download must use credential-free HTTPS");
|
|
5121
|
+
if (!Number.isSafeInteger(maximumBytes) || maximumBytes < 1)
|
|
5122
|
+
throw new Error("software download size bound is invalid");
|
|
5123
|
+
return [
|
|
5124
|
+
"/usr/bin/curl",
|
|
5125
|
+
"--fail",
|
|
5126
|
+
"--location",
|
|
5127
|
+
"--silent",
|
|
5128
|
+
"--show-error",
|
|
5129
|
+
"--proto",
|
|
5130
|
+
"=https",
|
|
5131
|
+
"--tlsv1.2",
|
|
5132
|
+
"--max-time",
|
|
5133
|
+
"1800",
|
|
5134
|
+
"--max-filesize",
|
|
5135
|
+
String(maximumBytes),
|
|
5136
|
+
"--output",
|
|
5137
|
+
destination,
|
|
5138
|
+
source.href
|
|
5139
|
+
];
|
|
5140
|
+
};
|
|
5117
5141
|
var download = async (url, destination, sha2562, maximumBytes = 512 * 1024 * 1024) => {
|
|
5118
|
-
const response = await fetch(url, { redirect: "follow", signal: AbortSignal.timeout(30 * 60000) });
|
|
5119
|
-
if (!response.ok)
|
|
5120
|
-
throw new Error(`download failed with HTTP ${response.status}`);
|
|
5121
|
-
const declared = Number(response.headers.get("content-length") ?? 0);
|
|
5122
|
-
if (declared > maximumBytes)
|
|
5123
|
-
throw new Error("download exceeds reviewed size bound");
|
|
5124
5142
|
if (existsSync2(destination))
|
|
5125
5143
|
throw new Error("download destination already exists");
|
|
5126
|
-
await
|
|
5144
|
+
const received = await run(softwareDownloadCommand(url, destination, maximumBytes));
|
|
5145
|
+
if (received.exitCode !== 0) {
|
|
5146
|
+
rmSync(destination, { force: true });
|
|
5147
|
+
throw new Error(`software download failed (${received.exitCode}): ${received.output.trim()}`);
|
|
5148
|
+
}
|
|
5127
5149
|
chmodSync2(destination, 384);
|
|
5128
5150
|
if (statSync(destination).size > maximumBytes) {
|
|
5129
5151
|
rmSync(destination, { force: true });
|
|
@@ -9193,7 +9215,7 @@ async function writeAndCloseProcessInput(input, value) {
|
|
|
9193
9215
|
}
|
|
9194
9216
|
|
|
9195
9217
|
// src/version.ts
|
|
9196
|
-
var VERSION2 = "0.1.
|
|
9218
|
+
var VERSION2 = "0.1.79";
|
|
9197
9219
|
|
|
9198
9220
|
// src/ssh-bootstrap.ts
|
|
9199
9221
|
class SshBootstrapError extends Error {
|
|
@@ -16401,16 +16423,21 @@ async function readBoundedStdin(maxBytes) {
|
|
|
16401
16423
|
}
|
|
16402
16424
|
if (process.stdin.isTTY)
|
|
16403
16425
|
throw new Error("stdin request pipe is required");
|
|
16404
|
-
const
|
|
16405
|
-
|
|
16406
|
-
|
|
16407
|
-
|
|
16408
|
-
|
|
16409
|
-
|
|
16410
|
-
|
|
16411
|
-
|
|
16412
|
-
|
|
16413
|
-
|
|
16426
|
+
const reader = Bun.spawn(["/usr/bin/head", "-c", String(maxBytes + 1)], {
|
|
16427
|
+
stdin: "inherit",
|
|
16428
|
+
stdout: "pipe",
|
|
16429
|
+
stderr: "pipe"
|
|
16430
|
+
});
|
|
16431
|
+
const [stdout, stderr, exitCode] = await Promise.all([
|
|
16432
|
+
new Response(reader.stdout).arrayBuffer(),
|
|
16433
|
+
new Response(reader.stderr).text(),
|
|
16434
|
+
reader.exited
|
|
16435
|
+
]);
|
|
16436
|
+
if (exitCode !== 0)
|
|
16437
|
+
throw new Error(`stdin reader failed (${exitCode}): ${stderr.trim()}`);
|
|
16438
|
+
if (stdout.byteLength > maxBytes)
|
|
16439
|
+
throw new Error(`stdin request exceeds ${maxBytes} bytes`);
|
|
16440
|
+
return Buffer.from(stdout).toString("utf8");
|
|
16414
16441
|
}
|
|
16415
16442
|
|
|
16416
16443
|
// src/index.ts
|
package/dist/fz.js
CHANGED
package/dist/metal-bootstrap.js
CHANGED
|
@@ -354,7 +354,7 @@ function systemdAgentEgressDirectives(loopbackTcpPorts = []) {
|
|
|
354
354
|
}
|
|
355
355
|
|
|
356
356
|
// src/version.ts
|
|
357
|
-
var VERSION = "0.1.
|
|
357
|
+
var VERSION = "0.1.79";
|
|
358
358
|
|
|
359
359
|
// src/otel-collector.ts
|
|
360
360
|
var FORGEZERO_OTEL_COLLECTOR_UNIT = "forgezero-otel-collector.service";
|
|
@@ -305,16 +305,38 @@ var runSoftwareCommand = async (argv, env = {}) => {
|
|
|
305
305
|
return { exitCode, output: `${stdout}${stderr}` };
|
|
306
306
|
};
|
|
307
307
|
var run = runSoftwareCommand;
|
|
308
|
+
var softwareDownloadCommand = (url, destination, maximumBytes) => {
|
|
309
|
+
const source = new URL(url);
|
|
310
|
+
if (source.protocol !== "https:" || source.username || source.password)
|
|
311
|
+
throw new Error("software download must use credential-free HTTPS");
|
|
312
|
+
if (!Number.isSafeInteger(maximumBytes) || maximumBytes < 1)
|
|
313
|
+
throw new Error("software download size bound is invalid");
|
|
314
|
+
return [
|
|
315
|
+
"/usr/bin/curl",
|
|
316
|
+
"--fail",
|
|
317
|
+
"--location",
|
|
318
|
+
"--silent",
|
|
319
|
+
"--show-error",
|
|
320
|
+
"--proto",
|
|
321
|
+
"=https",
|
|
322
|
+
"--tlsv1.2",
|
|
323
|
+
"--max-time",
|
|
324
|
+
"1800",
|
|
325
|
+
"--max-filesize",
|
|
326
|
+
String(maximumBytes),
|
|
327
|
+
"--output",
|
|
328
|
+
destination,
|
|
329
|
+
source.href
|
|
330
|
+
];
|
|
331
|
+
};
|
|
308
332
|
var download = async (url, destination, sha256, maximumBytes = 512 * 1024 * 1024) => {
|
|
309
|
-
const response = await fetch(url, { redirect: "follow", signal: AbortSignal.timeout(30 * 60000) });
|
|
310
|
-
if (!response.ok)
|
|
311
|
-
throw new Error(`download failed with HTTP ${response.status}`);
|
|
312
|
-
const declared = Number(response.headers.get("content-length") ?? 0);
|
|
313
|
-
if (declared > maximumBytes)
|
|
314
|
-
throw new Error("download exceeds reviewed size bound");
|
|
315
333
|
if (existsSync(destination))
|
|
316
334
|
throw new Error("download destination already exists");
|
|
317
|
-
await
|
|
335
|
+
const received = await run(softwareDownloadCommand(url, destination, maximumBytes));
|
|
336
|
+
if (received.exitCode !== 0) {
|
|
337
|
+
rmSync(destination, { force: true });
|
|
338
|
+
throw new Error(`software download failed (${received.exitCode}): ${received.output.trim()}`);
|
|
339
|
+
}
|
|
318
340
|
chmodSync(destination, 384);
|
|
319
341
|
if (statSync(destination).size > maximumBytes) {
|
|
320
342
|
rmSync(destination, { force: true });
|
package/dist/metal-provision.js
CHANGED
|
@@ -305,16 +305,38 @@ var runSoftwareCommand = async (argv, env = {}) => {
|
|
|
305
305
|
return { exitCode, output: `${stdout}${stderr}` };
|
|
306
306
|
};
|
|
307
307
|
var run = runSoftwareCommand;
|
|
308
|
+
var softwareDownloadCommand = (url, destination, maximumBytes) => {
|
|
309
|
+
const source = new URL(url);
|
|
310
|
+
if (source.protocol !== "https:" || source.username || source.password)
|
|
311
|
+
throw new Error("software download must use credential-free HTTPS");
|
|
312
|
+
if (!Number.isSafeInteger(maximumBytes) || maximumBytes < 1)
|
|
313
|
+
throw new Error("software download size bound is invalid");
|
|
314
|
+
return [
|
|
315
|
+
"/usr/bin/curl",
|
|
316
|
+
"--fail",
|
|
317
|
+
"--location",
|
|
318
|
+
"--silent",
|
|
319
|
+
"--show-error",
|
|
320
|
+
"--proto",
|
|
321
|
+
"=https",
|
|
322
|
+
"--tlsv1.2",
|
|
323
|
+
"--max-time",
|
|
324
|
+
"1800",
|
|
325
|
+
"--max-filesize",
|
|
326
|
+
String(maximumBytes),
|
|
327
|
+
"--output",
|
|
328
|
+
destination,
|
|
329
|
+
source.href
|
|
330
|
+
];
|
|
331
|
+
};
|
|
308
332
|
var download = async (url, destination, sha256, maximumBytes = 512 * 1024 * 1024) => {
|
|
309
|
-
const response = await fetch(url, { redirect: "follow", signal: AbortSignal.timeout(30 * 60000) });
|
|
310
|
-
if (!response.ok)
|
|
311
|
-
throw new Error(`download failed with HTTP ${response.status}`);
|
|
312
|
-
const declared = Number(response.headers.get("content-length") ?? 0);
|
|
313
|
-
if (declared > maximumBytes)
|
|
314
|
-
throw new Error("download exceeds reviewed size bound");
|
|
315
333
|
if (existsSync(destination))
|
|
316
334
|
throw new Error("download destination already exists");
|
|
317
|
-
await
|
|
335
|
+
const received = await run(softwareDownloadCommand(url, destination, maximumBytes));
|
|
336
|
+
if (received.exitCode !== 0) {
|
|
337
|
+
rmSync(destination, { force: true });
|
|
338
|
+
throw new Error(`software download failed (${received.exitCode}): ${received.output.trim()}`);
|
|
339
|
+
}
|
|
318
340
|
chmodSync(destination, 384);
|
|
319
341
|
if (statSync(destination).size > maximumBytes) {
|
|
320
342
|
rmSync(destination, { force: true });
|
|
@@ -165,16 +165,38 @@ var runSoftwareCommand = async (argv, env = {}) => {
|
|
|
165
165
|
return { exitCode, output: `${stdout}${stderr}` };
|
|
166
166
|
};
|
|
167
167
|
var run = runSoftwareCommand;
|
|
168
|
+
var softwareDownloadCommand = (url, destination, maximumBytes) => {
|
|
169
|
+
const source = new URL(url);
|
|
170
|
+
if (source.protocol !== "https:" || source.username || source.password)
|
|
171
|
+
throw new Error("software download must use credential-free HTTPS");
|
|
172
|
+
if (!Number.isSafeInteger(maximumBytes) || maximumBytes < 1)
|
|
173
|
+
throw new Error("software download size bound is invalid");
|
|
174
|
+
return [
|
|
175
|
+
"/usr/bin/curl",
|
|
176
|
+
"--fail",
|
|
177
|
+
"--location",
|
|
178
|
+
"--silent",
|
|
179
|
+
"--show-error",
|
|
180
|
+
"--proto",
|
|
181
|
+
"=https",
|
|
182
|
+
"--tlsv1.2",
|
|
183
|
+
"--max-time",
|
|
184
|
+
"1800",
|
|
185
|
+
"--max-filesize",
|
|
186
|
+
String(maximumBytes),
|
|
187
|
+
"--output",
|
|
188
|
+
destination,
|
|
189
|
+
source.href
|
|
190
|
+
];
|
|
191
|
+
};
|
|
168
192
|
var download = async (url, destination, sha256, maximumBytes = 512 * 1024 * 1024) => {
|
|
169
|
-
const response = await fetch(url, { redirect: "follow", signal: AbortSignal.timeout(30 * 60000) });
|
|
170
|
-
if (!response.ok)
|
|
171
|
-
throw new Error(`download failed with HTTP ${response.status}`);
|
|
172
|
-
const declared = Number(response.headers.get("content-length") ?? 0);
|
|
173
|
-
if (declared > maximumBytes)
|
|
174
|
-
throw new Error("download exceeds reviewed size bound");
|
|
175
193
|
if (existsSync(destination))
|
|
176
194
|
throw new Error("download destination already exists");
|
|
177
|
-
await
|
|
195
|
+
const received = await run(softwareDownloadCommand(url, destination, maximumBytes));
|
|
196
|
+
if (received.exitCode !== 0) {
|
|
197
|
+
rmSync(destination, { force: true });
|
|
198
|
+
throw new Error(`software download failed (${received.exitCode}): ${received.output.trim()}`);
|
|
199
|
+
}
|
|
178
200
|
chmodSync(destination, 384);
|
|
179
201
|
if (statSync(destination).size > maximumBytes) {
|
|
180
202
|
rmSync(destination, { force: true });
|
|
@@ -843,16 +843,38 @@ var runSoftwareCommand = async (argv, env = {}) => {
|
|
|
843
843
|
return { exitCode, output: `${stdout}${stderr}` };
|
|
844
844
|
};
|
|
845
845
|
var run = runSoftwareCommand;
|
|
846
|
+
var softwareDownloadCommand = (url, destination, maximumBytes) => {
|
|
847
|
+
const source = new URL(url);
|
|
848
|
+
if (source.protocol !== "https:" || source.username || source.password)
|
|
849
|
+
throw new Error("software download must use credential-free HTTPS");
|
|
850
|
+
if (!Number.isSafeInteger(maximumBytes) || maximumBytes < 1)
|
|
851
|
+
throw new Error("software download size bound is invalid");
|
|
852
|
+
return [
|
|
853
|
+
"/usr/bin/curl",
|
|
854
|
+
"--fail",
|
|
855
|
+
"--location",
|
|
856
|
+
"--silent",
|
|
857
|
+
"--show-error",
|
|
858
|
+
"--proto",
|
|
859
|
+
"=https",
|
|
860
|
+
"--tlsv1.2",
|
|
861
|
+
"--max-time",
|
|
862
|
+
"1800",
|
|
863
|
+
"--max-filesize",
|
|
864
|
+
String(maximumBytes),
|
|
865
|
+
"--output",
|
|
866
|
+
destination,
|
|
867
|
+
source.href
|
|
868
|
+
];
|
|
869
|
+
};
|
|
846
870
|
var download = async (url, destination, sha256, maximumBytes = 512 * 1024 * 1024) => {
|
|
847
|
-
const response = await fetch(url, { redirect: "follow", signal: AbortSignal.timeout(30 * 60000) });
|
|
848
|
-
if (!response.ok)
|
|
849
|
-
throw new Error(`download failed with HTTP ${response.status}`);
|
|
850
|
-
const declared = Number(response.headers.get("content-length") ?? 0);
|
|
851
|
-
if (declared > maximumBytes)
|
|
852
|
-
throw new Error("download exceeds reviewed size bound");
|
|
853
871
|
if (existsSync3(destination))
|
|
854
872
|
throw new Error("download destination already exists");
|
|
855
|
-
await
|
|
873
|
+
const received = await run(softwareDownloadCommand(url, destination, maximumBytes));
|
|
874
|
+
if (received.exitCode !== 0) {
|
|
875
|
+
rmSync3(destination, { force: true });
|
|
876
|
+
throw new Error(`software download failed (${received.exitCode}): ${received.output.trim()}`);
|
|
877
|
+
}
|
|
856
878
|
chmodSync3(destination, 384);
|
|
857
879
|
if (statSync(destination).size > maximumBytes) {
|
|
858
880
|
rmSync3(destination, { force: true });
|
|
@@ -2498,7 +2520,7 @@ function requestSoftware(requirements, socketPath = DEFAULT_SOFTWARE_HELPER_SOCK
|
|
|
2498
2520
|
}
|
|
2499
2521
|
|
|
2500
2522
|
// src/version.ts
|
|
2501
|
-
var VERSION3 = "0.1.
|
|
2523
|
+
var VERSION3 = "0.1.79";
|
|
2502
2524
|
|
|
2503
2525
|
// src/egress-policy.ts
|
|
2504
2526
|
import { realpathSync as realpathSync3 } from "node:fs";
|
package/dist/platform-genesis.js
CHANGED
|
@@ -165,16 +165,38 @@ var runSoftwareCommand = async (argv, env = {}) => {
|
|
|
165
165
|
return { exitCode, output: `${stdout}${stderr}` };
|
|
166
166
|
};
|
|
167
167
|
var run = runSoftwareCommand;
|
|
168
|
+
var softwareDownloadCommand = (url, destination, maximumBytes) => {
|
|
169
|
+
const source = new URL(url);
|
|
170
|
+
if (source.protocol !== "https:" || source.username || source.password)
|
|
171
|
+
throw new Error("software download must use credential-free HTTPS");
|
|
172
|
+
if (!Number.isSafeInteger(maximumBytes) || maximumBytes < 1)
|
|
173
|
+
throw new Error("software download size bound is invalid");
|
|
174
|
+
return [
|
|
175
|
+
"/usr/bin/curl",
|
|
176
|
+
"--fail",
|
|
177
|
+
"--location",
|
|
178
|
+
"--silent",
|
|
179
|
+
"--show-error",
|
|
180
|
+
"--proto",
|
|
181
|
+
"=https",
|
|
182
|
+
"--tlsv1.2",
|
|
183
|
+
"--max-time",
|
|
184
|
+
"1800",
|
|
185
|
+
"--max-filesize",
|
|
186
|
+
String(maximumBytes),
|
|
187
|
+
"--output",
|
|
188
|
+
destination,
|
|
189
|
+
source.href
|
|
190
|
+
];
|
|
191
|
+
};
|
|
168
192
|
var download = async (url, destination, sha256, maximumBytes = 512 * 1024 * 1024) => {
|
|
169
|
-
const response = await fetch(url, { redirect: "follow", signal: AbortSignal.timeout(30 * 60000) });
|
|
170
|
-
if (!response.ok)
|
|
171
|
-
throw new Error(`download failed with HTTP ${response.status}`);
|
|
172
|
-
const declared = Number(response.headers.get("content-length") ?? 0);
|
|
173
|
-
if (declared > maximumBytes)
|
|
174
|
-
throw new Error("download exceeds reviewed size bound");
|
|
175
193
|
if (existsSync(destination))
|
|
176
194
|
throw new Error("download destination already exists");
|
|
177
|
-
await
|
|
195
|
+
const received = await run(softwareDownloadCommand(url, destination, maximumBytes));
|
|
196
|
+
if (received.exitCode !== 0) {
|
|
197
|
+
rmSync(destination, { force: true });
|
|
198
|
+
throw new Error(`software download failed (${received.exitCode}): ${received.output.trim()}`);
|
|
199
|
+
}
|
|
178
200
|
chmodSync(destination, 384);
|
|
179
201
|
if (statSync(destination).size > maximumBytes) {
|
|
180
202
|
rmSync(destination, { force: true });
|
package/dist/provision.js
CHANGED
|
@@ -843,16 +843,38 @@ var runSoftwareCommand = async (argv, env = {}) => {
|
|
|
843
843
|
return { exitCode, output: `${stdout}${stderr}` };
|
|
844
844
|
};
|
|
845
845
|
var run = runSoftwareCommand;
|
|
846
|
+
var softwareDownloadCommand = (url, destination, maximumBytes) => {
|
|
847
|
+
const source = new URL(url);
|
|
848
|
+
if (source.protocol !== "https:" || source.username || source.password)
|
|
849
|
+
throw new Error("software download must use credential-free HTTPS");
|
|
850
|
+
if (!Number.isSafeInteger(maximumBytes) || maximumBytes < 1)
|
|
851
|
+
throw new Error("software download size bound is invalid");
|
|
852
|
+
return [
|
|
853
|
+
"/usr/bin/curl",
|
|
854
|
+
"--fail",
|
|
855
|
+
"--location",
|
|
856
|
+
"--silent",
|
|
857
|
+
"--show-error",
|
|
858
|
+
"--proto",
|
|
859
|
+
"=https",
|
|
860
|
+
"--tlsv1.2",
|
|
861
|
+
"--max-time",
|
|
862
|
+
"1800",
|
|
863
|
+
"--max-filesize",
|
|
864
|
+
String(maximumBytes),
|
|
865
|
+
"--output",
|
|
866
|
+
destination,
|
|
867
|
+
source.href
|
|
868
|
+
];
|
|
869
|
+
};
|
|
846
870
|
var download = async (url, destination, sha256, maximumBytes = 512 * 1024 * 1024) => {
|
|
847
|
-
const response = await fetch(url, { redirect: "follow", signal: AbortSignal.timeout(30 * 60000) });
|
|
848
|
-
if (!response.ok)
|
|
849
|
-
throw new Error(`download failed with HTTP ${response.status}`);
|
|
850
|
-
const declared = Number(response.headers.get("content-length") ?? 0);
|
|
851
|
-
if (declared > maximumBytes)
|
|
852
|
-
throw new Error("download exceeds reviewed size bound");
|
|
853
871
|
if (existsSync3(destination))
|
|
854
872
|
throw new Error("download destination already exists");
|
|
855
|
-
await
|
|
873
|
+
const received = await run(softwareDownloadCommand(url, destination, maximumBytes));
|
|
874
|
+
if (received.exitCode !== 0) {
|
|
875
|
+
rmSync3(destination, { force: true });
|
|
876
|
+
throw new Error(`software download failed (${received.exitCode}): ${received.output.trim()}`);
|
|
877
|
+
}
|
|
856
878
|
chmodSync3(destination, 384);
|
|
857
879
|
if (statSync(destination).size > maximumBytes) {
|
|
858
880
|
rmSync3(destination, { force: true });
|
|
@@ -2498,7 +2520,7 @@ function requestSoftware(requirements, socketPath = DEFAULT_SOFTWARE_HELPER_SOCK
|
|
|
2498
2520
|
}
|
|
2499
2521
|
|
|
2500
2522
|
// src/version.ts
|
|
2501
|
-
var VERSION3 = "0.1.
|
|
2523
|
+
var VERSION3 = "0.1.79";
|
|
2502
2524
|
|
|
2503
2525
|
// src/egress-policy.ts
|
|
2504
2526
|
import { realpathSync as realpathSync3 } from "node:fs";
|
package/dist/software-helper.js
CHANGED
|
@@ -165,16 +165,38 @@ var runSoftwareCommand = async (argv, env = {}) => {
|
|
|
165
165
|
return { exitCode, output: `${stdout}${stderr}` };
|
|
166
166
|
};
|
|
167
167
|
var run = runSoftwareCommand;
|
|
168
|
+
var softwareDownloadCommand = (url, destination, maximumBytes) => {
|
|
169
|
+
const source = new URL(url);
|
|
170
|
+
if (source.protocol !== "https:" || source.username || source.password)
|
|
171
|
+
throw new Error("software download must use credential-free HTTPS");
|
|
172
|
+
if (!Number.isSafeInteger(maximumBytes) || maximumBytes < 1)
|
|
173
|
+
throw new Error("software download size bound is invalid");
|
|
174
|
+
return [
|
|
175
|
+
"/usr/bin/curl",
|
|
176
|
+
"--fail",
|
|
177
|
+
"--location",
|
|
178
|
+
"--silent",
|
|
179
|
+
"--show-error",
|
|
180
|
+
"--proto",
|
|
181
|
+
"=https",
|
|
182
|
+
"--tlsv1.2",
|
|
183
|
+
"--max-time",
|
|
184
|
+
"1800",
|
|
185
|
+
"--max-filesize",
|
|
186
|
+
String(maximumBytes),
|
|
187
|
+
"--output",
|
|
188
|
+
destination,
|
|
189
|
+
source.href
|
|
190
|
+
];
|
|
191
|
+
};
|
|
168
192
|
var download = async (url, destination, sha256, maximumBytes = 512 * 1024 * 1024) => {
|
|
169
|
-
const response = await fetch(url, { redirect: "follow", signal: AbortSignal.timeout(30 * 60000) });
|
|
170
|
-
if (!response.ok)
|
|
171
|
-
throw new Error(`download failed with HTTP ${response.status}`);
|
|
172
|
-
const declared = Number(response.headers.get("content-length") ?? 0);
|
|
173
|
-
if (declared > maximumBytes)
|
|
174
|
-
throw new Error("download exceeds reviewed size bound");
|
|
175
193
|
if (existsSync(destination))
|
|
176
194
|
throw new Error("download destination already exists");
|
|
177
|
-
await
|
|
195
|
+
const received = await run(softwareDownloadCommand(url, destination, maximumBytes));
|
|
196
|
+
if (received.exitCode !== 0) {
|
|
197
|
+
rmSync(destination, { force: true });
|
|
198
|
+
throw new Error(`software download failed (${received.exitCode}): ${received.output.trim()}`);
|
|
199
|
+
}
|
|
178
200
|
chmodSync(destination, 384);
|
|
179
201
|
if (statSync(destination).size > maximumBytes) {
|
|
180
202
|
rmSync(destination, { force: true });
|
package/dist/software.d.ts
CHANGED
|
@@ -57,6 +57,7 @@ export declare const OS_CATALOG: readonly OsCatalogEntry[];
|
|
|
57
57
|
export declare const SOFTWARE_CATALOG: readonly SoftwareCatalogEntry[];
|
|
58
58
|
export declare const softwareSpawnFailure: (cause: unknown, argv: readonly string[]) => SoftwareCommandResult | undefined;
|
|
59
59
|
export declare const runSoftwareCommand: (argv: readonly string[], env?: Record<string, string>) => Promise<SoftwareCommandResult>;
|
|
60
|
+
export declare const softwareDownloadCommand: (url: string, destination: string, maximumBytes: number) => readonly string[];
|
|
60
61
|
/** Closed, fixed-argv privileged strategy executor. No repository value becomes a command. */
|
|
61
62
|
export declare function executeSoftwareOperation(operation: SoftwareOperation): Promise<SoftwareCommandResult>;
|
|
62
63
|
export declare function observeSoftwareHost(osRelease?: string, architecture?: NodeJS.Architecture): SoftwareObservation;
|
package/dist/software.js
CHANGED
|
@@ -165,16 +165,38 @@ var runSoftwareCommand = async (argv, env = {}) => {
|
|
|
165
165
|
return { exitCode, output: `${stdout}${stderr}` };
|
|
166
166
|
};
|
|
167
167
|
var run = runSoftwareCommand;
|
|
168
|
+
var softwareDownloadCommand = (url, destination, maximumBytes) => {
|
|
169
|
+
const source = new URL(url);
|
|
170
|
+
if (source.protocol !== "https:" || source.username || source.password)
|
|
171
|
+
throw new Error("software download must use credential-free HTTPS");
|
|
172
|
+
if (!Number.isSafeInteger(maximumBytes) || maximumBytes < 1)
|
|
173
|
+
throw new Error("software download size bound is invalid");
|
|
174
|
+
return [
|
|
175
|
+
"/usr/bin/curl",
|
|
176
|
+
"--fail",
|
|
177
|
+
"--location",
|
|
178
|
+
"--silent",
|
|
179
|
+
"--show-error",
|
|
180
|
+
"--proto",
|
|
181
|
+
"=https",
|
|
182
|
+
"--tlsv1.2",
|
|
183
|
+
"--max-time",
|
|
184
|
+
"1800",
|
|
185
|
+
"--max-filesize",
|
|
186
|
+
String(maximumBytes),
|
|
187
|
+
"--output",
|
|
188
|
+
destination,
|
|
189
|
+
source.href
|
|
190
|
+
];
|
|
191
|
+
};
|
|
168
192
|
var download = async (url, destination, sha256, maximumBytes = 512 * 1024 * 1024) => {
|
|
169
|
-
const response = await fetch(url, { redirect: "follow", signal: AbortSignal.timeout(30 * 60000) });
|
|
170
|
-
if (!response.ok)
|
|
171
|
-
throw new Error(`download failed with HTTP ${response.status}`);
|
|
172
|
-
const declared = Number(response.headers.get("content-length") ?? 0);
|
|
173
|
-
if (declared > maximumBytes)
|
|
174
|
-
throw new Error("download exceeds reviewed size bound");
|
|
175
193
|
if (existsSync(destination))
|
|
176
194
|
throw new Error("download destination already exists");
|
|
177
|
-
await
|
|
195
|
+
const received = await run(softwareDownloadCommand(url, destination, maximumBytes));
|
|
196
|
+
if (received.exitCode !== 0) {
|
|
197
|
+
rmSync(destination, { force: true });
|
|
198
|
+
throw new Error(`software download failed (${received.exitCode}): ${received.output.trim()}`);
|
|
199
|
+
}
|
|
178
200
|
chmodSync(destination, 384);
|
|
179
201
|
if (statSync(destination).size > maximumBytes) {
|
|
180
202
|
rmSync(destination, { force: true });
|
|
@@ -518,6 +540,7 @@ async function ensureSoftwareRequirements(requirementsInput, options) {
|
|
|
518
540
|
export {
|
|
519
541
|
validateSoftwareRequirements,
|
|
520
542
|
softwareSpawnFailure,
|
|
543
|
+
softwareDownloadCommand,
|
|
521
544
|
runSoftwareCommand,
|
|
522
545
|
observeSoftwareHost,
|
|
523
546
|
executeSoftwareOperation,
|
package/dist/stdin.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Read one bounded request from stdin without using a synchronous `/dev/stdin`
|
|
3
|
-
* read. Bun can busy-loop
|
|
4
|
-
*
|
|
3
|
+
* read. Bun can busy-loop while reading fd 0 from an SSH channel, both through
|
|
4
|
+
* synchronous fs calls and its JavaScript stream adapters. A fixed native
|
|
5
|
+
* `head` process owns that descriptor and returns at most limit + 1 bytes, so
|
|
6
|
+
* Bun handles only an already-bounded child stdout stream.
|
|
5
7
|
*/
|
|
6
8
|
export declare function readBoundedStdin(maxBytes: number): Promise<string>;
|
package/dist/ubuntu.js
CHANGED
|
@@ -165,16 +165,38 @@ var runSoftwareCommand = async (argv, env = {}) => {
|
|
|
165
165
|
return { exitCode, output: `${stdout}${stderr}` };
|
|
166
166
|
};
|
|
167
167
|
var run = runSoftwareCommand;
|
|
168
|
+
var softwareDownloadCommand = (url, destination, maximumBytes) => {
|
|
169
|
+
const source = new URL(url);
|
|
170
|
+
if (source.protocol !== "https:" || source.username || source.password)
|
|
171
|
+
throw new Error("software download must use credential-free HTTPS");
|
|
172
|
+
if (!Number.isSafeInteger(maximumBytes) || maximumBytes < 1)
|
|
173
|
+
throw new Error("software download size bound is invalid");
|
|
174
|
+
return [
|
|
175
|
+
"/usr/bin/curl",
|
|
176
|
+
"--fail",
|
|
177
|
+
"--location",
|
|
178
|
+
"--silent",
|
|
179
|
+
"--show-error",
|
|
180
|
+
"--proto",
|
|
181
|
+
"=https",
|
|
182
|
+
"--tlsv1.2",
|
|
183
|
+
"--max-time",
|
|
184
|
+
"1800",
|
|
185
|
+
"--max-filesize",
|
|
186
|
+
String(maximumBytes),
|
|
187
|
+
"--output",
|
|
188
|
+
destination,
|
|
189
|
+
source.href
|
|
190
|
+
];
|
|
191
|
+
};
|
|
168
192
|
var download = async (url, destination, sha256, maximumBytes = 512 * 1024 * 1024) => {
|
|
169
|
-
const response = await fetch(url, { redirect: "follow", signal: AbortSignal.timeout(30 * 60000) });
|
|
170
|
-
if (!response.ok)
|
|
171
|
-
throw new Error(`download failed with HTTP ${response.status}`);
|
|
172
|
-
const declared = Number(response.headers.get("content-length") ?? 0);
|
|
173
|
-
if (declared > maximumBytes)
|
|
174
|
-
throw new Error("download exceeds reviewed size bound");
|
|
175
193
|
if (existsSync(destination))
|
|
176
194
|
throw new Error("download destination already exists");
|
|
177
|
-
await
|
|
195
|
+
const received = await run(softwareDownloadCommand(url, destination, maximumBytes));
|
|
196
|
+
if (received.exitCode !== 0) {
|
|
197
|
+
rmSync(destination, { force: true });
|
|
198
|
+
throw new Error(`software download failed (${received.exitCode}): ${received.output.trim()}`);
|
|
199
|
+
}
|
|
178
200
|
chmodSync(destination, 384);
|
|
179
201
|
if (statSync(destination).size > maximumBytes) {
|
|
180
202
|
rmSync(destination, { force: true });
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** One package version shared by both public binaries. Pinned to package.json by tests. */
|
|
2
|
-
export declare const VERSION = "0.1.
|
|
2
|
+
export declare const VERSION = "0.1.79";
|