@camstack/system 1.2.356 → 1.2.357
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/builtins/local-network/local-network.addon.d.ts +7 -0
- package/dist/builtins/local-network/local-network.addon.js +42 -23
- package/dist/builtins/local-network/local-network.addon.mjs +42 -23
- package/dist/index.js +20 -9
- package/dist/index.mjs +9 -10
- package/dist/kernel/config-schema.d.ts +0 -2
- package/dist/tls/boot-tls.d.ts +29 -0
- package/dist/tls/https-listener.d.ts +30 -0
- package/dist/tls/index.d.ts +4 -1
- package/dist/tls/tls-actions.d.ts +29 -0
- package/dist/tls/tls-status.d.ts +12 -1
- package/dist/{tls-ue_Xefmv.js → tls-CCMX7MjX.js} +319 -54
- package/dist/{tls-DTlVWwAI.mjs → tls-CJHogwTl.mjs} +246 -53
- package/package.json +1 -1
|
@@ -120,6 +120,13 @@ export declare class LocalNetworkAddon extends BaseAddon<LocalNetworkConfig> {
|
|
|
120
120
|
private resolvedHttpPort;
|
|
121
121
|
private tlsDataDir;
|
|
122
122
|
private snapshotTls;
|
|
123
|
+
/**
|
|
124
|
+
* Hot-swap the HTTPS listener onto the pair now on disk. A failure is not
|
|
125
|
+
* thrown — the files are already written and the status reports
|
|
126
|
+
* `restartRequired` from the served-vs-disk fingerprints — but it is logged:
|
|
127
|
+
* a certificate change that did not reach the listener must say so.
|
|
128
|
+
*/
|
|
129
|
+
private putCertificateOnListener;
|
|
123
130
|
/**
|
|
124
131
|
* Bind or unbind the LAN HTTP sibling from the addon's own settings, and
|
|
125
132
|
* keep the leaf SAN in sync with `localHostname`. This is the settings
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
3
3
|
const require_dist = require("../../dist-CFVOy8VT.js");
|
|
4
|
-
const require_tls = require("../../tls-
|
|
5
|
-
let node_fs_promises = require("node:fs/promises");
|
|
6
|
-
let node_path = require("node:path");
|
|
4
|
+
const require_tls = require("../../tls-CCMX7MjX.js");
|
|
7
5
|
let node_os = require("node:os");
|
|
8
6
|
node_os = require_chunk.__toESM(node_os);
|
|
9
7
|
let node_fs = require("node:fs");
|
|
@@ -326,32 +324,30 @@ var LocalNetworkAddon = class extends require_dist.BaseAddon {
|
|
|
326
324
|
} });
|
|
327
325
|
return { success: true };
|
|
328
326
|
},
|
|
329
|
-
getTlsStatus: async () => this.snapshotTls(
|
|
327
|
+
getTlsStatus: async () => this.snapshotTls(),
|
|
330
328
|
regenerateCertificate: async (_input) => {
|
|
331
|
-
if (require_tls.readTlsMode(this.tlsDataDir()) === "uploaded") throw new Error("Cannot regenerate an uploaded certificate — revert to generated first.");
|
|
332
329
|
const extraSans = [...require_tls.readExtraSans(this.tlsDataDir())];
|
|
333
|
-
await require_tls.
|
|
334
|
-
|
|
330
|
+
await require_tls.regenerateCertificate(this.tlsDataDir(), { extraSans });
|
|
331
|
+
this.putCertificateOnListener("regenerate");
|
|
332
|
+
return this.snapshotTls();
|
|
335
333
|
},
|
|
336
334
|
uploadCertificate: async ({ certPem, keyPem, caPem }) => {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
require_tls.writeTlsMode(this.tlsDataDir(), "uploaded");
|
|
345
|
-
return this.snapshotTls(true);
|
|
335
|
+
await require_tls.storeUploadedCertificate(this.tlsDataDir(), {
|
|
336
|
+
certPem,
|
|
337
|
+
keyPem,
|
|
338
|
+
caPem
|
|
339
|
+
});
|
|
340
|
+
this.putCertificateOnListener("upload");
|
|
341
|
+
return this.snapshotTls();
|
|
346
342
|
},
|
|
347
343
|
downloadCa: async () => {
|
|
348
|
-
return { pem: this.snapshotTls(
|
|
344
|
+
return { pem: this.snapshotTls().caCertPem ?? "" };
|
|
349
345
|
},
|
|
350
346
|
revertToGeneratedCertificate: async () => {
|
|
351
|
-
require_tls.writeTlsMode(this.tlsDataDir(), "generated");
|
|
352
347
|
const extraSans = [...require_tls.readExtraSans(this.tlsDataDir())];
|
|
353
|
-
await require_tls.
|
|
354
|
-
|
|
348
|
+
await require_tls.revertToGeneratedCertificate(this.tlsDataDir(), { extraSans });
|
|
349
|
+
this.putCertificateOnListener("revert");
|
|
350
|
+
return this.snapshotTls();
|
|
355
351
|
}
|
|
356
352
|
};
|
|
357
353
|
this.lastSnapshotKey = snapshotKey(this.enumerate());
|
|
@@ -510,14 +506,35 @@ var LocalNetworkAddon = class extends require_dist.BaseAddon {
|
|
|
510
506
|
tlsDataDir() {
|
|
511
507
|
return this.ctx.nodeDataDir ?? this.ctx.dataDir;
|
|
512
508
|
}
|
|
513
|
-
snapshotTls(
|
|
514
|
-
const status = require_tls.readTlsAccessStatus(this.tlsDataDir(),
|
|
509
|
+
snapshotTls() {
|
|
510
|
+
const status = require_tls.readTlsAccessStatus(this.tlsDataDir(), require_tls.servedHttpsLeafFingerprint());
|
|
515
511
|
return {
|
|
516
512
|
...status,
|
|
517
513
|
sans: [...status.sans]
|
|
518
514
|
};
|
|
519
515
|
}
|
|
520
516
|
/**
|
|
517
|
+
* Hot-swap the HTTPS listener onto the pair now on disk. A failure is not
|
|
518
|
+
* thrown — the files are already written and the status reports
|
|
519
|
+
* `restartRequired` from the served-vs-disk fingerprints — but it is logged:
|
|
520
|
+
* a certificate change that did not reach the listener must say so.
|
|
521
|
+
*/
|
|
522
|
+
putCertificateOnListener(action) {
|
|
523
|
+
const outcome = require_tls.applyCertificateToListener(this.tlsDataDir());
|
|
524
|
+
if (outcome.kind === "reloaded") {
|
|
525
|
+
this.ctx.logger.info("local-network: HTTPS listener now serves the new certificate", { meta: {
|
|
526
|
+
action,
|
|
527
|
+
leafFingerprintSha256: outcome.servedLeafFingerprint
|
|
528
|
+
} });
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
this.ctx.logger.warn("local-network: certificate changed on disk but NOT on the listener", { meta: {
|
|
532
|
+
action,
|
|
533
|
+
reason: outcome.kind,
|
|
534
|
+
...outcome.kind === "failed" ? { error: outcome.error } : {}
|
|
535
|
+
} });
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
521
538
|
* Bind or unbind the LAN HTTP sibling from the addon's own settings, and
|
|
522
539
|
* keep the leaf SAN in sync with `localHostname`. This is the settings
|
|
523
540
|
* side-effect path — there is no second persist API.
|
|
@@ -536,7 +553,9 @@ var LocalNetworkAddon = class extends require_dist.BaseAddon {
|
|
|
536
553
|
});
|
|
537
554
|
if (hostname !== "") {
|
|
538
555
|
require_tls.writeExtraSans(this.tlsDataDir(), [hostname]);
|
|
539
|
-
if (require_tls.readTlsMode(this.tlsDataDir()) === "generated")
|
|
556
|
+
if (require_tls.readTlsMode(this.tlsDataDir()) === "generated") {
|
|
557
|
+
if ((await require_tls.ensureTlsCert(this.tlsDataDir(), { extraSans: [hostname] })).generated) this.putCertificateOnListener("hostname");
|
|
558
|
+
}
|
|
540
559
|
} else require_tls.writeExtraSans(this.tlsDataDir(), []);
|
|
541
560
|
}
|
|
542
561
|
/**
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Cr as EventCategory, Qn as BaseAddon, Ut as localNetworkCapability, an as pickAppLinkHub, s as CAMSTACK_APP_LINK_ORIGIN } from "../../dist-B7WRgEZY.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { mkdir, writeFile } from "node:fs/promises";
|
|
4
|
-
import { join } from "node:path";
|
|
2
|
+
import { P as readLanHttpState, _ as writeExtraSans, h as readTlsMode, i as storeUploadedCertificate, j as applyLanHttp, k as DEFAULT_LAN_HTTP_PORT, m as readTlsAccessStatus, n as regenerateCertificate, p as readExtraSans, r as revertToGeneratedCertificate, t as applyCertificateToListener, u as servedHttpsLeafFingerprint, y as ensureTlsCert } from "../../tls-CJHogwTl.mjs";
|
|
5
3
|
import * as os from "node:os";
|
|
6
4
|
import { readFileSync } from "node:fs";
|
|
7
5
|
import { isIP } from "node:net";
|
|
@@ -323,32 +321,30 @@ var LocalNetworkAddon = class extends BaseAddon {
|
|
|
323
321
|
} });
|
|
324
322
|
return { success: true };
|
|
325
323
|
},
|
|
326
|
-
getTlsStatus: async () => this.snapshotTls(
|
|
324
|
+
getTlsStatus: async () => this.snapshotTls(),
|
|
327
325
|
regenerateCertificate: async (_input) => {
|
|
328
|
-
if (readTlsMode(this.tlsDataDir()) === "uploaded") throw new Error("Cannot regenerate an uploaded certificate — revert to generated first.");
|
|
329
326
|
const extraSans = [...readExtraSans(this.tlsDataDir())];
|
|
330
|
-
await
|
|
331
|
-
|
|
327
|
+
await regenerateCertificate(this.tlsDataDir(), { extraSans });
|
|
328
|
+
this.putCertificateOnListener("regenerate");
|
|
329
|
+
return this.snapshotTls();
|
|
332
330
|
},
|
|
333
331
|
uploadCertificate: async ({ certPem, keyPem, caPem }) => {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
writeTlsMode(this.tlsDataDir(), "uploaded");
|
|
342
|
-
return this.snapshotTls(true);
|
|
332
|
+
await storeUploadedCertificate(this.tlsDataDir(), {
|
|
333
|
+
certPem,
|
|
334
|
+
keyPem,
|
|
335
|
+
caPem
|
|
336
|
+
});
|
|
337
|
+
this.putCertificateOnListener("upload");
|
|
338
|
+
return this.snapshotTls();
|
|
343
339
|
},
|
|
344
340
|
downloadCa: async () => {
|
|
345
|
-
return { pem: this.snapshotTls(
|
|
341
|
+
return { pem: this.snapshotTls().caCertPem ?? "" };
|
|
346
342
|
},
|
|
347
343
|
revertToGeneratedCertificate: async () => {
|
|
348
|
-
writeTlsMode(this.tlsDataDir(), "generated");
|
|
349
344
|
const extraSans = [...readExtraSans(this.tlsDataDir())];
|
|
350
|
-
await
|
|
351
|
-
|
|
345
|
+
await revertToGeneratedCertificate(this.tlsDataDir(), { extraSans });
|
|
346
|
+
this.putCertificateOnListener("revert");
|
|
347
|
+
return this.snapshotTls();
|
|
352
348
|
}
|
|
353
349
|
};
|
|
354
350
|
this.lastSnapshotKey = snapshotKey(this.enumerate());
|
|
@@ -507,14 +503,35 @@ var LocalNetworkAddon = class extends BaseAddon {
|
|
|
507
503
|
tlsDataDir() {
|
|
508
504
|
return this.ctx.nodeDataDir ?? this.ctx.dataDir;
|
|
509
505
|
}
|
|
510
|
-
snapshotTls(
|
|
511
|
-
const status = readTlsAccessStatus(this.tlsDataDir(),
|
|
506
|
+
snapshotTls() {
|
|
507
|
+
const status = readTlsAccessStatus(this.tlsDataDir(), servedHttpsLeafFingerprint());
|
|
512
508
|
return {
|
|
513
509
|
...status,
|
|
514
510
|
sans: [...status.sans]
|
|
515
511
|
};
|
|
516
512
|
}
|
|
517
513
|
/**
|
|
514
|
+
* Hot-swap the HTTPS listener onto the pair now on disk. A failure is not
|
|
515
|
+
* thrown — the files are already written and the status reports
|
|
516
|
+
* `restartRequired` from the served-vs-disk fingerprints — but it is logged:
|
|
517
|
+
* a certificate change that did not reach the listener must say so.
|
|
518
|
+
*/
|
|
519
|
+
putCertificateOnListener(action) {
|
|
520
|
+
const outcome = applyCertificateToListener(this.tlsDataDir());
|
|
521
|
+
if (outcome.kind === "reloaded") {
|
|
522
|
+
this.ctx.logger.info("local-network: HTTPS listener now serves the new certificate", { meta: {
|
|
523
|
+
action,
|
|
524
|
+
leafFingerprintSha256: outcome.servedLeafFingerprint
|
|
525
|
+
} });
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
this.ctx.logger.warn("local-network: certificate changed on disk but NOT on the listener", { meta: {
|
|
529
|
+
action,
|
|
530
|
+
reason: outcome.kind,
|
|
531
|
+
...outcome.kind === "failed" ? { error: outcome.error } : {}
|
|
532
|
+
} });
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
518
535
|
* Bind or unbind the LAN HTTP sibling from the addon's own settings, and
|
|
519
536
|
* keep the leaf SAN in sync with `localHostname`. This is the settings
|
|
520
537
|
* side-effect path — there is no second persist API.
|
|
@@ -533,7 +550,9 @@ var LocalNetworkAddon = class extends BaseAddon {
|
|
|
533
550
|
});
|
|
534
551
|
if (hostname !== "") {
|
|
535
552
|
writeExtraSans(this.tlsDataDir(), [hostname]);
|
|
536
|
-
if (readTlsMode(this.tlsDataDir()) === "generated")
|
|
553
|
+
if (readTlsMode(this.tlsDataDir()) === "generated") {
|
|
554
|
+
if ((await ensureTlsCert(this.tlsDataDir(), { extraSans: [hostname] })).generated) this.putCertificateOnListener("hostname");
|
|
555
|
+
}
|
|
537
556
|
} else writeExtraSans(this.tlsDataDir(), []);
|
|
538
557
|
}
|
|
539
558
|
/**
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ const require_builtins_system_config_system_config_addon = require("./builtins/s
|
|
|
30
30
|
require("./builtins/system-config/index.js");
|
|
31
31
|
const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
|
|
32
32
|
const require_event_loop_stall_monitor = require("./event-loop-stall-monitor-ey4mbofz.js");
|
|
33
|
-
const require_tls$1 = require("./tls-
|
|
33
|
+
const require_tls$1 = require("./tls-CCMX7MjX.js");
|
|
34
34
|
const require_child_cap_dispatch = require("./child-cap-dispatch-wbIQJctP.js");
|
|
35
35
|
const require_resource_monitor = require("./resource-monitor-BgWGRxN5.js");
|
|
36
36
|
const require_custom_action_registry = require("./custom-action-registry-acBY3mHA.js");
|
|
@@ -7802,14 +7802,13 @@ var agentSchema = zod.z.object({
|
|
|
7802
7802
|
/** Port for the agent status page (minimal HTML) */
|
|
7803
7803
|
statusPort: zod.z.number().default(4444)
|
|
7804
7804
|
});
|
|
7805
|
-
var tlsSchema = zod.z.object({
|
|
7806
|
-
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
});
|
|
7805
|
+
var tlsSchema = zod.z.object({
|
|
7806
|
+
/**
|
|
7807
|
+
* Enable HTTPS (default: true). The certificate itself is never configured
|
|
7808
|
+
* here: the admin UI (Network → Local access) generates or uploads it
|
|
7809
|
+
* (D726), and boot serves whatever `tls/mode` says.
|
|
7810
|
+
*/
|
|
7811
|
+
enabled: zod.z.boolean().default(true) });
|
|
7813
7812
|
/**
|
|
7814
7813
|
* Bootstrap-time addon configuration — read PURELY from YAML, before the
|
|
7815
7814
|
* kernel can talk to the settings-store. This breaks the chicken-and-egg
|
|
@@ -96609,6 +96608,7 @@ exports.TRADITIONAL_NATIVE_PACKAGES = TRADITIONAL_NATIVE_PACKAGES;
|
|
|
96609
96608
|
exports.ToastService = ToastService;
|
|
96610
96609
|
exports.UDS_NO_ROUTE_PREFIX = require_child_cap_dispatch.UDS_NO_ROUTE_PREFIX;
|
|
96611
96610
|
exports.UNCLAIMED = UNCLAIMED;
|
|
96611
|
+
exports.UPLOADED_CA_FILE = require_tls$1.UPLOADED_CA_FILE;
|
|
96612
96612
|
exports.UdsLocalTransportClient = require_child_cap_dispatch.UdsLocalTransportClient;
|
|
96613
96613
|
exports.UdsLocalTransportServer = require_child_cap_dispatch.UdsLocalTransportServer;
|
|
96614
96614
|
exports.UserManager = require_builtins_local_auth_local_auth_addon.UserManager;
|
|
@@ -96622,6 +96622,7 @@ exports.addonSettingsCapability = require_dist.addonSettingsCapability;
|
|
|
96622
96622
|
exports.afterWorkerOnlineAnnounce = require_child_cap_dispatch.afterWorkerOnlineAnnounce;
|
|
96623
96623
|
exports.allFamiliesListenHost = require_tls$1.allFamiliesListenHost;
|
|
96624
96624
|
exports.answerClaimedGetStatus = require_child_cap_dispatch.answerClaimedGetStatus;
|
|
96625
|
+
exports.applyCertificateToListener = require_tls$1.applyCertificateToListener;
|
|
96625
96626
|
exports.applyLanHttp = require_tls$1.applyLanHttp;
|
|
96626
96627
|
exports.attributeStall = require_event_loop_stall_monitor.attributeStall;
|
|
96627
96628
|
exports.bindPendingLanHttp = require_tls$1.bindPendingLanHttp;
|
|
@@ -96652,6 +96653,7 @@ exports.capBareAction = require_child_cap_dispatch.capBareAction;
|
|
|
96652
96653
|
exports.capServiceName = require_child_cap_dispatch.capServiceName;
|
|
96653
96654
|
exports.classifyAddonDir = classifyAddonDir;
|
|
96654
96655
|
exports.classifyCapRoute = require_child_cap_dispatch.classifyCapRoute;
|
|
96656
|
+
exports.clearHttpsListener = require_tls$1.clearHttpsListener;
|
|
96655
96657
|
exports.clearPendingRestart = clearPendingRestart;
|
|
96656
96658
|
exports.closeLanHttp = require_tls$1.closeLanHttp;
|
|
96657
96659
|
exports.clusterEventTopic = require_child_cap_dispatch.clusterEventTopic;
|
|
@@ -96821,6 +96823,7 @@ exports.isModelDownloaded = require_event_loop_stall_monitor.isModelDownloaded;
|
|
|
96821
96823
|
exports.isSettingsReadUnavailable = require_builtins_local_auth_local_auth_addon.isSettingsReadUnavailable;
|
|
96822
96824
|
exports.isSourceNewer = isSourceNewer;
|
|
96823
96825
|
exports.isolatedBuiltinPhase = isolatedBuiltinPhase;
|
|
96826
|
+
exports.leafFingerprintOf = require_tls$1.leafFingerprintOf;
|
|
96824
96827
|
exports.loadTlsCert = require_tls$1.loadTlsCert;
|
|
96825
96828
|
exports.localEndpointPath = require_child_cap_dispatch.localEndpointPath;
|
|
96826
96829
|
exports.localProviderLink = require_child_cap_dispatch.localProviderLink;
|
|
@@ -96832,6 +96835,7 @@ exports.parseRangeHeader = require_event_loop_stall_monitor.parseRangeHeader;
|
|
|
96832
96835
|
exports.parseRssBudgetMb = require_child_cap_dispatch.parseRssBudgetMb;
|
|
96833
96836
|
exports.parseTokenizedUrl = require_event_loop_stall_monitor.parseTokenizedUrl;
|
|
96834
96837
|
exports.partitionIsolatedBuiltinIds = partitionIsolatedBuiltinIds;
|
|
96838
|
+
exports.prepareBootTls = require_tls$1.prepareBootTls;
|
|
96835
96839
|
exports.proxyToUpstream = proxyToUpstream;
|
|
96836
96840
|
exports.quarantineAddonResidue = quarantineAddonResidue;
|
|
96837
96841
|
exports.readExtraSans = require_tls$1.readExtraSans;
|
|
@@ -96844,12 +96848,16 @@ exports.readTlsMode = require_tls$1.readTlsMode;
|
|
|
96844
96848
|
exports.readinessKey = require_dist.readinessKey;
|
|
96845
96849
|
exports.reclaimIntervalMs = require_child_cap_dispatch.reclaimIntervalMs;
|
|
96846
96850
|
exports.recordSocketFrame = require_child_cap_dispatch.recordSocketFrame;
|
|
96851
|
+
exports.regenerateCertificate = require_tls$1.regenerateCertificate;
|
|
96847
96852
|
exports.registerEventBusService = require_child_cap_dispatch.registerEventBusService;
|
|
96853
|
+
exports.registerHttpsListener = require_tls$1.registerHttpsListener;
|
|
96848
96854
|
exports.registerLanHttpHandler = require_tls$1.registerLanHttpHandler;
|
|
96849
96855
|
exports.reissueTlsLeaf = require_tls$1.reissueTlsLeaf;
|
|
96856
|
+
exports.reloadHttpsListener = require_tls$1.reloadHttpsListener;
|
|
96850
96857
|
exports.resolveFilePath = require_event_loop_stall_monitor.resolveFilePath;
|
|
96851
96858
|
exports.resolveHwAccel = require_child_cap_dispatch.resolveHwAccel;
|
|
96852
96859
|
exports.resolveNpmInvocation = require_child_cap_dispatch.resolveNpmInvocation;
|
|
96860
|
+
exports.revertToGeneratedCertificate = require_tls$1.revertToGeneratedCertificate;
|
|
96853
96861
|
exports.runHubAddonBoot = runHubAddonBoot;
|
|
96854
96862
|
exports.runNpm = require_child_cap_dispatch.runNpm;
|
|
96855
96863
|
exports.sampleSocketDirection = require_child_cap_dispatch.sampleSocketDirection;
|
|
@@ -96860,6 +96868,7 @@ exports.scopesAllowDeviceCap = require_dist.scopesAllowDeviceCap;
|
|
|
96860
96868
|
exports.selectAddonResidue = selectAddonResidue;
|
|
96861
96869
|
exports.selectReportedSpaces = require_child_cap_dispatch.selectReportedSpaces;
|
|
96862
96870
|
exports.serializeTypedArrays = require_child_cap_dispatch.serializeTypedArrays;
|
|
96871
|
+
exports.servedHttpsLeafFingerprint = require_tls$1.servedHttpsLeafFingerprint;
|
|
96863
96872
|
exports.setHubConnected = require_child_cap_dispatch.setHubConnected;
|
|
96864
96873
|
exports.setNodeEventInterest = require_child_cap_dispatch.setNodeEventInterest;
|
|
96865
96874
|
exports.setWrapperActive = require_builtins_device_manager_device_manager_addon.setWrapperActive;
|
|
@@ -96867,10 +96876,12 @@ exports.shouldReclaim = require_child_cap_dispatch.shouldReclaim;
|
|
|
96867
96876
|
exports.signalAllRunnerGroups = require_child_cap_dispatch.signalAllRunnerGroups;
|
|
96868
96877
|
exports.socketDirectionBytes = require_child_cap_dispatch.socketDirectionBytes;
|
|
96869
96878
|
exports.socketDirectionMessages = require_child_cap_dispatch.socketDirectionMessages;
|
|
96879
|
+
exports.splitPemCertificates = require_tls$1.splitPemCertificates;
|
|
96870
96880
|
exports.startEventLoopStallMonitor = require_event_loop_stall_monitor.startEventLoopStallMonitor;
|
|
96871
96881
|
exports.startHeapWatch = require_child_cap_dispatch.startHeapWatch;
|
|
96872
96882
|
exports.startRunnerHeapWatch = require_child_cap_dispatch.startRunnerHeapWatch;
|
|
96873
96883
|
exports.storeMayAnswer = storeMayAnswer;
|
|
96884
|
+
exports.storeUploadedCertificate = require_tls$1.storeUploadedCertificate;
|
|
96874
96885
|
exports.strandedMb = require_child_cap_dispatch.strandedMb;
|
|
96875
96886
|
exports.stripCamstackDeps = stripCamstackDeps;
|
|
96876
96887
|
exports.subscribePassthrough = require_child_cap_dispatch.subscribePassthrough;
|
package/dist/index.mjs
CHANGED
|
@@ -29,7 +29,7 @@ import { SystemConfigAddon } from "./builtins/system-config/system-config.addon.
|
|
|
29
29
|
import "./builtins/system-config/index.mjs";
|
|
30
30
|
import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
|
|
31
31
|
import { _ as ensureModel, a as createFileDataPlaneHandler, c as parseRangeHeader, d as ModelDownloadService, g as downloadModel, h as downloadFile, i as startEventLoopStallMonitor, l as parseTokenizedUrl, m as deleteModelFromDisk, n as STALL_TICK_MS, o as contentTypeFor, p as collectModelFiles, r as attributeStall, s as createAuthenticatedFileServer, t as STALL_REPORT_MS, u as resolveFilePath, v as fetchJson, x as isModelDownloaded, y as getModelFilePath } from "./event-loop-stall-monitor-EXjzIxDz.mjs";
|
|
32
|
-
import { C as registerLanHttpHandler,
|
|
32
|
+
import { A as allFamiliesListenHost, C as collectCertIdentity, D as SERVER_AUTH_OID, E as MAX_LEAF_VALIDITY_DAYS, F as registerLanHttpHandler, M as bindPendingLanHttp, N as closeLanHttp, O as evaluateExistingCert, P as readLanHttpState, S as CA_COMMON_NAME, T as LEAF_RENEWAL_WINDOW_DAYS, _ as writeExtraSans, a as validateUploadedTls, b as loadTlsCert, c as registerHttpsListener, d as prepareBootTls, f as UPLOADED_CA_FILE, g as splitPemCertificates, h as readTlsMode, i as storeUploadedCertificate, j as applyLanHttp, k as DEFAULT_LAN_HTTP_PORT, l as reloadHttpsListener, m as readTlsAccessStatus, n as regenerateCertificate, o as clearHttpsListener, p as readExtraSans, r as revertToGeneratedCertificate, s as leafFingerprintOf, t as applyCertificateToListener, u as servedHttpsLeafFingerprint, v as writeTlsMode, w as CA_VALIDITY_DAYS, x as reissueTlsLeaf, y as ensureTlsCert } from "./tls-CJHogwTl.mjs";
|
|
33
33
|
import { $ as CapRouteError, $n as EMPTY_CAP_ACTION_READING, $t as RUNNER_RSS_BUDGET_ENV, A as resolveHwAccel, An as OUTBOUND_QUEUE_SUSTAIN_MS, At as DeviceRegistry, B as udsChildLogToWorkerEntry, Bn as createSocketPlaneMeter, Bt as hostNodeIdOf, C as getBrokerEventBus, Cn as HEAP_SPACE_REPORT_MIN_MB, Ct as capActionName, D as subscribePassthrough, Dn as readHeapSpaces, Dt as parseCapAction, E as setNodeEventInterest, En as heapSpaceField, Et as capServiceName, F as ipcParentLink, Fn as createMeshQueueReader, Ft as resolveAddonClass, G as UDS_NO_ROUTE_PREFIX, Gn as EMPTY_SOCKET_DIRECTION, Gt as HEAP_WATCH_INTERVAL_MS, H as createUdsLoggerWithControl, Hn as diffSocketPlane, Ht as HEAP_RECLAIM_MIN_INTERVAL_MS, I as localProviderLink, In as formatMeshQueue, It as buildNpmChildEnv, J as answerClaimedGetStatus, Jn as sampleSocketDirection, Jt as HUB_MAIN_RSS_BUDGET_MB, K as afterWorkerOnlineAnnounce, Kn as createSocketDirectionCounters, Kt as HEAP_WATCH_WARN_RATIO, L as createParentUnownedCallHandler, Ln as EMPTY_SOCKET_PLANE_BASELINE, Lt as resolveNpmInvocation, M as brokerTransportLink, Mn as createOutboundQueueGate, Mt as CapabilityUnavailableError, N as buildLinkChain, Nn as formatOutboundQueueVerdict, Nt as copyBundledNativeModules, O as AddonDepsManager, On as selectReportedSpaces, Ot as deserializeTypedArrays, P as deviceCapResolverLink, Pn as MESH_QUEUE_TOP_N, Pt as installManifestNativeDeps, Q as CapRouteResolver, Qn as CAP_ACTION_UNLABELLED, Qt as RUNNER_HEAP_WATCH_INTERVAL_MS, R as createUdsEventBridge, Rn as SOCKET_PLANE_TOP_N, Rt as runNpm, S as clusterEventTopic, Sn as DECISIVE_HEAP_SPACES, St as NATIVE_PROVIDER_SERVICE_INFIX, T as registerEventBusService, Tn as formatHeapSpaces, Tt as capBareAction, U as LocalChildClient, Un as formatSocketPlane, Ut as HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, V as createUdsLogger, Vn as createSocketPlaneReader, Vt as createAddonDataPlaneFacility, W as LocalChildRegistry, Wn as readSocketQueues, Wt as HEAP_RECLAIM_TRIGGER_MB, X as AGENT_CAP_FWD_ACTION, Xn as socketDirectionMessages, Xt as RSS_BUDGET_REANNOUNCE_MIN_MS, Y as deviceOfGetStatus, Yn as socketDirectionBytes, Yt as HUB_RSS_BUDGET_ENV, Z as AGENT_CAP_FWD_SERVICE, Zn as CAP_ACTION_OVERFLOW_LABEL, Zt as RSS_BUDGET_RELEASE_RATIO, _ as getWorkerDeviceRegistry, _n as ARRAY_BUFFER_RELEASE_MIN_DROP_RATIO, a as reapProcessGroup, an as describeRss, ar as createEventPlaneMeter, at as getCapUsageRegistry, b as setHubConnected, bn as formatArrayBufferCensus, bt as createAddonService, c as runnerOwnsProcessGroup, cn as parseRssBudgetMb, cr as formatEventPlane, ct as UdsLocalTransportServer, d as summarizeMembers, dn as startHeapWatch, dt as localEndpointPath, en as ZERO_LOOP_DELAY, er as MAX_CAP_ACTIONS_PER_PEER, et as classifyCapRoute, f as installManifestSystemDeps, fn as startRunnerHeapWatch, ft as FrameDecoder, g as createUdsAddonContext, gn as ARRAY_BUFFER_CENSUS_THRESHOLD_MB, h as createAddonContext, hn as ARRAY_BUFFER_CENSUS_SUSTAIN_MS, ht as createBrokerDeviceManagerApi, in as createV8Reclaimer, ir as EVENT_PLANE_TOP_N, it as __resetCapUsageRegistryForTests, j as brokerCallForCap, jn as OUTBOUND_QUEUE_THRESHOLD_BYTES, jt as CapabilityHandle, k as createKernelHwAccel, kn as OUTBOUND_QUEUE_COOLDOWN_MS, kt as serializeTypedArrays, l as signalAllRunnerGroups, ln as reclaimIntervalMs, lt as SocketChannel, m as adaptBrokerToCluster, mn as ARRAY_BUFFER_CENSUS_COOLDOWN_MS, mt as buildNativeCapProxy, nn as createDeferredHeapWatchSink, nr as createCapActionCensus, nt as CapUsageRegistry, o as registerRunnerGroup, on as hubMainRssBudget, or as createEventPlaneReader, ot as createLocalTransport, p as installManifestPythonDeps, pn as strandedMb, pt as encodeFrame, q as GET_STATUS_METHOD, qn as recordSocketFrame, qt as HUB_MAIN_HEAP_WATCH_LABEL, r as defaultProcessGroupOps, rn as createLoopDelayMeter, rr as diffCapActionCensus, rt as PARENT_ROUTED_PROVIDER_ADDON_ID, s as releaseRunnerGroup, sn as nextRssBudgetState, sr as diffEventPlane, st as UdsLocalTransportClient, t as CAP_METHOD_NOT_IMPLEMENTED, tn as buildHeapSample, tr as capActionLabel, tt as callWithServiceDiscovery, un as shouldReclaim, ut as PeerAnsweredError, v as getOrInitReadinessRegistry, vn as createArrayBufferCensusGate, vt as mountNativeCapService, w as getMoleculerEventStats, wn as emitHeapDiagnosticReport, wt as capActionSuffix, x as EVENT_TOPIC_PREFIX, xn as isArrayBufferCensusReport, xt as validateProviderRegistrations, y as getOrInitReadinessRegistryForClient, yn as createInspectorArrayBufferCensus, z as createUdsEventBus, zn as SOCKET_QUEUE_TOP_N, zt as createAddonPeerBytesFacility } from "./child-cap-dispatch-BcRHQBKW.mjs";
|
|
34
34
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-B2WZ8_q9.mjs";
|
|
35
35
|
import { t as CustomActionRegistry } from "./custom-action-registry-B4Cf4O_X.mjs";
|
|
@@ -7795,14 +7795,13 @@ var agentSchema = z.object({
|
|
|
7795
7795
|
/** Port for the agent status page (minimal HTML) */
|
|
7796
7796
|
statusPort: z.number().default(4444)
|
|
7797
7797
|
});
|
|
7798
|
-
var tlsSchema = z.object({
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
});
|
|
7798
|
+
var tlsSchema = z.object({
|
|
7799
|
+
/**
|
|
7800
|
+
* Enable HTTPS (default: true). The certificate itself is never configured
|
|
7801
|
+
* here: the admin UI (Network → Local access) generates or uploads it
|
|
7802
|
+
* (D726), and boot serves whatever `tls/mode` says.
|
|
7803
|
+
*/
|
|
7804
|
+
enabled: z.boolean().default(true) });
|
|
7806
7805
|
/**
|
|
7807
7806
|
* Bootstrap-time addon configuration — read PURELY from YAML, before the
|
|
7808
7807
|
* kernel can talk to the settings-store. This breaks the chicken-and-egg
|
|
@@ -96446,4 +96445,4 @@ var LifecycleJobEngine = class {
|
|
|
96446
96445
|
}
|
|
96447
96446
|
};
|
|
96448
96447
|
//#endregion
|
|
96449
|
-
export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_READINESS_SERVICE_NAME, ALL_CAPABILITY_DEFINITIONS, ARRAY_BUFFER_CENSUS_COOLDOWN_MS, ARRAY_BUFFER_CENSUS_SUSTAIN_MS, ARRAY_BUFFER_CENSUS_THRESHOLD_MB, ARRAY_BUFFER_RELEASE_MIN_DROP_RATIO, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CAP_ACTION_OVERFLOW_LABEL, CAP_ACTION_UNLABELLED, CAP_METHOD_NOT_IMPLEMENTED, CA_COMMON_NAME, CA_VALIDITY_DAYS, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REJECTED_EXIT_CODE, CORE_CAP_SERVICE_NAME, CalendarsAddon, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, ComposerAddon, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CoreBlocksAddon, CustomActionRegistry, DECISIVE_HEAP_SPACES, DEFAULT_DATA_PATH, DEFAULT_LAN_HTTP_PORT, DEFAULT_LOG_LEVEL, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EMPTY_CAP_ACTION_READING, EMPTY_SOCKET_DIRECTION, EMPTY_SOCKET_PLANE_BASELINE, EVENT_PLANE_TOP_N, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, GET_STATUS_METHOD, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HEAP_RECLAIM_MIN_INTERVAL_MS, HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_SPACE_REPORT_MIN_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HUB_MAIN_HEAP_WATCH_LABEL, HUB_MAIN_RSS_BUDGET_MB, HUB_RSS_BUDGET_ENV, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LoggingGate, LokiDestination, LokiLoggingAddon, MAX_CAP_ACTIONS_PER_PEER, MAX_LEAF_VALIDITY_DAYS, MESH_QUEUE_TOP_N, METHOD_ACCESS_MAP, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, OUTBOUND_QUEUE_COOLDOWN_MS, OUTBOUND_QUEUE_SUSTAIN_MS, OUTBOUND_QUEUE_THRESHOLD_BYTES, PARENT_ROUTED_PROVIDER_ADDON_ID, PYTHON_VERSION, PeerAnsweredError, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, RESTART_MARKER_FILE, RSS_BUDGET_REANNOUNCE_MIN_MS, RSS_BUDGET_RELEASE_RATIO, RUNNER_HEAP_WATCH_INTERVAL_MS, RUNNER_RSS_BUDGET_ENV, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, SERVER_AUTH_OID, SOCKET_PLANE_TOP_N, SOCKET_QUEUE_TOP_N, STALL_REPORT_MS, STALL_TICK_MS, STORE_READABLE_BOOTSTRAP_KEYS, ScopedLogger, ScopedTokenManager, SettingsReadUnavailableError, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, ToastService, UDS_NO_ROUTE_PREFIX, UNCLAIMED, UdsLocalTransportClient, UdsLocalTransportServer, UserManager, WinstonDestination, WinstonLoggingAddon, ZERO_LOOP_DELAY, __resetCapUsageRegistryForTests, __resetLoggingGateForTests, adaptBrokerToCluster, addonSettingsCapability, afterWorkerOnlineAnnounce, allFamiliesListenHost, answerClaimedGetStatus, applyLanHttp, attributeStall, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildNpmChildEnv, buildStorageLocationRegistry, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionLabel, capActionName, capActionSuffix, capBareAction, capServiceName, classifyAddonDir, classifyCapRoute, clearPendingRestart, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonPeerBytesFacility, createAddonService, createArrayBufferCensusGate, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCapActionCensus, createCoreCapService, createDeferredHeapWatchSink, createDoorSettingsView, createEventPlaneMeter, createEventPlaneReader, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createInspectorArrayBufferCensus, createKernelHwAccel, createLocalTransport, createLoopDelayMeter, createMeshQueueReader, createOutboundQueueGate, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createSocketDirectionCounters, createSocketPlaneMeter, createSocketPlaneReader, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, describeRss, detectWorkspacePackagesDir, deviceCapResolverLink, deviceOfGetStatus, diffCapActionCensus, diffEventPlane, diffSocketPlane, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, emitHeapDiagnosticReport, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, fetchJson, findInPath, formatArrayBufferCensus, formatEventPlane, formatHeapSpaces, formatLogLine, formatMeshQueue, formatOutboundQueueVerdict, formatSocketPlane, getBrokerEventBus, getCapUsageRegistry, getFfmpegDownloadUrl, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, heapSpaceField, hostNodeIdOf, hubMainRssBudget, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcParentLink, isAddonDeploySource, isArrayBufferCensusReport, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isInfraCapability, isModelDownloaded, isSettingsReadUnavailable, isSourceNewer, isolatedBuiltinPhase, loadTlsCert, localEndpointPath, localProviderLink, mountNativeCapService, nextRssBudgetState, overlayGetStatus, parseCapAction, parseRangeHeader, parseRssBudgetMb, parseTokenizedUrl, partitionIsolatedBuiltinIds, proxyToUpstream, quarantineAddonResidue, readExtraSans, readHeapSpaces, readLanHttpState, readPendingRestart, readSocketQueues, readTlsAccessStatus, readTlsMode, readinessKey, reclaimIntervalMs, recordSocketFrame, registerEventBusService, registerLanHttpHandler, reissueTlsLeaf, resolveFilePath, resolveHwAccel, resolveNpmInvocation, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, setHubConnected, setNodeEventInterest, setWrapperActive, shouldReclaim, signalAllRunnerGroups, socketDirectionBytes, socketDirectionMessages, startEventLoopStallMonitor, startHeapWatch, startRunnerHeapWatch, storeMayAnswer, strandedMb, stripCamstackDeps, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
|
|
96448
|
+
export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_READINESS_SERVICE_NAME, ALL_CAPABILITY_DEFINITIONS, ARRAY_BUFFER_CENSUS_COOLDOWN_MS, ARRAY_BUFFER_CENSUS_SUSTAIN_MS, ARRAY_BUFFER_CENSUS_THRESHOLD_MB, ARRAY_BUFFER_RELEASE_MIN_DROP_RATIO, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CAP_ACTION_OVERFLOW_LABEL, CAP_ACTION_UNLABELLED, CAP_METHOD_NOT_IMPLEMENTED, CA_COMMON_NAME, CA_VALIDITY_DAYS, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REJECTED_EXIT_CODE, CORE_CAP_SERVICE_NAME, CalendarsAddon, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, ComposerAddon, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CoreBlocksAddon, CustomActionRegistry, DECISIVE_HEAP_SPACES, DEFAULT_DATA_PATH, DEFAULT_LAN_HTTP_PORT, DEFAULT_LOG_LEVEL, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EMPTY_CAP_ACTION_READING, EMPTY_SOCKET_DIRECTION, EMPTY_SOCKET_PLANE_BASELINE, EVENT_PLANE_TOP_N, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, GET_STATUS_METHOD, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HEAP_RECLAIM_MIN_INTERVAL_MS, HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_SPACE_REPORT_MIN_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HUB_MAIN_HEAP_WATCH_LABEL, HUB_MAIN_RSS_BUDGET_MB, HUB_RSS_BUDGET_ENV, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LoggingGate, LokiDestination, LokiLoggingAddon, MAX_CAP_ACTIONS_PER_PEER, MAX_LEAF_VALIDITY_DAYS, MESH_QUEUE_TOP_N, METHOD_ACCESS_MAP, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, OUTBOUND_QUEUE_COOLDOWN_MS, OUTBOUND_QUEUE_SUSTAIN_MS, OUTBOUND_QUEUE_THRESHOLD_BYTES, PARENT_ROUTED_PROVIDER_ADDON_ID, PYTHON_VERSION, PeerAnsweredError, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, RESTART_MARKER_FILE, RSS_BUDGET_REANNOUNCE_MIN_MS, RSS_BUDGET_RELEASE_RATIO, RUNNER_HEAP_WATCH_INTERVAL_MS, RUNNER_RSS_BUDGET_ENV, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, SERVER_AUTH_OID, SOCKET_PLANE_TOP_N, SOCKET_QUEUE_TOP_N, STALL_REPORT_MS, STALL_TICK_MS, STORE_READABLE_BOOTSTRAP_KEYS, ScopedLogger, ScopedTokenManager, SettingsReadUnavailableError, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, ToastService, UDS_NO_ROUTE_PREFIX, UNCLAIMED, UPLOADED_CA_FILE, UdsLocalTransportClient, UdsLocalTransportServer, UserManager, WinstonDestination, WinstonLoggingAddon, ZERO_LOOP_DELAY, __resetCapUsageRegistryForTests, __resetLoggingGateForTests, adaptBrokerToCluster, addonSettingsCapability, afterWorkerOnlineAnnounce, allFamiliesListenHost, answerClaimedGetStatus, applyCertificateToListener, applyLanHttp, attributeStall, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildNpmChildEnv, buildStorageLocationRegistry, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionLabel, capActionName, capActionSuffix, capBareAction, capServiceName, classifyAddonDir, classifyCapRoute, clearHttpsListener, clearPendingRestart, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonPeerBytesFacility, createAddonService, createArrayBufferCensusGate, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCapActionCensus, createCoreCapService, createDeferredHeapWatchSink, createDoorSettingsView, createEventPlaneMeter, createEventPlaneReader, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createInspectorArrayBufferCensus, createKernelHwAccel, createLocalTransport, createLoopDelayMeter, createMeshQueueReader, createOutboundQueueGate, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createSocketDirectionCounters, createSocketPlaneMeter, createSocketPlaneReader, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, describeRss, detectWorkspacePackagesDir, deviceCapResolverLink, deviceOfGetStatus, diffCapActionCensus, diffEventPlane, diffSocketPlane, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, emitHeapDiagnosticReport, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, fetchJson, findInPath, formatArrayBufferCensus, formatEventPlane, formatHeapSpaces, formatLogLine, formatMeshQueue, formatOutboundQueueVerdict, formatSocketPlane, getBrokerEventBus, getCapUsageRegistry, getFfmpegDownloadUrl, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, heapSpaceField, hostNodeIdOf, hubMainRssBudget, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcParentLink, isAddonDeploySource, isArrayBufferCensusReport, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isInfraCapability, isModelDownloaded, isSettingsReadUnavailable, isSourceNewer, isolatedBuiltinPhase, leafFingerprintOf, loadTlsCert, localEndpointPath, localProviderLink, mountNativeCapService, nextRssBudgetState, overlayGetStatus, parseCapAction, parseRangeHeader, parseRssBudgetMb, parseTokenizedUrl, partitionIsolatedBuiltinIds, prepareBootTls, proxyToUpstream, quarantineAddonResidue, readExtraSans, readHeapSpaces, readLanHttpState, readPendingRestart, readSocketQueues, readTlsAccessStatus, readTlsMode, readinessKey, reclaimIntervalMs, recordSocketFrame, regenerateCertificate, registerEventBusService, registerHttpsListener, registerLanHttpHandler, reissueTlsLeaf, reloadHttpsListener, resolveFilePath, resolveHwAccel, resolveNpmInvocation, revertToGeneratedCertificate, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, servedHttpsLeafFingerprint, setHubConnected, setNodeEventInterest, setWrapperActive, shouldReclaim, signalAllRunnerGroups, socketDirectionBytes, socketDirectionMessages, splitPemCertificates, startEventLoopStallMonitor, startHeapWatch, startRunnerHeapWatch, storeMayAnswer, storeUploadedCertificate, strandedMb, stripCamstackDeps, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
|
|
@@ -29,8 +29,6 @@ export declare const bootstrapSchema: z.ZodObject<{
|
|
|
29
29
|
}, z.core.$strip>>;
|
|
30
30
|
tls: z.ZodDefault<z.ZodObject<{
|
|
31
31
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
32
|
-
certPath: z.ZodOptional<z.ZodString>;
|
|
33
|
-
keyPath: z.ZodOptional<z.ZodString>;
|
|
34
32
|
}, z.core.$strip>>;
|
|
35
33
|
bootstrap: z.ZodDefault<z.ZodObject<{
|
|
36
34
|
settingsStoreAddon: z.ZodDefault<z.ZodString>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CertOptions, EnsureTlsResult, TlsCertPair } from './cert-manager.js';
|
|
2
|
+
/** The certificate source a booting listener serves. */
|
|
3
|
+
export type BootTlsMode = 'generated' | 'uploaded';
|
|
4
|
+
export interface BootTls {
|
|
5
|
+
readonly mode: BootTlsMode;
|
|
6
|
+
readonly pair: TlsCertPair;
|
|
7
|
+
/**
|
|
8
|
+
* The `ensureTlsCert` outcome — present only for a generated certificate,
|
|
9
|
+
* so a reissue reaches the operator as an alert. `undefined` when an
|
|
10
|
+
* uploaded certificate is served: the hub never evaluates, let alone
|
|
11
|
+
* reissues, a certificate the operator supplied.
|
|
12
|
+
*/
|
|
13
|
+
readonly ensured: EnsureTlsResult | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* True when the mode marker said `uploaded` but the files were gone, so
|
|
16
|
+
* the node fell back to its generated certificate. The caller logs it:
|
|
17
|
+
* a certificate source that changed under the operator is never silent.
|
|
18
|
+
*/
|
|
19
|
+
readonly uploadedMissing: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Decide what the listener serves at boot. The admin UI (Network → Local
|
|
23
|
+
* access) is the only way to set a certificate (D726): it either leaves the
|
|
24
|
+
* hub on its generated local-CA leaf (D227) or uploads one, recorded by the
|
|
25
|
+
* `tls/mode` marker. An uploaded certificate is served verbatim — running it
|
|
26
|
+
* through `ensureTlsCert` would replace it on the first restart, because a
|
|
27
|
+
* leaf the local root did not issue is one of that rule's reissue triggers.
|
|
28
|
+
*/
|
|
29
|
+
export declare function prepareBootTls(dataDir: string, options?: CertOptions): Promise<BootTls>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Server as TlsServer } from 'node:tls';
|
|
2
|
+
import { TlsCertPair } from './cert-manager.js';
|
|
3
|
+
export type HttpsReloadOutcome = {
|
|
4
|
+
readonly kind: 'reloaded';
|
|
5
|
+
readonly servedLeafFingerprint: string;
|
|
6
|
+
} | {
|
|
7
|
+
readonly kind: 'no-listener';
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: 'failed';
|
|
10
|
+
readonly error: string;
|
|
11
|
+
};
|
|
12
|
+
/** SHA-256 fingerprint of the first certificate (the leaf) in a PEM chain. */
|
|
13
|
+
export declare function leafFingerprintOf(chain: Buffer | string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Called once by the server after its HTTPS listener is up, with the pair it
|
|
16
|
+
* was started on. From here on a certificate action swaps the served
|
|
17
|
+
* certificate in place (`setSecureContext`) — new handshakes get the new
|
|
18
|
+
* leaf, open connections keep theirs, nothing restarts.
|
|
19
|
+
*/
|
|
20
|
+
export declare function registerHttpsListener(server: TlsServer, pair: TlsCertPair): void;
|
|
21
|
+
/** Forget the listener — on shutdown, and between specs. */
|
|
22
|
+
export declare function clearHttpsListener(): void;
|
|
23
|
+
/**
|
|
24
|
+
* The leaf the HTTPS listener serves now, or `null` when this process has no
|
|
25
|
+
* registered listener (TLS off, or a process that does not own one) — in
|
|
26
|
+
* which case nobody can say, and `null` is the honest answer.
|
|
27
|
+
*/
|
|
28
|
+
export declare function servedHttpsLeafFingerprint(): string | null;
|
|
29
|
+
/** Serve `pair` from now on. Never throws: the outcome says what happened. */
|
|
30
|
+
export declare function reloadHttpsListener(pair: TlsCertPair): HttpsReloadOutcome;
|
package/dist/tls/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export { CA_VALIDITY_DAYS, type CertEvaluationInput, LEAF_RENEWAL_WINDOW_DAYS, SERVER_AUTH_OID, } from './cert-evaluation.js';
|
|
2
2
|
export { type CertIdentity, type CertOptions, type HostFacts, type CertRegenerationReason, collectCertIdentity, type EnsureTlsResult, ensureTlsCert, reissueTlsLeaf, evaluateExistingCert, loadTlsCert, MAX_LEAF_VALIDITY_DAYS, type TlsCertPair, } from './cert-manager.js';
|
|
3
|
+
export { type BootTls, type BootTlsMode, prepareBootTls } from './boot-tls.js';
|
|
4
|
+
export { clearHttpsListener, type HttpsReloadOutcome, leafFingerprintOf, registerHttpsListener, reloadHttpsListener, servedHttpsLeafFingerprint, } from './https-listener.js';
|
|
5
|
+
export { applyCertificateToListener, regenerateCertificate, revertToGeneratedCertificate, storeUploadedCertificate, type UploadCertificateInput, } from './tls-actions.js';
|
|
3
6
|
export { CA_COMMON_NAME } from './cert-issue.js';
|
|
4
7
|
export { validateUploadedTls, type UploadedTlsValidation } from './uploaded-cert.js';
|
|
5
|
-
export { type TlsAccessStatus, readTlsAccessStatus, writeTlsMode, readTlsMode, readExtraSans, writeExtraSans, } from './tls-status.js';
|
|
8
|
+
export { type TlsAccessStatus, readTlsAccessStatus, splitPemCertificates, UPLOADED_CA_FILE, writeTlsMode, readTlsMode, readExtraSans, writeExtraSans, } from './tls-status.js';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CertOptions } from './cert-manager.js';
|
|
2
|
+
import { HttpsReloadOutcome } from './https-listener.js';
|
|
3
|
+
/**
|
|
4
|
+
* The certificate actions of Network → Local access (D726). Each one changes
|
|
5
|
+
* the files under `<dataDir>/tls` and then puts them on the listener, so the
|
|
6
|
+
* certificate the status reports is the certificate a client is served.
|
|
7
|
+
*/
|
|
8
|
+
export interface UploadCertificateInput {
|
|
9
|
+
readonly certPem: string;
|
|
10
|
+
readonly keyPem: string;
|
|
11
|
+
readonly caPem?: string | undefined;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Store an operator's certificate. The leaf (or chain) and key replace the
|
|
15
|
+
* served pair; a CA, when given, goes to its own file. The local CA
|
|
16
|
+
* (`camstack-ca.crt` + key) is never touched — it did not sign the upload,
|
|
17
|
+
* and it is what "Revert to generated" and every device that trusts it
|
|
18
|
+
* still need.
|
|
19
|
+
*/
|
|
20
|
+
export declare function storeUploadedCertificate(dataDir: string, input: UploadCertificateInput): Promise<void>;
|
|
21
|
+
/** Issue a new generated leaf under the local CA. Refused while an upload is served. */
|
|
22
|
+
export declare function regenerateCertificate(dataDir: string, options: CertOptions): Promise<void>;
|
|
23
|
+
/** Drop the upload and serve the generated local-CA leaf again (D227). */
|
|
24
|
+
export declare function revertToGeneratedCertificate(dataDir: string, options: CertOptions): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Put the pair on disk on the HTTPS listener. Called after every action, so
|
|
27
|
+
* "the certificate changed" and "clients see it" are the same moment.
|
|
28
|
+
*/
|
|
29
|
+
export declare function applyCertificateToListener(dataDir: string): HttpsReloadOutcome;
|
package/dist/tls/tls-status.d.ts
CHANGED
|
@@ -13,4 +13,15 @@ export declare function readTlsMode(dataDir: string): TlsMode;
|
|
|
13
13
|
export declare function writeTlsMode(dataDir: string, mode: TlsMode): void;
|
|
14
14
|
export declare function readExtraSans(dataDir: string): readonly string[];
|
|
15
15
|
export declare function writeExtraSans(dataDir: string, sans: readonly string[]): void;
|
|
16
|
-
|
|
16
|
+
/** Where an upload's own CA is kept — never over the local CA's `camstack-ca.crt`. */
|
|
17
|
+
export declare const UPLOADED_CA_FILE = "uploaded-ca.crt";
|
|
18
|
+
/** Every certificate in a PEM bundle, in order. */
|
|
19
|
+
export declare function splitPemCertificates(pem: string): readonly string[];
|
|
20
|
+
/**
|
|
21
|
+
* What the node's certificate is, and whether the listener serves it.
|
|
22
|
+
* `servedLeafFingerprint` is the leaf the HTTPS listener presents right now
|
|
23
|
+
* (`servedHttpsLeafFingerprint()`), or `null` when unknown; a restart is
|
|
24
|
+
* required exactly when the listener serves a different leaf than the one
|
|
25
|
+
* on disk — a measured fact, not a flag a mutation remembered to set.
|
|
26
|
+
*/
|
|
27
|
+
export declare function readTlsAccessStatus(dataDir: string, servedLeafFingerprint: string | null): TlsAccessStatus;
|