@camstack/system 1.2.395 → 1.2.397
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/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/keychain/index.js +1 -1
- package/dist/builtins/keychain/index.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.d.ts +1 -13
- package/dist/builtins/system-config/system-config.addon.js +51 -159
- package/dist/builtins/system-config/system-config.addon.mjs +55 -159
- package/dist/{constants-C1WoQ0E8.mjs → constants-5vADty9I.mjs} +1 -3
- package/dist/{constants-Bz9gKWe8.js → constants-Dcecs0Ks.js} +0 -8
- package/dist/index.js +4 -9
- package/dist/index.mjs +6 -7
- package/dist/kernel/index.d.ts +2 -2
- package/dist/kernel/moleculer/mesh-mtls/constants.d.ts +1 -1
- package/dist/kernel/moleculer/mesh-mtls/index.d.ts +1 -1
- package/dist/kernel/moleculer/mesh-mtls/mesh-peer-transport.d.ts +13 -0
- package/dist/kernel/moleculer/mesh-mtls/tls-tcp-transporter.d.ts +3 -0
- package/dist/{restore-archive-KnMS8Uta.mjs → restore-archive-DQ2NuwD1.mjs} +4 -4
- package/package.json +1 -1
- package/dist/kernel/moleculer/mesh-mtls/mesh-clear-port.d.ts +0 -56
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Ln as storageOccupancyCapability, Vr as nodePin, X as backupCapability, dr as BaseAddon, ei as toNodeId, ri as EventCategory, rn as mayWriteToLocation } from "../../dist-0P1gm4Gd.mjs";
|
|
2
|
-
import { a as BackupSnapshotRefusedError, c as BackupKeyFormatError, d as generateBackupKeyPair, f as parseBackupPublicKey, i as BackupCancelledError, n as precheckRestoreKey, o as SystemBackupService, p as parseBackupSecretKey, r as prepareRestoreArchive, u as ENCRYPTED_BACKUP_SUFFIX } from "../../restore-archive-
|
|
2
|
+
import { a as BackupSnapshotRefusedError, c as BackupKeyFormatError, d as generateBackupKeyPair, f as parseBackupPublicKey, i as BackupCancelledError, n as precheckRestoreKey, o as SystemBackupService, p as parseBackupSecretKey, r as prepareRestoreArchive, u as ENCRYPTED_BACKUP_SUFFIX } from "../../restore-archive-DQ2NuwD1.mjs";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import * as fsp from "node:fs/promises";
|
|
5
5
|
import * as path$1 from "node:path";
|
|
@@ -5,7 +5,7 @@ Object.defineProperties(exports, {
|
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
6
|
const require_dist = require("../../dist-CME5sVBJ.js");
|
|
7
7
|
const require_jwt_signing_key = require("../../jwt-signing-key-CyoJaT3C.js");
|
|
8
|
-
const require_constants = require("../../constants-
|
|
8
|
+
const require_constants = require("../../constants-Dcecs0Ks.js");
|
|
9
9
|
const require_platform_key_source = require("../../platform-key-source-Di7HrlGR.js");
|
|
10
10
|
let node_crypto = require("node:crypto");
|
|
11
11
|
let node_path = require("node:path");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { E as KEYCHAIN_RESET_TRIGGER_ACTOR, Gr as parseSecretRef, Gt as keychainAdminCapability, Hr as normalizeSecretOwner, Kt as keychainCapability, Mr as formatSecretScope, dr as BaseAddon, ri as EventCategory } from "../../dist-0P1gm4Gd.mjs";
|
|
2
2
|
import { r as SYSTEM_SECRET_OWNER, t as JWT_SIGNING_KEY_REF } from "../../jwt-signing-key-DK-IFI9j.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { a as MESH_CA_KEY_REF, p as CLUSTER_SECRET_SETTINGS_KEY } from "../../constants-5vADty9I.mjs";
|
|
4
4
|
import { n as getPlatformKeychainKey } from "../../platform-key-source-BWlq0jjn.mjs";
|
|
5
5
|
import { createCipheriv, createDecipheriv, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
6
6
|
import * as path$1 from "node:path";
|
|
@@ -10,12 +10,6 @@ export declare class SystemConfigAddon extends BaseAddon {
|
|
|
10
10
|
constructor();
|
|
11
11
|
protected onInitialize(): Promise<AddonInitResult<typeof systemConfigMeshActions>>;
|
|
12
12
|
protected onShutdown(): Promise<void>;
|
|
13
|
-
/**
|
|
14
|
-
* Boot: a stored `meshClearPort: off` is the operator's standing choice, so it
|
|
15
|
-
* is applied WITHOUT the agents gate (nobody is connected yet to be checked).
|
|
16
|
-
* Default `on` changes nothing.
|
|
17
|
-
*/
|
|
18
|
-
private applyStoredClearPort;
|
|
19
13
|
private onMeshCaReady;
|
|
20
14
|
private mintJoinToken;
|
|
21
15
|
/** D821 — short-lived ticket for the agent's `:4444` unlock session. */
|
|
@@ -30,7 +24,7 @@ export declare class SystemConfigAddon extends BaseAddon {
|
|
|
30
24
|
/**
|
|
31
25
|
* The admin UI / `addonSettings` cap prefer {@link BaseAddon.updateGlobalSettingsAsOperator}.
|
|
32
26
|
* That BaseAddon path writes the generic addon store and never reaches
|
|
33
|
-
* {@link writeClusterSection}
|
|
27
|
+
* {@link writeClusterSection}. Route the operator
|
|
34
28
|
* write through the same section-aware path as {@link updateGlobalSettings}.
|
|
35
29
|
*/
|
|
36
30
|
override updateGlobalSettingsAsOperator(patch: Record<string, unknown>, _nodeId?: string): Promise<void>;
|
|
@@ -43,12 +37,6 @@ export declare class SystemConfigAddon extends BaseAddon {
|
|
|
43
37
|
* enforced (D821) — a legacy `meshAuth` in the patch is ignored.
|
|
44
38
|
*/
|
|
45
39
|
private writeClusterSection;
|
|
46
|
-
/**
|
|
47
|
-
* `cluster.meshClearPort`: `off` is REFUSED while any online agent still
|
|
48
|
-
* connects in clear (or the TLS listener is not up); the refusal names them.
|
|
49
|
-
* Persist, then apply — an `on` save always passes.
|
|
50
|
-
*/
|
|
51
|
-
private writeMeshClearPort;
|
|
52
40
|
/** Persist + publish mesh auth mode (always `enforced` after D821). */
|
|
53
41
|
private writeMeshAuthMode;
|
|
54
42
|
/**
|
|
@@ -5,7 +5,7 @@ Object.defineProperties(exports, {
|
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
6
|
const require_dist = require("../../dist-CME5sVBJ.js");
|
|
7
7
|
const require_ms$1 = require("../../ms-t68_FaqE.js");
|
|
8
|
-
const require_constants$8 = require("../../constants-
|
|
8
|
+
const require_constants$8 = require("../../constants-Dcecs0Ks.js");
|
|
9
9
|
const require_x509_es = require("../../x509.es-BhTzcFhZ.js");
|
|
10
10
|
let zod = require("zod");
|
|
11
11
|
let node_crypto = require("node:crypto");
|
|
@@ -607,67 +607,23 @@ function processMeshCrl() {
|
|
|
607
607
|
return crl;
|
|
608
608
|
}
|
|
609
609
|
//#endregion
|
|
610
|
-
//#region src/kernel/moleculer/mesh-mtls/mesh-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
function
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
/** A stored value that is not a mode reads as `on`: never cut the mesh on a typo. */
|
|
617
|
-
function parseMeshClearPortMode(value) {
|
|
618
|
-
return isMeshClearPortMode(value) ? value : "on";
|
|
619
|
-
}
|
|
620
|
-
/** Pure: may the clear port be switched off right now? */
|
|
621
|
-
function decideMeshClearPortOff(control) {
|
|
622
|
-
if (control === null) return {
|
|
623
|
-
allowed: false,
|
|
624
|
-
blocking: [],
|
|
625
|
-
error: "The clear mesh port can only be switched off on the hub (no mesh transport here)."
|
|
626
|
-
};
|
|
627
|
-
if (!control.isTlsListening()) return {
|
|
628
|
-
allowed: false,
|
|
629
|
-
blocking: [],
|
|
630
|
-
error: "Refusing to close the clear mesh port: the TLS listener (:6443) is not up yet, so no node could reach the hub."
|
|
631
|
-
};
|
|
632
|
-
const blocking = control.listOnlineAgents().filter((agent) => agent.transport !== "tls").map((agent) => agent.nodeId).toSorted();
|
|
633
|
-
if (blocking.length > 0) return {
|
|
634
|
-
allowed: false,
|
|
635
|
-
blocking,
|
|
636
|
-
error: `Refusing to close the clear mesh port: ${blocking.join(", ")} still ${blocking.length === 1 ? "connects" : "connect"} in clear. Enroll ${blocking.length === 1 ? "it" : "each"} with a join token first (System → Cluster → Add agent).`
|
|
637
|
-
};
|
|
638
|
-
return { allowed: true };
|
|
610
|
+
//#region src/kernel/moleculer/mesh-mtls/mesh-peer-transport.ts
|
|
611
|
+
var LOOKUP_SLOT = Symbol.for("camstack.cluster.mesh-peer-transport-lookup");
|
|
612
|
+
/** Published by the hub broker owner; cleared on shutdown. */
|
|
613
|
+
function setProcessMeshPeerTransportLookup(lookup) {
|
|
614
|
+
if (lookup === null) Reflect.deleteProperty(globalThis, LOOKUP_SLOT);
|
|
615
|
+
else Reflect.set(globalThis, LOOKUP_SLOT, lookup);
|
|
639
616
|
}
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
function setProcessMeshClearPortControl(control) {
|
|
643
|
-
if (control === null) Reflect.deleteProperty(globalThis, CONTROL_SLOT);
|
|
644
|
-
else Reflect.set(globalThis, CONTROL_SLOT, control);
|
|
617
|
+
function isMeshPeerTransportLookup(value) {
|
|
618
|
+
return value !== null && typeof value === "object" && typeof Reflect.get(value, "transportOf") === "function";
|
|
645
619
|
}
|
|
646
|
-
function
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
function getProcessMeshClearPortControl() {
|
|
650
|
-
const value = Reflect.get(globalThis, CONTROL_SLOT);
|
|
651
|
-
return isMeshClearPortControl(value) ? value : null;
|
|
620
|
+
function getProcessMeshPeerTransportLookup() {
|
|
621
|
+
const value = Reflect.get(globalThis, LOOKUP_SLOT);
|
|
622
|
+
return isMeshPeerTransportLookup(value) ? value : null;
|
|
652
623
|
}
|
|
653
624
|
/** `tls` / `clear` for an agent as the hub sees it; `undefined` off the hub. */
|
|
654
625
|
function getProcessNodeMeshTransport(nodeId) {
|
|
655
|
-
return
|
|
656
|
-
}
|
|
657
|
-
/**
|
|
658
|
-
* Validate a requested mode against the live mesh. `on` is always allowed; `off`
|
|
659
|
-
* only when {@link decideMeshClearPortOff} allows. Does NOT apply it.
|
|
660
|
-
*/
|
|
661
|
-
function checkProcessMeshClearPort(mode) {
|
|
662
|
-
if (mode === "on") return { allowed: true };
|
|
663
|
-
return decideMeshClearPortOff(getProcessMeshClearPortControl());
|
|
664
|
-
}
|
|
665
|
-
/** Apply a mode that {@link checkProcessMeshClearPort} allowed. No-op where nobody can. */
|
|
666
|
-
async function applyProcessMeshClearPort(mode) {
|
|
667
|
-
const control = getProcessMeshClearPortControl();
|
|
668
|
-
if (control === null) return false;
|
|
669
|
-
await control.apply(mode);
|
|
670
|
-
return true;
|
|
626
|
+
return getProcessMeshPeerTransportLookup()?.transportOf(nodeId);
|
|
671
627
|
}
|
|
672
628
|
//#endregion
|
|
673
629
|
//#region ../../node_modules/jose/dist/webapi/lib/buffer_utils.js
|
|
@@ -87469,11 +87425,12 @@ import_moleculer.default.Validators;
|
|
|
87469
87425
|
//#endregion
|
|
87470
87426
|
//#region src/kernel/moleculer/mesh-mtls/tls-tcp-transporter.ts
|
|
87471
87427
|
/**
|
|
87472
|
-
* Moleculer TCP transporter with a
|
|
87428
|
+
* Moleculer TCP transporter with a mutual-TLS listener (D826).
|
|
87473
87429
|
*
|
|
87474
|
-
* Hub
|
|
87475
|
-
*
|
|
87476
|
-
*
|
|
87430
|
+
* Hub: `hubTlsOnly` — no clear TCP reader and no UDP discovery; TLS 1.3 on
|
|
87431
|
+
* `tlsPort` (default 6443) once mesh material is ready. Agents without mesh
|
|
87432
|
+
* material use clear TCP on their own listen port and dial the hub on TLS when
|
|
87433
|
+
* enrolled. On a TLS socket, any packet whose `sender` ≠ the peer certificate CN
|
|
87477
87434
|
* is dropped.
|
|
87478
87435
|
*/
|
|
87479
87436
|
var TcpTransporterBase = Transporters.TCP;
|
|
@@ -87517,6 +87474,7 @@ var TlsTcpTransporter = class extends TcpTransporterBase {
|
|
|
87517
87474
|
/** Node id (certificate CN) → serial of every peer that completed a mutual-TLS handshake. */
|
|
87518
87475
|
tlsPeers = /* @__PURE__ */ new Map();
|
|
87519
87476
|
clearDisabled = false;
|
|
87477
|
+
hubTlsOnly;
|
|
87520
87478
|
/** Clear-text `TcpWriter.connect` captured once before the TLS wrap (A→B). */
|
|
87521
87479
|
clearWriterConnect = null;
|
|
87522
87480
|
writerTlsPatched = false;
|
|
@@ -87524,6 +87482,7 @@ var TlsTcpTransporter = class extends TcpTransporterBase {
|
|
|
87524
87482
|
super({ ...opts });
|
|
87525
87483
|
this.meshTls = opts.meshTls ?? null;
|
|
87526
87484
|
this.crl = opts.crl ?? processMeshCrl();
|
|
87485
|
+
this.hubTlsOnly = opts.hubTlsOnly === true;
|
|
87527
87486
|
if (this.opts.tlsPort === void 0) this.opts.tlsPort = require_constants$8.DEFAULT_HUB_TLS_TCP_PORT;
|
|
87528
87487
|
}
|
|
87529
87488
|
startTcpServer() {
|
|
@@ -87534,7 +87493,9 @@ var TlsTcpTransporter = class extends TcpTransporterBase {
|
|
|
87534
87493
|
connect() {
|
|
87535
87494
|
return this.Promise.resolve().then(() => {
|
|
87536
87495
|
if (this.opts.urls) return this.loadUrls();
|
|
87537
|
-
}).then(() => this.startTcpServer()).then(() =>
|
|
87496
|
+
}).then(() => this.startTcpServer()).then(() => {
|
|
87497
|
+
if (this.hubTlsOnly) this.disableClearTransport();
|
|
87498
|
+
}).then(() => this.startTlsServerIfReady()).then(() => this.hubTlsOnly ? this.Promise.resolve() : this.startUdpServer()).then(() => this.startTimers()).then(() => {
|
|
87538
87499
|
this.logger.info("TCP Transporter started.");
|
|
87539
87500
|
this.connected = true;
|
|
87540
87501
|
this.nodes.localNode.port = this.opts.port;
|
|
@@ -87684,6 +87645,7 @@ var TlsTcpTransporter = class extends TcpTransporterBase {
|
|
|
87684
87645
|
}
|
|
87685
87646
|
/** The switch back: listen on the clear port again and restart UDP discovery. Idempotent. */
|
|
87686
87647
|
async enableClearTransport() {
|
|
87648
|
+
if (this.hubTlsOnly) return;
|
|
87687
87649
|
if (!this.clearDisabled) return;
|
|
87688
87650
|
this.clearDisabled = false;
|
|
87689
87651
|
if (this.reader !== null && this.reader.server?.listening !== true) await this.reader.listen();
|
|
@@ -87971,7 +87933,7 @@ var mintJoinTokenInputSchema = zod.z.object({
|
|
|
87971
87933
|
nodeId: zod.z.string().min(1).optional(),
|
|
87972
87934
|
/** Override hub HTTPS base (default: local-network publicEndpoint). */
|
|
87973
87935
|
hubUrl: zod.z.string().url().optional(),
|
|
87974
|
-
/** Override `host:
|
|
87936
|
+
/** Override `host:6443` TLS mesh address carried in the token. */
|
|
87975
87937
|
hubMeshAddress: zod.z.string().min(3).optional(),
|
|
87976
87938
|
/** Seconds until expiry; capped at 1 h. */
|
|
87977
87939
|
ttlSec: zod.z.number().int().positive().max(3600).optional()
|
|
@@ -88072,9 +88034,7 @@ var KEY_TO_SECTION = {
|
|
|
88072
88034
|
trustedProxies: "auth",
|
|
88073
88035
|
trustedNetworks: "auth",
|
|
88074
88036
|
[CLUSTER_SECRET_FIELD]: "cluster",
|
|
88075
|
-
[MESH_AUTH_MODE_FIELD]: "cluster"
|
|
88076
|
-
[MESH_CLEAR_PORT_FIELD]: "cluster",
|
|
88077
|
-
[AGENT_DASHBOARD_ORIGINS_FIELD]: "cluster"
|
|
88037
|
+
[MESH_AUTH_MODE_FIELD]: "cluster"
|
|
88078
88038
|
};
|
|
88079
88039
|
/** Bytes of a generated cluster secret (D802) — 256 bits, base64url (43 chars). */
|
|
88080
88040
|
var GENERATED_SECRET_BYTES = 32;
|
|
@@ -88130,7 +88090,6 @@ var SystemConfigAddon = class extends require_dist.BaseAddon {
|
|
|
88130
88090
|
onReady: (ca) => this.onMeshCaReady(ca)
|
|
88131
88091
|
});
|
|
88132
88092
|
await this.meshCaKeeper.start();
|
|
88133
|
-
await this.applyStoredClearPort();
|
|
88134
88093
|
this.ctx.logger.info("Initialized — exposes yml-backed sections via getGlobalSettings");
|
|
88135
88094
|
return {
|
|
88136
88095
|
customActions: systemConfigMeshActions,
|
|
@@ -88147,20 +88106,6 @@ var SystemConfigAddon = class extends require_dist.BaseAddon {
|
|
|
88147
88106
|
this.clusterSecretKeeper?.stop();
|
|
88148
88107
|
this.clusterSecretKeeper = null;
|
|
88149
88108
|
}
|
|
88150
|
-
/**
|
|
88151
|
-
* Boot: a stored `meshClearPort: off` is the operator's standing choice, so it
|
|
88152
|
-
* is applied WITHOUT the agents gate (nobody is connected yet to be checked).
|
|
88153
|
-
* Default `on` changes nothing.
|
|
88154
|
-
*/
|
|
88155
|
-
async applyStoredClearPort() {
|
|
88156
|
-
try {
|
|
88157
|
-
const stored = (await this.ctx.settings?.getSection("cluster"))?.[MESH_CLEAR_PORT_FIELD];
|
|
88158
|
-
if (parseMeshClearPortMode(stored) !== "off") return;
|
|
88159
|
-
if (await applyProcessMeshClearPort("off")) this.ctx.logger.info("Mesh clear port is OFF (cluster.meshClearPort)");
|
|
88160
|
-
} catch (err) {
|
|
88161
|
-
this.ctx.logger.warn("could not apply cluster.meshClearPort at boot", { meta: { error: require_dist.errMsg(err) } });
|
|
88162
|
-
}
|
|
88163
|
-
}
|
|
88164
88109
|
async onMeshCaReady(ca) {
|
|
88165
88110
|
const hubLeaf = await issueMeshLeafForNode(ca, "hub");
|
|
88166
88111
|
await requestProcessMeshTlsEnable({
|
|
@@ -88238,10 +88183,10 @@ var SystemConfigAddon = class extends require_dist.BaseAddon {
|
|
|
88238
88183
|
async resolveHubMeshAddress() {
|
|
88239
88184
|
try {
|
|
88240
88185
|
const base = (await this.ctx.api?.localNetwork?.getAddresses?.query({}))?.roles?.internal?.resolved;
|
|
88241
|
-
if (typeof base === "string" && base.length > 0) return `${new URL(base).hostname}:${require_constants$8.
|
|
88186
|
+
if (typeof base === "string" && base.length > 0) return `${new URL(base).hostname}:${require_constants$8.DEFAULT_HUB_TLS_TCP_PORT}`;
|
|
88242
88187
|
} catch {}
|
|
88243
88188
|
const host = (await this.ctx.settings?.getSection("server"))?.["host"];
|
|
88244
|
-
return `${typeof host === "string" && host.length > 0 && host !== "0.0.0.0" ? host : "127.0.0.1"}:${require_constants$8.
|
|
88189
|
+
return `${typeof host === "string" && host.length > 0 && host !== "0.0.0.0" ? host : "127.0.0.1"}:${require_constants$8.DEFAULT_HUB_TLS_TCP_PORT}`;
|
|
88245
88190
|
}
|
|
88246
88191
|
/** The keychain handle for owner `system`; `null` where there is no door. */
|
|
88247
88192
|
systemSecrets() {
|
|
@@ -88337,52 +88282,18 @@ var SystemConfigAddon = class extends require_dist.BaseAddon {
|
|
|
88337
88282
|
title: SECTION_TITLES["cluster"],
|
|
88338
88283
|
description: "Agents joining this hub. Every agent proves the cluster secret when it connects (challenge–response; the secret never crosses the network).",
|
|
88339
88284
|
columns: 1,
|
|
88340
|
-
fields: [
|
|
88341
|
-
|
|
88342
|
-
|
|
88343
|
-
|
|
88344
|
-
|
|
88345
|
-
|
|
88346
|
-
|
|
88347
|
-
|
|
88348
|
-
|
|
88349
|
-
|
|
88350
|
-
|
|
88351
|
-
|
|
88352
|
-
default: "on",
|
|
88353
|
-
options: [{
|
|
88354
|
-
value: "on",
|
|
88355
|
-
label: "On — accept clear agents"
|
|
88356
|
-
}, {
|
|
88357
|
-
value: "off",
|
|
88358
|
-
label: "Off — mutual TLS only"
|
|
88359
|
-
}]
|
|
88360
|
-
},
|
|
88361
|
-
{
|
|
88362
|
-
type: "info",
|
|
88363
|
-
key: "meshAuthStatus",
|
|
88364
|
-
label: "Mesh authentication",
|
|
88365
|
-
content: describeMeshStatus(getProcessMeshAuthStatus()),
|
|
88366
|
-
variant: "info"
|
|
88367
|
-
},
|
|
88368
|
-
{
|
|
88369
|
-
type: "text",
|
|
88370
|
-
key: AGENT_DASHBOARD_ORIGINS_FIELD,
|
|
88371
|
-
label: "Agent dashboard origins (NPM)",
|
|
88372
|
-
description: "Extra origins allowed for Continue-with-hub unlock redirects (comma-separated), e.g. https://agent.example.com. LAN agents on :4444 are always allowed."
|
|
88373
|
-
},
|
|
88374
|
-
{
|
|
88375
|
-
type: "addon-action-button",
|
|
88376
|
-
key: "mintJoinTokenAction",
|
|
88377
|
-
label: "Add agent",
|
|
88378
|
-
description: "Mint a single-use join token (≤ 1 hour). Paste it into the agent setup instead of copying the cluster secret. The token is shown once in the result.",
|
|
88379
|
-
addonId: "system-config",
|
|
88380
|
-
action: "mintJoinToken",
|
|
88381
|
-
buttonLabel: "Add agent",
|
|
88382
|
-
variant: "primary",
|
|
88383
|
-
successMessage: "Join token (copy now): {token}"
|
|
88384
|
-
}
|
|
88385
|
-
]
|
|
88285
|
+
fields: [{
|
|
88286
|
+
type: "password",
|
|
88287
|
+
key: CLUSTER_SECRET_FIELD,
|
|
88288
|
+
label: "Cluster secret",
|
|
88289
|
+
description: "Mandatory — generated by the hub at first boot and stored in the keychain. To pair an agent: Reveal and copy it here, then enter it in the agent (its status page, or the desktop setup window). Saving a new value rotates it: every agent must then be given the new one."
|
|
88290
|
+
}, {
|
|
88291
|
+
type: "info",
|
|
88292
|
+
key: "meshAuthStatus",
|
|
88293
|
+
label: "Mesh authentication",
|
|
88294
|
+
content: describeMeshStatus(getProcessMeshAuthStatus()),
|
|
88295
|
+
variant: "info"
|
|
88296
|
+
}]
|
|
88386
88297
|
}
|
|
88387
88298
|
] };
|
|
88388
88299
|
}
|
|
@@ -88406,7 +88317,7 @@ var SystemConfigAddon = class extends require_dist.BaseAddon {
|
|
|
88406
88317
|
/**
|
|
88407
88318
|
* The admin UI / `addonSettings` cap prefer {@link BaseAddon.updateGlobalSettingsAsOperator}.
|
|
88408
88319
|
* That BaseAddon path writes the generic addon store and never reaches
|
|
88409
|
-
* {@link writeClusterSection}
|
|
88320
|
+
* {@link writeClusterSection}. Route the operator
|
|
88410
88321
|
* write through the same section-aware path as {@link updateGlobalSettings}.
|
|
88411
88322
|
*/
|
|
88412
88323
|
async updateGlobalSettingsAsOperator(patch, _nodeId) {
|
|
@@ -88416,6 +88327,14 @@ var SystemConfigAddon = class extends require_dist.BaseAddon {
|
|
|
88416
88327
|
if (!this.ctx.settings) throw new Error("system-config: ctx.settings not available — cannot write sections");
|
|
88417
88328
|
const perSection = /* @__PURE__ */ new Map();
|
|
88418
88329
|
for (const [key, value] of Object.entries(patch)) {
|
|
88330
|
+
if (key === "meshClearPort") {
|
|
88331
|
+
this.ctx.logger.warn("cluster.meshClearPort is retired (D826) — the hub mesh is TLS-only; ignoring this patch");
|
|
88332
|
+
continue;
|
|
88333
|
+
}
|
|
88334
|
+
if (key === "agentDashboardOrigins") {
|
|
88335
|
+
this.ctx.logger.warn("cluster.agentDashboardOrigins is no longer writable from settings — ignoring this patch");
|
|
88336
|
+
continue;
|
|
88337
|
+
}
|
|
88419
88338
|
const section = KEY_TO_SECTION[key];
|
|
88420
88339
|
if (section === void 0) {
|
|
88421
88340
|
this.ctx.logger.warn("update ignored unknown key (not mapped to any section)", { meta: { key } });
|
|
@@ -88456,9 +88375,7 @@ var SystemConfigAddon = class extends require_dist.BaseAddon {
|
|
|
88456
88375
|
* enforced (D821) — a legacy `meshAuth` in the patch is ignored.
|
|
88457
88376
|
*/
|
|
88458
88377
|
async writeClusterSection(patch) {
|
|
88459
|
-
const { [MESH_AUTH_MODE_FIELD]: _legacyMode,
|
|
88460
|
-
if (clearPort !== void 0) await this.writeMeshClearPort(clearPort);
|
|
88461
|
-
if (dashboardOrigins !== void 0) await this.ctx.settings.setSection("cluster", { [AGENT_DASHBOARD_ORIGINS_FIELD]: typeof dashboardOrigins === "string" ? dashboardOrigins : "" });
|
|
88378
|
+
const { [MESH_AUTH_MODE_FIELD]: _legacyMode, ...secretPatch } = patch;
|
|
88462
88379
|
await this.writeMeshAuthMode("enforced");
|
|
88463
88380
|
if (Object.keys(secretPatch).length === 0) return;
|
|
88464
88381
|
if (require_dist.isSecretClear(secretPatch["clusterSecret"])) throw new Error("The cluster secret is mandatory and cannot be cleared — save a new value to rotate it");
|
|
@@ -88466,27 +88383,6 @@ var SystemConfigAddon = class extends require_dist.BaseAddon {
|
|
|
88466
88383
|
this.ctx.logger.info("Cluster secret updated");
|
|
88467
88384
|
await this.clusterSecretKeeper?.reload();
|
|
88468
88385
|
}
|
|
88469
|
-
/**
|
|
88470
|
-
* `cluster.meshClearPort`: `off` is REFUSED while any online agent still
|
|
88471
|
-
* connects in clear (or the TLS listener is not up); the refusal names them.
|
|
88472
|
-
* Persist, then apply — an `on` save always passes.
|
|
88473
|
-
*/
|
|
88474
|
-
async writeMeshClearPort(value) {
|
|
88475
|
-
if (!isMeshClearPortMode(value)) throw new Error(`system-config: meshClearPort must be 'on' or 'off'`);
|
|
88476
|
-
const stored = (await this.ctx.settings.getSection("cluster"))[MESH_CLEAR_PORT_FIELD];
|
|
88477
|
-
if (parseMeshClearPortMode(stored) === value) return;
|
|
88478
|
-
const decision = checkProcessMeshClearPort(value);
|
|
88479
|
-
if (!decision.allowed) {
|
|
88480
|
-
this.ctx.logger.warn("mesh clear port switch-off refused", { meta: {
|
|
88481
|
-
blocking: decision.blocking,
|
|
88482
|
-
error: decision.error
|
|
88483
|
-
} });
|
|
88484
|
-
throw new Error(decision.error);
|
|
88485
|
-
}
|
|
88486
|
-
await this.ctx.settings.setSection("cluster", { [MESH_CLEAR_PORT_FIELD]: value });
|
|
88487
|
-
await applyProcessMeshClearPort(value);
|
|
88488
|
-
this.ctx.logger.info("Mesh clear port switched", { meta: { mode: value } });
|
|
88489
|
-
}
|
|
88490
88386
|
/** Persist + publish mesh auth mode (always `enforced` after D821). */
|
|
88491
88387
|
async writeMeshAuthMode(mode) {
|
|
88492
88388
|
await this.ctx.settings.setSection("cluster", { [MESH_AUTH_MODE_FIELD]: mode });
|
|
@@ -88572,7 +88468,6 @@ exports.AGENT_UI_UNLOCK_VERSION = AGENT_UI_UNLOCK_VERSION;
|
|
|
88572
88468
|
exports.Errors = Errors;
|
|
88573
88469
|
exports.JoinTokenJtiStore = JoinTokenJtiStore;
|
|
88574
88470
|
exports.MESH_AUTH_MODE_FIELD = MESH_AUTH_MODE_FIELD;
|
|
88575
|
-
exports.MESH_CLEAR_PORT_FIELD = MESH_CLEAR_PORT_FIELD;
|
|
88576
88471
|
exports.MeshCaKeeper = MeshCaKeeper;
|
|
88577
88472
|
exports.MeshCrl = MeshCrl;
|
|
88578
88473
|
exports.SYSTEM_CONFIG_CLUSTER_SECTION_ID = SYSTEM_CONFIG_CLUSTER_SECTION_ID;
|
|
@@ -88581,13 +88476,10 @@ exports.SystemConfigAddon = SystemConfigAddon;
|
|
|
88581
88476
|
exports.default = SystemConfigAddon;
|
|
88582
88477
|
exports.TlsTcpTransporter = TlsTcpTransporter;
|
|
88583
88478
|
exports.UnlockTicketJtiStore = UnlockTicketJtiStore;
|
|
88584
|
-
exports.applyProcessMeshClearPort = applyProcessMeshClearPort;
|
|
88585
88479
|
exports.caFingerprint = caFingerprint;
|
|
88586
88480
|
exports.caFingerprintCompact = caFingerprintCompact;
|
|
88587
|
-
exports.checkProcessMeshClearPort = checkProcessMeshClearPort;
|
|
88588
88481
|
exports.createCidrMatcher = createCidrMatcher;
|
|
88589
88482
|
exports.createMeshCsrPem = createMeshCsrPem;
|
|
88590
|
-
exports.decideMeshClearPortOff = decideMeshClearPortOff;
|
|
88591
88483
|
exports.enrollMeshNode = enrollMeshNode;
|
|
88592
88484
|
exports.exportMeshPrivateKeyPem = exportMeshPrivateKeyPem;
|
|
88593
88485
|
exports.generateMeshCa = generateMeshCa;
|
|
@@ -88614,8 +88506,8 @@ exports.requestProcessMeshEnforcement = requestProcessMeshEnforcement;
|
|
|
88614
88506
|
exports.requireProcessMeshCa = requireProcessMeshCa;
|
|
88615
88507
|
exports.setProcessMeshAuthMode = setProcessMeshAuthMode;
|
|
88616
88508
|
exports.setProcessMeshAuthStatusSource = setProcessMeshAuthStatusSource;
|
|
88617
|
-
exports.setProcessMeshClearPortControl = setProcessMeshClearPortControl;
|
|
88618
88509
|
exports.setProcessMeshEnforcer = setProcessMeshEnforcer;
|
|
88510
|
+
exports.setProcessMeshPeerTransportLookup = setProcessMeshPeerTransportLookup;
|
|
88619
88511
|
exports.setProcessMeshTlsEnabler = setProcessMeshTlsEnabler;
|
|
88620
88512
|
exports.systemConfigMeshActions = systemConfigMeshActions;
|
|
88621
88513
|
exports.verifyAgentUiUnlockTicket = verifyAgentUiUnlockTicket;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
|
|
2
2
|
import { Br as makeSecretMarker, Dr as customAction, Lr as isSecretClear, Nr as hydrateSchema, Or as defineCustomActions, Qr as secretTreeFromSchema, Rr as isSecretMarker, dr as BaseAddon, ni as transformSecretWrite, ur as errMsg } from "../../dist-0P1gm4Gd.mjs";
|
|
3
3
|
import { n as require_safe_buffer, t as require_ms } from "../../ms-DlIWNkkk.mjs";
|
|
4
|
-
import { a as
|
|
4
|
+
import { a as MESH_CA_KEY_REF, b as setProcessClusterSecretGate, c as MESH_JOIN_TOKEN_MAX_TTL_SEC, d as CLUSTER_SECRET_REF, i as MESH_CA_FIELD, l as SERVER_AUTH_OID, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID, v as hashClusterSecret } from "../../constants-5vADty9I.mjs";
|
|
5
5
|
import { a as KeyUsagesExtension, c as Pkcs10CertificateRequestGenerator, d as X509Certificate$1, f as X509CertificateGenerator, i as KeyUsageFlags, n as BasicConstraintsExtension, o as PemConverter, p as cryptoProvider, r as ExtendedKeyUsageExtension, s as Pkcs10CertificateRequest, t as AuthorityKeyIdentifierExtension, u as SubjectKeyIdentifierExtension } from "../../x509.es-Xf3K_brW.mjs";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { X509Certificate, createHash, createHmac, randomBytes, timingSafeEqual, webcrypto } from "node:crypto";
|
|
@@ -12,7 +12,7 @@ import { fileURLToPath } from "node:url";
|
|
|
12
12
|
import * as xi from "node:fs";
|
|
13
13
|
import * as tls from "node:tls";
|
|
14
14
|
import { EventEmitter } from "node:events";
|
|
15
|
-
import
|
|
15
|
+
import As from "node:stream";
|
|
16
16
|
import { StringDecoder } from "node:string_decoder";
|
|
17
17
|
import { lstatSync, readdir as readdir$1, readdirSync as readdirSync$1, readlinkSync, realpathSync } from "fs";
|
|
18
18
|
import "path";
|
|
@@ -598,67 +598,23 @@ function processMeshCrl() {
|
|
|
598
598
|
return crl;
|
|
599
599
|
}
|
|
600
600
|
//#endregion
|
|
601
|
-
//#region src/kernel/moleculer/mesh-mtls/mesh-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
function
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
/** A stored value that is not a mode reads as `on`: never cut the mesh on a typo. */
|
|
608
|
-
function parseMeshClearPortMode(value) {
|
|
609
|
-
return isMeshClearPortMode(value) ? value : "on";
|
|
610
|
-
}
|
|
611
|
-
/** Pure: may the clear port be switched off right now? */
|
|
612
|
-
function decideMeshClearPortOff(control) {
|
|
613
|
-
if (control === null) return {
|
|
614
|
-
allowed: false,
|
|
615
|
-
blocking: [],
|
|
616
|
-
error: "The clear mesh port can only be switched off on the hub (no mesh transport here)."
|
|
617
|
-
};
|
|
618
|
-
if (!control.isTlsListening()) return {
|
|
619
|
-
allowed: false,
|
|
620
|
-
blocking: [],
|
|
621
|
-
error: "Refusing to close the clear mesh port: the TLS listener (:6443) is not up yet, so no node could reach the hub."
|
|
622
|
-
};
|
|
623
|
-
const blocking = control.listOnlineAgents().filter((agent) => agent.transport !== "tls").map((agent) => agent.nodeId).toSorted();
|
|
624
|
-
if (blocking.length > 0) return {
|
|
625
|
-
allowed: false,
|
|
626
|
-
blocking,
|
|
627
|
-
error: `Refusing to close the clear mesh port: ${blocking.join(", ")} still ${blocking.length === 1 ? "connects" : "connect"} in clear. Enroll ${blocking.length === 1 ? "it" : "each"} with a join token first (System → Cluster → Add agent).`
|
|
628
|
-
};
|
|
629
|
-
return { allowed: true };
|
|
601
|
+
//#region src/kernel/moleculer/mesh-mtls/mesh-peer-transport.ts
|
|
602
|
+
var LOOKUP_SLOT = Symbol.for("camstack.cluster.mesh-peer-transport-lookup");
|
|
603
|
+
/** Published by the hub broker owner; cleared on shutdown. */
|
|
604
|
+
function setProcessMeshPeerTransportLookup(lookup) {
|
|
605
|
+
if (lookup === null) Reflect.deleteProperty(globalThis, LOOKUP_SLOT);
|
|
606
|
+
else Reflect.set(globalThis, LOOKUP_SLOT, lookup);
|
|
630
607
|
}
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
function setProcessMeshClearPortControl(control) {
|
|
634
|
-
if (control === null) Reflect.deleteProperty(globalThis, CONTROL_SLOT);
|
|
635
|
-
else Reflect.set(globalThis, CONTROL_SLOT, control);
|
|
608
|
+
function isMeshPeerTransportLookup(value) {
|
|
609
|
+
return value !== null && typeof value === "object" && typeof Reflect.get(value, "transportOf") === "function";
|
|
636
610
|
}
|
|
637
|
-
function
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
function getProcessMeshClearPortControl() {
|
|
641
|
-
const value = Reflect.get(globalThis, CONTROL_SLOT);
|
|
642
|
-
return isMeshClearPortControl(value) ? value : null;
|
|
611
|
+
function getProcessMeshPeerTransportLookup() {
|
|
612
|
+
const value = Reflect.get(globalThis, LOOKUP_SLOT);
|
|
613
|
+
return isMeshPeerTransportLookup(value) ? value : null;
|
|
643
614
|
}
|
|
644
615
|
/** `tls` / `clear` for an agent as the hub sees it; `undefined` off the hub. */
|
|
645
616
|
function getProcessNodeMeshTransport(nodeId) {
|
|
646
|
-
return
|
|
647
|
-
}
|
|
648
|
-
/**
|
|
649
|
-
* Validate a requested mode against the live mesh. `on` is always allowed; `off`
|
|
650
|
-
* only when {@link decideMeshClearPortOff} allows. Does NOT apply it.
|
|
651
|
-
*/
|
|
652
|
-
function checkProcessMeshClearPort(mode) {
|
|
653
|
-
if (mode === "on") return { allowed: true };
|
|
654
|
-
return decideMeshClearPortOff(getProcessMeshClearPortControl());
|
|
655
|
-
}
|
|
656
|
-
/** Apply a mode that {@link checkProcessMeshClearPort} allowed. No-op where nobody can. */
|
|
657
|
-
async function applyProcessMeshClearPort(mode) {
|
|
658
|
-
const control = getProcessMeshClearPortControl();
|
|
659
|
-
if (control === null) return false;
|
|
660
|
-
await control.apply(mode);
|
|
661
|
-
return true;
|
|
617
|
+
return getProcessMeshPeerTransportLookup()?.transportOf(nodeId);
|
|
662
618
|
}
|
|
663
619
|
//#endregion
|
|
664
620
|
//#region ../../node_modules/jose/dist/webapi/lib/buffer_utils.js
|
|
@@ -84424,7 +84380,7 @@ var xs = new Set([
|
|
|
84424
84380
|
"+",
|
|
84425
84381
|
"*",
|
|
84426
84382
|
"@"
|
|
84427
|
-
]), be = (n) => xs.has(n), vs = "(?!(?:^|/)\\.\\.?(?:$|/))", Ct = "(?!\\.)", Cs = new Set(["[", "."]), Ts = new Set(["..", "."]), As = /* @__PURE__ */ new Set("().*{}+?[]^$\\!"), ks = (n) => n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), Kt$1 = "[^/]", Se = Kt$1 + "*?", Ee = Kt$1 + "+?", Q = class n {
|
|
84383
|
+
]), be = (n) => xs.has(n), vs = "(?!(?:^|/)\\.\\.?(?:$|/))", Ct = "(?!\\.)", Cs = new Set(["[", "."]), Ts = new Set(["..", "."]), As$1 = /* @__PURE__ */ new Set("().*{}+?[]^$\\!"), ks = (n) => n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), Kt$1 = "[^/]", Se = Kt$1 + "*?", Ee = Kt$1 + "+?", Q = class n {
|
|
84428
84384
|
type;
|
|
84429
84385
|
#t;
|
|
84430
84386
|
#s;
|
|
@@ -84631,7 +84587,7 @@ var xs = new Set([
|
|
|
84631
84587
|
for (let a = 0; a < t.length; a++) {
|
|
84632
84588
|
let l = t.charAt(a);
|
|
84633
84589
|
if (i) {
|
|
84634
|
-
i = !1, r += (As.has(l) ? "\\" : "") + l;
|
|
84590
|
+
i = !1, r += (As$1.has(l) ? "\\" : "") + l;
|
|
84635
84591
|
continue;
|
|
84636
84592
|
}
|
|
84637
84593
|
if (l === "*") {
|
|
@@ -85615,7 +85571,7 @@ var q = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n), De = (n) => q(n
|
|
|
85615
85571
|
var Ne = typeof process == "object" && process ? process : {
|
|
85616
85572
|
stdout: null,
|
|
85617
85573
|
stderr: null
|
|
85618
|
-
}, oi = (n) => !!n && typeof n == "object" && (n instanceof V || n instanceof
|
|
85574
|
+
}, oi = (n) => !!n && typeof n == "object" && (n instanceof V || n instanceof As || hi(n) || ai(n)), hi = (n) => !!n && typeof n == "object" && n instanceof EventEmitter && typeof n.pipe == "function" && n.pipe !== As.Writable.prototype.pipe, ai = (n) => !!n && typeof n == "object" && n instanceof EventEmitter && typeof n.write == "function" && typeof n.end == "function", G = Symbol("EOF"), H = Symbol("maybeEmitEnd"), K = Symbol("emittedEnd"), kt = Symbol("emittingEnd"), ut = Symbol("emittedError"), Rt = Symbol("closed"), _e = Symbol("read"), Ot = Symbol("flush"), Le = Symbol("flushChunk"), P = Symbol("encoding"), et = Symbol("decoder"), v = Symbol("flowing"), dt = Symbol("paused"), st = Symbol("resume"), C = Symbol("buffer"), F = Symbol("pipes"), T = Symbol("bufferLength"), Yt = Symbol("bufferPush"), Ft = Symbol("bufferShift"), k = Symbol("objectMode"), x = Symbol("destroyed"), Xt = Symbol("error"), Jt = Symbol("emitData"), We = Symbol("emitEnd"), Zt = Symbol("emitEnd2"), B = Symbol("async"), Qt = Symbol("abort"), Dt = Symbol("aborted"), pt = Symbol("signal"), Y = Symbol("dataListeners"), M = Symbol("discarded"), mt = (n) => Promise.resolve().then(n), li = (n) => n(), ci = (n) => n === "end" || n === "finish" || n === "prefinish", fi = (n) => n instanceof ArrayBuffer || !!n && typeof n == "object" && n.constructor && n.constructor.name === "ArrayBuffer" && n.byteLength >= 0, ui = (n) => !Buffer.isBuffer(n) && ArrayBuffer.isView(n), Mt = class {
|
|
85619
85575
|
src;
|
|
85620
85576
|
dest;
|
|
85621
85577
|
opts;
|
|
@@ -87460,11 +87416,12 @@ import_moleculer.default.Validators;
|
|
|
87460
87416
|
//#endregion
|
|
87461
87417
|
//#region src/kernel/moleculer/mesh-mtls/tls-tcp-transporter.ts
|
|
87462
87418
|
/**
|
|
87463
|
-
* Moleculer TCP transporter with a
|
|
87419
|
+
* Moleculer TCP transporter with a mutual-TLS listener (D826).
|
|
87464
87420
|
*
|
|
87465
|
-
* Hub
|
|
87466
|
-
*
|
|
87467
|
-
*
|
|
87421
|
+
* Hub: `hubTlsOnly` — no clear TCP reader and no UDP discovery; TLS 1.3 on
|
|
87422
|
+
* `tlsPort` (default 6443) once mesh material is ready. Agents without mesh
|
|
87423
|
+
* material use clear TCP on their own listen port and dial the hub on TLS when
|
|
87424
|
+
* enrolled. On a TLS socket, any packet whose `sender` ≠ the peer certificate CN
|
|
87468
87425
|
* is dropped.
|
|
87469
87426
|
*/
|
|
87470
87427
|
var TcpTransporterBase = Transporters.TCP;
|
|
@@ -87508,6 +87465,7 @@ var TlsTcpTransporter = class extends TcpTransporterBase {
|
|
|
87508
87465
|
/** Node id (certificate CN) → serial of every peer that completed a mutual-TLS handshake. */
|
|
87509
87466
|
tlsPeers = /* @__PURE__ */ new Map();
|
|
87510
87467
|
clearDisabled = false;
|
|
87468
|
+
hubTlsOnly;
|
|
87511
87469
|
/** Clear-text `TcpWriter.connect` captured once before the TLS wrap (A→B). */
|
|
87512
87470
|
clearWriterConnect = null;
|
|
87513
87471
|
writerTlsPatched = false;
|
|
@@ -87515,6 +87473,7 @@ var TlsTcpTransporter = class extends TcpTransporterBase {
|
|
|
87515
87473
|
super({ ...opts });
|
|
87516
87474
|
this.meshTls = opts.meshTls ?? null;
|
|
87517
87475
|
this.crl = opts.crl ?? processMeshCrl();
|
|
87476
|
+
this.hubTlsOnly = opts.hubTlsOnly === true;
|
|
87518
87477
|
if (this.opts.tlsPort === void 0) this.opts.tlsPort = DEFAULT_HUB_TLS_TCP_PORT;
|
|
87519
87478
|
}
|
|
87520
87479
|
startTcpServer() {
|
|
@@ -87525,7 +87484,9 @@ var TlsTcpTransporter = class extends TcpTransporterBase {
|
|
|
87525
87484
|
connect() {
|
|
87526
87485
|
return this.Promise.resolve().then(() => {
|
|
87527
87486
|
if (this.opts.urls) return this.loadUrls();
|
|
87528
|
-
}).then(() => this.startTcpServer()).then(() =>
|
|
87487
|
+
}).then(() => this.startTcpServer()).then(() => {
|
|
87488
|
+
if (this.hubTlsOnly) this.disableClearTransport();
|
|
87489
|
+
}).then(() => this.startTlsServerIfReady()).then(() => this.hubTlsOnly ? this.Promise.resolve() : this.startUdpServer()).then(() => this.startTimers()).then(() => {
|
|
87529
87490
|
this.logger.info("TCP Transporter started.");
|
|
87530
87491
|
this.connected = true;
|
|
87531
87492
|
this.nodes.localNode.port = this.opts.port;
|
|
@@ -87675,6 +87636,7 @@ var TlsTcpTransporter = class extends TcpTransporterBase {
|
|
|
87675
87636
|
}
|
|
87676
87637
|
/** The switch back: listen on the clear port again and restart UDP discovery. Idempotent. */
|
|
87677
87638
|
async enableClearTransport() {
|
|
87639
|
+
if (this.hubTlsOnly) return;
|
|
87678
87640
|
if (!this.clearDisabled) return;
|
|
87679
87641
|
this.clearDisabled = false;
|
|
87680
87642
|
if (this.reader !== null && this.reader.server?.listening !== true) await this.reader.listen();
|
|
@@ -87961,7 +87923,7 @@ var mintJoinTokenInputSchema = z.object({
|
|
|
87961
87923
|
nodeId: z.string().min(1).optional(),
|
|
87962
87924
|
/** Override hub HTTPS base (default: local-network publicEndpoint). */
|
|
87963
87925
|
hubUrl: z.string().url().optional(),
|
|
87964
|
-
/** Override `host:
|
|
87926
|
+
/** Override `host:6443` TLS mesh address carried in the token. */
|
|
87965
87927
|
hubMeshAddress: z.string().min(3).optional(),
|
|
87966
87928
|
/** Seconds until expiry; capped at 1 h. */
|
|
87967
87929
|
ttlSec: z.number().int().positive().max(3600).optional()
|
|
@@ -88062,9 +88024,7 @@ var KEY_TO_SECTION = {
|
|
|
88062
88024
|
trustedProxies: "auth",
|
|
88063
88025
|
trustedNetworks: "auth",
|
|
88064
88026
|
[CLUSTER_SECRET_FIELD]: "cluster",
|
|
88065
|
-
[MESH_AUTH_MODE_FIELD]: "cluster"
|
|
88066
|
-
[MESH_CLEAR_PORT_FIELD]: "cluster",
|
|
88067
|
-
[AGENT_DASHBOARD_ORIGINS_FIELD]: "cluster"
|
|
88027
|
+
[MESH_AUTH_MODE_FIELD]: "cluster"
|
|
88068
88028
|
};
|
|
88069
88029
|
/** Bytes of a generated cluster secret (D802) — 256 bits, base64url (43 chars). */
|
|
88070
88030
|
var GENERATED_SECRET_BYTES = 32;
|
|
@@ -88120,7 +88080,6 @@ var SystemConfigAddon = class extends BaseAddon {
|
|
|
88120
88080
|
onReady: (ca) => this.onMeshCaReady(ca)
|
|
88121
88081
|
});
|
|
88122
88082
|
await this.meshCaKeeper.start();
|
|
88123
|
-
await this.applyStoredClearPort();
|
|
88124
88083
|
this.ctx.logger.info("Initialized — exposes yml-backed sections via getGlobalSettings");
|
|
88125
88084
|
return {
|
|
88126
88085
|
customActions: systemConfigMeshActions,
|
|
@@ -88137,20 +88096,6 @@ var SystemConfigAddon = class extends BaseAddon {
|
|
|
88137
88096
|
this.clusterSecretKeeper?.stop();
|
|
88138
88097
|
this.clusterSecretKeeper = null;
|
|
88139
88098
|
}
|
|
88140
|
-
/**
|
|
88141
|
-
* Boot: a stored `meshClearPort: off` is the operator's standing choice, so it
|
|
88142
|
-
* is applied WITHOUT the agents gate (nobody is connected yet to be checked).
|
|
88143
|
-
* Default `on` changes nothing.
|
|
88144
|
-
*/
|
|
88145
|
-
async applyStoredClearPort() {
|
|
88146
|
-
try {
|
|
88147
|
-
const stored = (await this.ctx.settings?.getSection("cluster"))?.[MESH_CLEAR_PORT_FIELD];
|
|
88148
|
-
if (parseMeshClearPortMode(stored) !== "off") return;
|
|
88149
|
-
if (await applyProcessMeshClearPort("off")) this.ctx.logger.info("Mesh clear port is OFF (cluster.meshClearPort)");
|
|
88150
|
-
} catch (err) {
|
|
88151
|
-
this.ctx.logger.warn("could not apply cluster.meshClearPort at boot", { meta: { error: errMsg(err) } });
|
|
88152
|
-
}
|
|
88153
|
-
}
|
|
88154
88099
|
async onMeshCaReady(ca) {
|
|
88155
88100
|
const hubLeaf = await issueMeshLeafForNode(ca, "hub");
|
|
88156
88101
|
await requestProcessMeshTlsEnable({
|
|
@@ -88228,10 +88173,10 @@ var SystemConfigAddon = class extends BaseAddon {
|
|
|
88228
88173
|
async resolveHubMeshAddress() {
|
|
88229
88174
|
try {
|
|
88230
88175
|
const base = (await this.ctx.api?.localNetwork?.getAddresses?.query({}))?.roles?.internal?.resolved;
|
|
88231
|
-
if (typeof base === "string" && base.length > 0) return `${new URL(base).hostname}:${
|
|
88176
|
+
if (typeof base === "string" && base.length > 0) return `${new URL(base).hostname}:${DEFAULT_HUB_TLS_TCP_PORT}`;
|
|
88232
88177
|
} catch {}
|
|
88233
88178
|
const host = (await this.ctx.settings?.getSection("server"))?.["host"];
|
|
88234
|
-
return `${typeof host === "string" && host.length > 0 && host !== "0.0.0.0" ? host : "127.0.0.1"}:${
|
|
88179
|
+
return `${typeof host === "string" && host.length > 0 && host !== "0.0.0.0" ? host : "127.0.0.1"}:${DEFAULT_HUB_TLS_TCP_PORT}`;
|
|
88235
88180
|
}
|
|
88236
88181
|
/** The keychain handle for owner `system`; `null` where there is no door. */
|
|
88237
88182
|
systemSecrets() {
|
|
@@ -88327,52 +88272,18 @@ var SystemConfigAddon = class extends BaseAddon {
|
|
|
88327
88272
|
title: SECTION_TITLES["cluster"],
|
|
88328
88273
|
description: "Agents joining this hub. Every agent proves the cluster secret when it connects (challenge–response; the secret never crosses the network).",
|
|
88329
88274
|
columns: 1,
|
|
88330
|
-
fields: [
|
|
88331
|
-
|
|
88332
|
-
|
|
88333
|
-
|
|
88334
|
-
|
|
88335
|
-
|
|
88336
|
-
|
|
88337
|
-
|
|
88338
|
-
|
|
88339
|
-
|
|
88340
|
-
|
|
88341
|
-
|
|
88342
|
-
default: "on",
|
|
88343
|
-
options: [{
|
|
88344
|
-
value: "on",
|
|
88345
|
-
label: "On — accept clear agents"
|
|
88346
|
-
}, {
|
|
88347
|
-
value: "off",
|
|
88348
|
-
label: "Off — mutual TLS only"
|
|
88349
|
-
}]
|
|
88350
|
-
},
|
|
88351
|
-
{
|
|
88352
|
-
type: "info",
|
|
88353
|
-
key: "meshAuthStatus",
|
|
88354
|
-
label: "Mesh authentication",
|
|
88355
|
-
content: describeMeshStatus(getProcessMeshAuthStatus()),
|
|
88356
|
-
variant: "info"
|
|
88357
|
-
},
|
|
88358
|
-
{
|
|
88359
|
-
type: "text",
|
|
88360
|
-
key: AGENT_DASHBOARD_ORIGINS_FIELD,
|
|
88361
|
-
label: "Agent dashboard origins (NPM)",
|
|
88362
|
-
description: "Extra origins allowed for Continue-with-hub unlock redirects (comma-separated), e.g. https://agent.example.com. LAN agents on :4444 are always allowed."
|
|
88363
|
-
},
|
|
88364
|
-
{
|
|
88365
|
-
type: "addon-action-button",
|
|
88366
|
-
key: "mintJoinTokenAction",
|
|
88367
|
-
label: "Add agent",
|
|
88368
|
-
description: "Mint a single-use join token (≤ 1 hour). Paste it into the agent setup instead of copying the cluster secret. The token is shown once in the result.",
|
|
88369
|
-
addonId: "system-config",
|
|
88370
|
-
action: "mintJoinToken",
|
|
88371
|
-
buttonLabel: "Add agent",
|
|
88372
|
-
variant: "primary",
|
|
88373
|
-
successMessage: "Join token (copy now): {token}"
|
|
88374
|
-
}
|
|
88375
|
-
]
|
|
88275
|
+
fields: [{
|
|
88276
|
+
type: "password",
|
|
88277
|
+
key: CLUSTER_SECRET_FIELD,
|
|
88278
|
+
label: "Cluster secret",
|
|
88279
|
+
description: "Mandatory — generated by the hub at first boot and stored in the keychain. To pair an agent: Reveal and copy it here, then enter it in the agent (its status page, or the desktop setup window). Saving a new value rotates it: every agent must then be given the new one."
|
|
88280
|
+
}, {
|
|
88281
|
+
type: "info",
|
|
88282
|
+
key: "meshAuthStatus",
|
|
88283
|
+
label: "Mesh authentication",
|
|
88284
|
+
content: describeMeshStatus(getProcessMeshAuthStatus()),
|
|
88285
|
+
variant: "info"
|
|
88286
|
+
}]
|
|
88376
88287
|
}
|
|
88377
88288
|
] };
|
|
88378
88289
|
}
|
|
@@ -88396,7 +88307,7 @@ var SystemConfigAddon = class extends BaseAddon {
|
|
|
88396
88307
|
/**
|
|
88397
88308
|
* The admin UI / `addonSettings` cap prefer {@link BaseAddon.updateGlobalSettingsAsOperator}.
|
|
88398
88309
|
* That BaseAddon path writes the generic addon store and never reaches
|
|
88399
|
-
* {@link writeClusterSection}
|
|
88310
|
+
* {@link writeClusterSection}. Route the operator
|
|
88400
88311
|
* write through the same section-aware path as {@link updateGlobalSettings}.
|
|
88401
88312
|
*/
|
|
88402
88313
|
async updateGlobalSettingsAsOperator(patch, _nodeId) {
|
|
@@ -88406,6 +88317,14 @@ var SystemConfigAddon = class extends BaseAddon {
|
|
|
88406
88317
|
if (!this.ctx.settings) throw new Error("system-config: ctx.settings not available — cannot write sections");
|
|
88407
88318
|
const perSection = /* @__PURE__ */ new Map();
|
|
88408
88319
|
for (const [key, value] of Object.entries(patch)) {
|
|
88320
|
+
if (key === "meshClearPort") {
|
|
88321
|
+
this.ctx.logger.warn("cluster.meshClearPort is retired (D826) — the hub mesh is TLS-only; ignoring this patch");
|
|
88322
|
+
continue;
|
|
88323
|
+
}
|
|
88324
|
+
if (key === "agentDashboardOrigins") {
|
|
88325
|
+
this.ctx.logger.warn("cluster.agentDashboardOrigins is no longer writable from settings — ignoring this patch");
|
|
88326
|
+
continue;
|
|
88327
|
+
}
|
|
88409
88328
|
const section = KEY_TO_SECTION[key];
|
|
88410
88329
|
if (section === void 0) {
|
|
88411
88330
|
this.ctx.logger.warn("update ignored unknown key (not mapped to any section)", { meta: { key } });
|
|
@@ -88446,9 +88365,7 @@ var SystemConfigAddon = class extends BaseAddon {
|
|
|
88446
88365
|
* enforced (D821) — a legacy `meshAuth` in the patch is ignored.
|
|
88447
88366
|
*/
|
|
88448
88367
|
async writeClusterSection(patch) {
|
|
88449
|
-
const { [MESH_AUTH_MODE_FIELD]: _legacyMode,
|
|
88450
|
-
if (clearPort !== void 0) await this.writeMeshClearPort(clearPort);
|
|
88451
|
-
if (dashboardOrigins !== void 0) await this.ctx.settings.setSection("cluster", { [AGENT_DASHBOARD_ORIGINS_FIELD]: typeof dashboardOrigins === "string" ? dashboardOrigins : "" });
|
|
88368
|
+
const { [MESH_AUTH_MODE_FIELD]: _legacyMode, ...secretPatch } = patch;
|
|
88452
88369
|
await this.writeMeshAuthMode("enforced");
|
|
88453
88370
|
if (Object.keys(secretPatch).length === 0) return;
|
|
88454
88371
|
if (isSecretClear(secretPatch["clusterSecret"])) throw new Error("The cluster secret is mandatory and cannot be cleared — save a new value to rotate it");
|
|
@@ -88456,27 +88373,6 @@ var SystemConfigAddon = class extends BaseAddon {
|
|
|
88456
88373
|
this.ctx.logger.info("Cluster secret updated");
|
|
88457
88374
|
await this.clusterSecretKeeper?.reload();
|
|
88458
88375
|
}
|
|
88459
|
-
/**
|
|
88460
|
-
* `cluster.meshClearPort`: `off` is REFUSED while any online agent still
|
|
88461
|
-
* connects in clear (or the TLS listener is not up); the refusal names them.
|
|
88462
|
-
* Persist, then apply — an `on` save always passes.
|
|
88463
|
-
*/
|
|
88464
|
-
async writeMeshClearPort(value) {
|
|
88465
|
-
if (!isMeshClearPortMode(value)) throw new Error(`system-config: meshClearPort must be 'on' or 'off'`);
|
|
88466
|
-
const stored = (await this.ctx.settings.getSection("cluster"))[MESH_CLEAR_PORT_FIELD];
|
|
88467
|
-
if (parseMeshClearPortMode(stored) === value) return;
|
|
88468
|
-
const decision = checkProcessMeshClearPort(value);
|
|
88469
|
-
if (!decision.allowed) {
|
|
88470
|
-
this.ctx.logger.warn("mesh clear port switch-off refused", { meta: {
|
|
88471
|
-
blocking: decision.blocking,
|
|
88472
|
-
error: decision.error
|
|
88473
|
-
} });
|
|
88474
|
-
throw new Error(decision.error);
|
|
88475
|
-
}
|
|
88476
|
-
await this.ctx.settings.setSection("cluster", { [MESH_CLEAR_PORT_FIELD]: value });
|
|
88477
|
-
await applyProcessMeshClearPort(value);
|
|
88478
|
-
this.ctx.logger.info("Mesh clear port switched", { meta: { mode: value } });
|
|
88479
|
-
}
|
|
88480
88376
|
/** Persist + publish mesh auth mode (always `enforced` after D821). */
|
|
88481
88377
|
async writeMeshAuthMode(mode) {
|
|
88482
88378
|
await this.ctx.settings.setSection("cluster", { [MESH_AUTH_MODE_FIELD]: mode });
|
|
@@ -88555,4 +88451,4 @@ function readJwtExp(token) {
|
|
|
88555
88451
|
return typeof exp === "number" ? exp : 0;
|
|
88556
88452
|
}
|
|
88557
88453
|
//#endregion
|
|
88558
|
-
export {
|
|
88454
|
+
export { AGENT_UI_UNLOCK_VERSION as A, parseMeshAuthMode as B, generateMeshKeyPair as C, AGENT_DASHBOARD_ORIGINS_FIELD as D, loadMeshCa as E, verifyAgentUiUnlockTicket as F, createCidrMatcher as G, setProcessMeshAuthMode as H, MESH_AUTH_MODE_FIELD as I, readCidrSetting as J, normalizeIp as K, getProcessMeshAuthMode as L, isAllowedAgentDashboardReturnTo as M, mintAgentUiUnlockTicket as N, AGENT_UI_UNLOCK_DOMAIN as O, parseAgentDashboardOrigins as P, getProcessMeshAuthStatus as R, generateMeshCa as S, SYSTEM_CONFIG_CLUSTER_SECTION_ID, SystemConfigAddon, SystemConfigAddon as default, issueMeshLeafFromCsr as T, setProcessMeshAuthStatusSource as U, requestProcessMeshEnforcement as V, setProcessMeshEnforcer as W, requireProcessMeshCa as _, setProcessMeshTlsEnabler as a, createMeshCsrPem as b, mintMeshJoinToken as c, getProcessNodeMeshTransport as d, setProcessMeshPeerTransportLookup as f, getProcessMeshCaState as g, MeshCaKeeper as h, ServiceBroker as i, UnlockTicketJtiStore as j, AGENT_UI_UNLOCK_TTL_MS as k, processJoinTokenJtiStore as l, processMeshCrl as m, TlsTcpTransporter as n, enrollMeshNode as o, MeshCrl as p, parseCidrList as q, Errors as r, JoinTokenJtiStore as s, systemConfigMeshActions as t, verifyMeshJoinToken as u, caFingerprint as v, issueMeshLeafForNode as w, exportMeshPrivateKeyPem as x, caFingerprintCompact as y, isMeshAuthMode as z };
|
|
@@ -92,8 +92,6 @@ var MESH_CA_FIELD = "meshCa";
|
|
|
92
92
|
/** Join-token / leaf lifetimes. */
|
|
93
93
|
var MESH_JOIN_TOKEN_MAX_TTL_SEC = 3600;
|
|
94
94
|
var MESH_CA_VALIDITY_DAYS = 3650;
|
|
95
|
-
/** Hub clear TCP (existing) and TLS dual-listen port (Release A). */
|
|
96
|
-
var DEFAULT_HUB_TCP_PORT = 6e3;
|
|
97
95
|
var DEFAULT_HUB_TLS_TCP_PORT = 6443;
|
|
98
96
|
/** Subject of the mesh root. Distinct from the HTTPS local CA. */
|
|
99
97
|
var MESH_CA_COMMON_NAME = "CamStack Mesh CA";
|
|
@@ -101,4 +99,4 @@ var MESH_CA_COMMON_NAME = "CamStack Mesh CA";
|
|
|
101
99
|
var SERVER_AUTH_OID = "1.3.6.1.5.5.7.3.1";
|
|
102
100
|
var CLIENT_AUTH_OID = "1.3.6.1.5.5.7.3.2";
|
|
103
101
|
//#endregion
|
|
104
|
-
export {
|
|
102
|
+
export { getProcessClusterSecretGate as _, MESH_CA_KEY_REF as a, setProcessClusterSecretGate as b, MESH_JOIN_TOKEN_MAX_TTL_SEC as c, CLUSTER_SECRET_REF as d, CLUSTER_SECRET_REJECTED_EXIT_CODE as f, clusterSecretMatches as g, checkClusterSecret as h, MESH_CA_FIELD as i, SERVER_AUTH_OID as l, CLUSTER_SECRET_UNAVAILABLE_TYPE as m, DEFAULT_HUB_TLS_TCP_PORT as n, MESH_CA_SETTINGS_KEY as o, CLUSTER_SECRET_SETTINGS_KEY as p, MESH_CA_COMMON_NAME as r, MESH_CA_VALIDITY_DAYS as s, CLIENT_AUTH_OID as t, CLUSTER_SECRET_MISMATCH_TYPE as u, hashClusterSecret as v, isClusterSecretMismatchError as y };
|
|
@@ -92,8 +92,6 @@ var MESH_CA_FIELD = "meshCa";
|
|
|
92
92
|
/** Join-token / leaf lifetimes. */
|
|
93
93
|
var MESH_JOIN_TOKEN_MAX_TTL_SEC = 3600;
|
|
94
94
|
var MESH_CA_VALIDITY_DAYS = 3650;
|
|
95
|
-
/** Hub clear TCP (existing) and TLS dual-listen port (Release A). */
|
|
96
|
-
var DEFAULT_HUB_TCP_PORT = 6e3;
|
|
97
95
|
var DEFAULT_HUB_TLS_TCP_PORT = 6443;
|
|
98
96
|
/** Subject of the mesh root. Distinct from the HTTPS local CA. */
|
|
99
97
|
var MESH_CA_COMMON_NAME = "CamStack Mesh CA";
|
|
@@ -137,12 +135,6 @@ Object.defineProperty(exports, "CLUSTER_SECRET_UNAVAILABLE_TYPE", {
|
|
|
137
135
|
return CLUSTER_SECRET_UNAVAILABLE_TYPE;
|
|
138
136
|
}
|
|
139
137
|
});
|
|
140
|
-
Object.defineProperty(exports, "DEFAULT_HUB_TCP_PORT", {
|
|
141
|
-
enumerable: true,
|
|
142
|
-
get: function() {
|
|
143
|
-
return DEFAULT_HUB_TCP_PORT;
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
138
|
Object.defineProperty(exports, "DEFAULT_HUB_TLS_TCP_PORT", {
|
|
147
139
|
enumerable: true,
|
|
148
140
|
get: function() {
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ const require_builtins_sqlite_storage_index = require("./builtins/sqlite-storage
|
|
|
27
27
|
const require_hub_cap_forward = require("./hub-cap-forward-W8oEm4ME.js");
|
|
28
28
|
const require_builtins_storage_orchestrator_storage_orchestrator_addon = require("./builtins/storage-orchestrator/storage-orchestrator.addon.js");
|
|
29
29
|
require("./builtins/storage-orchestrator/index.js");
|
|
30
|
-
const require_constants = require("./constants-
|
|
30
|
+
const require_constants = require("./constants-Dcecs0Ks.js");
|
|
31
31
|
const require_builtins_system_config_system_config_addon = require("./builtins/system-config/system-config.addon.js");
|
|
32
32
|
require("./builtins/system-config/index.js");
|
|
33
33
|
const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
|
|
@@ -11132,9 +11132,8 @@ function createBroker(config) {
|
|
|
11132
11132
|
tlsPort: config.tlsPort ?? 6443,
|
|
11133
11133
|
maxPacketSize: 10 * 1024 * 1024,
|
|
11134
11134
|
useHostname,
|
|
11135
|
-
|
|
11136
|
-
|
|
11137
|
-
udpPeriod: 5,
|
|
11135
|
+
hubTlsOnly: true,
|
|
11136
|
+
udpDiscovery: false,
|
|
11138
11137
|
debug: false,
|
|
11139
11138
|
...config.meshTls !== void 0 ? { meshTls: config.meshTls } : {}
|
|
11140
11139
|
}),
|
|
@@ -14033,7 +14032,6 @@ exports.MESH_AUTO_ENFORCE_GRACE_MS = MESH_AUTO_ENFORCE_GRACE_MS;
|
|
|
14033
14032
|
exports.MESH_CA_FIELD = require_constants.MESH_CA_FIELD;
|
|
14034
14033
|
exports.MESH_CA_KEY_REF = require_constants.MESH_CA_KEY_REF;
|
|
14035
14034
|
exports.MESH_CA_SETTINGS_KEY = require_constants.MESH_CA_SETTINGS_KEY;
|
|
14036
|
-
exports.MESH_CLEAR_PORT_FIELD = require_builtins_system_config_system_config_addon.MESH_CLEAR_PORT_FIELD;
|
|
14037
14035
|
exports.MESH_JOIN_AUTHENTICATE_ACTION = MESH_JOIN_AUTHENTICATE_ACTION;
|
|
14038
14036
|
exports.MESH_JOIN_CHALLENGE_ACTION = MESH_JOIN_CHALLENGE_ACTION;
|
|
14039
14037
|
exports.MESH_JOIN_CHALLENGE_INVALID_TYPE = MESH_JOIN_CHALLENGE_INVALID_TYPE;
|
|
@@ -14124,7 +14122,6 @@ exports.allFamiliesListenHost = require_tls.allFamiliesListenHost;
|
|
|
14124
14122
|
exports.answerClaimedGetStatus = require_child_cap_dispatch.answerClaimedGetStatus;
|
|
14125
14123
|
exports.applyCertificateToListener = require_tls.applyCertificateToListener;
|
|
14126
14124
|
exports.applyLanHttp = require_tls.applyLanHttp;
|
|
14127
|
-
exports.applyProcessMeshClearPort = require_builtins_system_config_system_config_addon.applyProcessMeshClearPort;
|
|
14128
14125
|
exports.attachUserManagementInternal = require_builtins_local_auth_local_auth_addon.attachUserManagementInternal;
|
|
14129
14126
|
exports.attributeStall = require_event_loop_stall_monitor.attributeStall;
|
|
14130
14127
|
exports.bindPendingLanHttp = require_tls.bindPendingLanHttp;
|
|
@@ -14156,7 +14153,6 @@ exports.capActionSuffix = require_child_cap_dispatch.capActionSuffix;
|
|
|
14156
14153
|
exports.capBareAction = require_child_cap_dispatch.capBareAction;
|
|
14157
14154
|
exports.capServiceName = require_child_cap_dispatch.capServiceName;
|
|
14158
14155
|
exports.checkClusterSecret = require_constants.checkClusterSecret;
|
|
14159
|
-
exports.checkProcessMeshClearPort = require_builtins_system_config_system_config_addon.checkProcessMeshClearPort;
|
|
14160
14156
|
exports.classifyAddonDir = classifyAddonDir;
|
|
14161
14157
|
exports.classifyCapRoute = require_child_cap_dispatch.classifyCapRoute;
|
|
14162
14158
|
exports.clearHttpsListener = require_tls.clearHttpsListener;
|
|
@@ -14215,7 +14211,6 @@ exports.createUdsLogger = require_child_cap_dispatch.createUdsLogger;
|
|
|
14215
14211
|
exports.createUdsLoggerWithControl = require_child_cap_dispatch.createUdsLoggerWithControl;
|
|
14216
14212
|
exports.createV8Reclaimer = require_child_cap_dispatch.createV8Reclaimer;
|
|
14217
14213
|
exports.decideMeshAutoEnforce = decideMeshAutoEnforce;
|
|
14218
|
-
exports.decideMeshClearPortOff = require_builtins_system_config_system_config_addon.decideMeshClearPortOff;
|
|
14219
14214
|
exports.deleteModelFromDisk = require_event_loop_stall_monitor.deleteModelFromDisk;
|
|
14220
14215
|
exports.deriveAgentListenPort = deriveAgentListenPort;
|
|
14221
14216
|
exports.describeProviderKindDrift = describeProviderKindDrift;
|
|
@@ -14437,8 +14432,8 @@ exports.setPlatformKeychainKey = require_platform_key_source.setPlatformKeychain
|
|
|
14437
14432
|
exports.setProcessClusterSecretGate = require_constants.setProcessClusterSecretGate;
|
|
14438
14433
|
exports.setProcessMeshAuthMode = require_builtins_system_config_system_config_addon.setProcessMeshAuthMode;
|
|
14439
14434
|
exports.setProcessMeshAuthStatusSource = require_builtins_system_config_system_config_addon.setProcessMeshAuthStatusSource;
|
|
14440
|
-
exports.setProcessMeshClearPortControl = require_builtins_system_config_system_config_addon.setProcessMeshClearPortControl;
|
|
14441
14435
|
exports.setProcessMeshEnforcer = require_builtins_system_config_system_config_addon.setProcessMeshEnforcer;
|
|
14436
|
+
exports.setProcessMeshPeerTransportLookup = require_builtins_system_config_system_config_addon.setProcessMeshPeerTransportLookup;
|
|
14442
14437
|
exports.setProcessMeshTlsEnabler = require_builtins_system_config_system_config_addon.setProcessMeshTlsEnabler;
|
|
14443
14438
|
exports.setWrapperActive = require_builtins_device_manager_device_manager_addon.setWrapperActive;
|
|
14444
14439
|
exports.shouldReclaim = require_child_cap_dispatch.shouldReclaim;
|
package/dist/index.mjs
CHANGED
|
@@ -26,8 +26,8 @@ import { ConfigStore, DeviceStore } from "./builtins/sqlite-storage/index.mjs";
|
|
|
26
26
|
import { i as stripForwardedCaller, n as HUB_CAP_FWD_SERVICE, r as createHubCapForwardService, t as HUB_CAP_FWD_ACTION } from "./hub-cap-forward-CDiN1p98.mjs";
|
|
27
27
|
import { StorageOrchestratorAddon, n as buildStorageLocationRegistry, t as StorageOrchestratorService } from "./builtins/storage-orchestrator/storage-orchestrator.addon.mjs";
|
|
28
28
|
import "./builtins/storage-orchestrator/index.mjs";
|
|
29
|
-
import { _ as
|
|
30
|
-
import { A as
|
|
29
|
+
import { _ as getProcessClusterSecretGate, a as MESH_CA_KEY_REF, b as setProcessClusterSecretGate, d as CLUSTER_SECRET_REF, f as CLUSTER_SECRET_REJECTED_EXIT_CODE, g as clusterSecretMatches, h as checkClusterSecret, i as MESH_CA_FIELD, m as CLUSTER_SECRET_UNAVAILABLE_TYPE, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, p as CLUSTER_SECRET_SETTINGS_KEY, u as CLUSTER_SECRET_MISMATCH_TYPE, v as hashClusterSecret, y as isClusterSecretMismatchError } from "./constants-5vADty9I.mjs";
|
|
30
|
+
import { A as AGENT_UI_UNLOCK_VERSION, B as parseMeshAuthMode, C as generateMeshKeyPair, D as AGENT_DASHBOARD_ORIGINS_FIELD, E as loadMeshCa, F as verifyAgentUiUnlockTicket, G as createCidrMatcher, H as setProcessMeshAuthMode, I as MESH_AUTH_MODE_FIELD, J as readCidrSetting, K as normalizeIp, L as getProcessMeshAuthMode, M as isAllowedAgentDashboardReturnTo, N as mintAgentUiUnlockTicket, O as AGENT_UI_UNLOCK_DOMAIN, P as parseAgentDashboardOrigins, R as getProcessMeshAuthStatus, S as generateMeshCa, SystemConfigAddon, T as issueMeshLeafFromCsr, U as setProcessMeshAuthStatusSource, V as requestProcessMeshEnforcement, W as setProcessMeshEnforcer, _ as requireProcessMeshCa, a as setProcessMeshTlsEnabler, b as createMeshCsrPem, c as mintMeshJoinToken, d as getProcessNodeMeshTransport, f as setProcessMeshPeerTransportLookup, g as getProcessMeshCaState, h as MeshCaKeeper, i as ServiceBroker, j as UnlockTicketJtiStore, k as AGENT_UI_UNLOCK_TTL_MS, l as processJoinTokenJtiStore, m as processMeshCrl, n as TlsTcpTransporter, o as enrollMeshNode, p as MeshCrl, q as parseCidrList, r as Errors, s as JoinTokenJtiStore, u as verifyMeshJoinToken, v as caFingerprint, w as issueMeshLeafForNode, x as exportMeshPrivateKeyPem, y as caFingerprintCompact, z as isMeshAuthMode } from "./builtins/system-config/system-config.addon.mjs";
|
|
31
31
|
import "./builtins/system-config/index.mjs";
|
|
32
32
|
import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
|
|
33
33
|
import { C as resolveFormatRevision, S as isModelDownloaded, _ as downloadModel, a as createFileDataPlaneHandler, b as getModelFilePath, c as parseRangeHeader, d as ModelDownloadService, g as downloadFile, h as deleteModelFromDisk, i as startEventLoopStallMonitor, l as parseTokenizedUrl, m as collectModelFiles, n as STALL_TICK_MS, o as contentTypeFor, p as adoptModelRevisions, r as attributeStall, s as createAuthenticatedFileServer, t as STALL_REPORT_MS, u as resolveFilePath, v as ensureModel, w as revisionWeightUrl, y as fetchJson } from "./event-loop-stall-monitor-BHtIKJY2.mjs";
|
|
@@ -36,7 +36,7 @@ import { $ as AGENT_CAP_FWD_ACTION, $n as EMPTY_SOCKET_DIRECTION, $t as HEAP_WAT
|
|
|
36
36
|
import { n as getPlatformKeychainKey, r as setPlatformKeychainKey, t as clearPlatformKeychainKey } from "./platform-key-source-BWlq0jjn.mjs";
|
|
37
37
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-B2WZ8_q9.mjs";
|
|
38
38
|
import { t as CustomActionRegistry } from "./custom-action-registry-B4Cf4O_X.mjs";
|
|
39
|
-
import { c as BackupKeyFormatError, d as generateBackupKeyPair, l as BackupKeyMismatchError, m as readBackupEncryptionHeader, o as SystemBackupService, r as prepareRestoreArchive, s as BackupDecryptError, t as BackupKeyRequiredError } from "./restore-archive-
|
|
39
|
+
import { c as BackupKeyFormatError, d as generateBackupKeyPair, l as BackupKeyMismatchError, m as readBackupEncryptionHeader, o as SystemBackupService, r as prepareRestoreArchive, s as BackupDecryptError, t as BackupKeyRequiredError } from "./restore-archive-DQ2NuwD1.mjs";
|
|
40
40
|
import { z } from "zod";
|
|
41
41
|
import { createHash, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
42
42
|
import { PYTHON_VERSION, buildBinaryPath, downloadBinary, ensureBinary, ensureFfmpeg, ensurePython, findInPath, getFfmpegDownloadUrl, getPlatformInfo, getPythonDownloadUrl, installPythonPackages, installPythonRequirements } from "@camstack/types/node";
|
|
@@ -11129,9 +11129,8 @@ function createBroker(config) {
|
|
|
11129
11129
|
tlsPort: config.tlsPort ?? 6443,
|
|
11130
11130
|
maxPacketSize: 10 * 1024 * 1024,
|
|
11131
11131
|
useHostname,
|
|
11132
|
-
|
|
11133
|
-
|
|
11134
|
-
udpPeriod: 5,
|
|
11132
|
+
hubTlsOnly: true,
|
|
11133
|
+
udpDiscovery: false,
|
|
11135
11134
|
debug: false,
|
|
11136
11135
|
...config.meshTls !== void 0 ? { meshTls: config.meshTls } : {}
|
|
11137
11136
|
}),
|
|
@@ -13901,4 +13900,4 @@ var LifecycleJobEngine = class {
|
|
|
13901
13900
|
}
|
|
13902
13901
|
};
|
|
13903
13902
|
//#endregion
|
|
13904
|
-
export { ADMIN_TOKEN_MAX_LIFETIME_MS, ADMIN_TOKEN_PREFIX, AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_DASHBOARD_ORIGINS_FIELD, AGENT_READINESS_SERVICE_NAME, AGENT_REGISTER_NODE_ACTION, AGENT_UI_UNLOCK_DOMAIN, AGENT_UI_UNLOCK_TTL_MS, AGENT_UI_UNLOCK_VERSION, 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, AdminTokenManager, AgentMeshAuthenticator, AlertCenterAddon, ApiKeyManager, AuthAuditLog, AuthManager, BackupDecryptError, BackupKeyFormatError, BackupKeyMismatchError, BackupKeyRequiredError, CAP_ACTION_OVERFLOW_LABEL, CAP_ACTION_UNLABELLED, CAP_METHOD_NOT_IMPLEMENTED, CA_COMMON_NAME, CA_VALIDITY_DAYS, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REF, CLUSTER_SECRET_REJECTED_EXIT_CODE, CLUSTER_SECRET_SETTINGS_KEY, CLUSTER_SECRET_UNAVAILABLE_TYPE, 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_HUB_TLS_TCP_PORT, 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, FIRST_BOOT_ADMIN_PASSWORD, FIRST_BOOT_ADMIN_USERNAME, 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, JWT_SIGNING_KEY_REF, JobJournal, JoinTokenJtiStore, JwtSigningKeyUnavailableError, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LoggingGate, LoginSessionManager, LokiDestination, LokiLoggingAddon, MAX_CAP_ACTIONS_PER_PEER, MAX_LEAF_VALIDITY_DAYS, MESH_ACTION_FORBIDDEN_TYPE, MESH_AUTH_MODE_FIELD, MESH_AUTO_ENFORCE_GRACE_MS, MESH_CA_FIELD, MESH_CA_KEY_REF, MESH_CA_SETTINGS_KEY, MESH_CLEAR_PORT_FIELD, MESH_JOIN_AUTHENTICATE_ACTION, MESH_JOIN_CHALLENGE_ACTION, MESH_JOIN_CHALLENGE_INVALID_TYPE, MESH_JOIN_CHALLENGE_TTL_MS, MESH_JOIN_PROTOCOL, MESH_NODE_UNAUTHENTICATED_TYPE, MESH_QUEUE_TOP_N, METHOD_ACCESS_MAP, MeshAuthenticator, MeshCaKeeper, MeshCrl, MeshJoinClient, 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, REFRESH_TOKEN_PREFIX, 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, SYSTEM_SECRET_OWNER, ScopedLogger, ScopedTokenManager, SettingsReadUnavailableError, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemBackupService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, TlsTcpTransporter, ToastService, UDS_NO_ROUTE_PREFIX, UNCLAIMED, UPLOADED_CA_FILE, USER_MANAGEMENT_INTERNAL, UdsLocalTransportClient, UdsLocalTransportServer, UnlockTicketJtiStore, UserManager, WinstonDestination, WinstonLoggingAddon, ZERO_LOOP_DELAY, __resetCapUsageRegistryForTests, __resetLoggingGateForTests, adaptBrokerToCluster, addonSettingsCapability, adoptModelRevisions, afterWorkerOnlineAnnounce, allFamiliesListenHost, answerClaimedGetStatus, applyCertificateToListener, applyLanHttp, applyProcessMeshClearPort, attachUserManagementInternal, attributeStall, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildNpmChildEnv, buildStorageLocationRegistry, builderMountedCapNames, caFingerprint, caFingerprintCompact, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionLabel, capActionName, capActionSuffix, capBareAction, capServiceName, checkClusterSecret, checkProcessMeshClearPort, classifyAddonDir, classifyCapRoute, clearHttpsListener, clearPendingRestart, clearPlatformKeychainKey, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, computeHubJoinProof, computeNodeJoinProof, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonPeerBytesFacility, createAddonService, createArrayBufferCensusGate, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCapActionCensus, createCidrMatcher, createCoreCapService, createDeferredHeapWatchSink, createDoorSettingsView, createEventPlaneMeter, createEventPlaneReader, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createInspectorArrayBufferCensus, createKernelHwAccel, createKernelInferenceEngine, createLocalTransport, createLoopDelayMeter, createMeshAccessMiddleware, createMeshCsrPem, createMeshQueueReader, createOutboundQueueGate, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createSocketDirectionCounters, createSocketPlaneMeter, createSocketPlaneReader, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, decideMeshAutoEnforce, decideMeshClearPortOff, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, describeRss, detectWorkspacePackagesDir, deviceCapResolverLink, deviceOfGetStatus, diffCapActionCensus, diffEventPlane, diffSocketPlane, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, emitHeapDiagnosticReport, encodeFrame, enrollMeshNode, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, exportMeshPrivateKeyPem, fetchJson, findInPath, formatArrayBufferCensus, formatEventPlane, formatHeapSpaces, formatLogLine, formatMeshQueue, formatOutboundQueueVerdict, formatSocketPlane, generateBackupKeyPair, generateMeshCa, generateMeshKeyPair, getBrokerEventBus, getBrokerTlsTransporter, getCapUsageRegistry, getFfmpegDownloadUrl, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPlatformKeychainKey, getProcessClusterSecretGate, getProcessJwtSigningKeyState, getProcessMeshAuthMode, getProcessMeshAuthStatus, getProcessMeshCaState, getProcessNodeMeshTransport, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getUserManagementInternal, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, heapSpaceField, hostNodeIdOf, hubMainRssBudget, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcParentLink, isAddonDeploySource, isAllowedAgentDashboardReturnTo, isArrayBufferCensusReport, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isCredentialKeyName, isInfraCapability, isMeshAuthMode, isModelDownloaded, isOwnChildNodeId, isRemoteForbiddenAction, isRemoteForbiddenOnAgent, isSettingsReadUnavailable, isSourceNewer, isolatedBuiltinPhase, issueMeshLeafForNode, issueMeshLeafFromCsr, leafFingerprintOf, loadMeshCa, loadTlsCert, localEndpointPath, localProviderLink, localSupportedPythonRuntimes, mapSignalsToInferenceHardware, meshErrorType, mintAgentUiUnlockTicket, mintMeshJoinToken, mountNativeCapService, nextRssBudgetState, normalizeIp, overlayGetStatus, parseAgentDashboardOrigins, parseCapAction, parseCidrList, parseMeshAuthMode, parseRangeHeader, parseRssBudgetMb, parseTokenExpiry, parseTokenizedUrl, partitionIsolatedBuiltinIds, prepareBootTls, prepareRestoreArchive, probePlatform, processJoinTokenJtiStore, processJwtSigningKey, processMeshCrl, proxyToUpstream, quarantineAddonResidue, readBackupEncryptionHeader, readCidrSetting, readExtraSans, readHeapSpaces, readLanHttpState, readPendingRestart, readSocketQueues, readTlsAccessStatus, readTlsMode, readinessKey, reclaimIntervalMs, recordSocketFrame, redactLogEntry, redactLogMeta, redactLogText, regenerateCertificate, registerEventBusService, registerHttpsListener, registerLanHttpHandler, reissueTlsLeaf, reloadHttpsListener, requestProcessMeshEnforcement, requireProcessMeshCa, resolveFilePath, resolveFormatRevision, resolveHwAccel, resolveNpmInvocation, revertToGeneratedCertificate, revisionWeightUrl, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, servedHttpsLeafFingerprint, setHubConnected, setNodeEventInterest, setPlatformKeychainKey, setProcessClusterSecretGate, setProcessMeshAuthMode, setProcessMeshAuthStatusSource, setProcessMeshClearPortControl, setProcessMeshEnforcer, setProcessMeshTlsEnabler, setWrapperActive, shouldReclaim, signalAllRunnerGroups, socketDirectionBytes, socketDirectionMessages, splitPemCertificates, stampCallerAddonId, startEventLoopStallMonitor, startHeapWatch, startRunnerHeapWatch, staticJwtSigningKey, storeMayAnswer, storeUploadedCertificate, strandedMb, stripCamstackDeps, stripForgedIdentity, stripForwardedCaller, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, verifyAgentUiUnlockTicket, verifyMeshJoinToken, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
|
|
13903
|
+
export { ADMIN_TOKEN_MAX_LIFETIME_MS, ADMIN_TOKEN_PREFIX, AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_DASHBOARD_ORIGINS_FIELD, AGENT_READINESS_SERVICE_NAME, AGENT_REGISTER_NODE_ACTION, AGENT_UI_UNLOCK_DOMAIN, AGENT_UI_UNLOCK_TTL_MS, AGENT_UI_UNLOCK_VERSION, 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, AdminTokenManager, AgentMeshAuthenticator, AlertCenterAddon, ApiKeyManager, AuthAuditLog, AuthManager, BackupDecryptError, BackupKeyFormatError, BackupKeyMismatchError, BackupKeyRequiredError, CAP_ACTION_OVERFLOW_LABEL, CAP_ACTION_UNLABELLED, CAP_METHOD_NOT_IMPLEMENTED, CA_COMMON_NAME, CA_VALIDITY_DAYS, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REF, CLUSTER_SECRET_REJECTED_EXIT_CODE, CLUSTER_SECRET_SETTINGS_KEY, CLUSTER_SECRET_UNAVAILABLE_TYPE, 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_HUB_TLS_TCP_PORT, 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, FIRST_BOOT_ADMIN_PASSWORD, FIRST_BOOT_ADMIN_USERNAME, 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, JWT_SIGNING_KEY_REF, JobJournal, JoinTokenJtiStore, JwtSigningKeyUnavailableError, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LoggingGate, LoginSessionManager, LokiDestination, LokiLoggingAddon, MAX_CAP_ACTIONS_PER_PEER, MAX_LEAF_VALIDITY_DAYS, MESH_ACTION_FORBIDDEN_TYPE, MESH_AUTH_MODE_FIELD, MESH_AUTO_ENFORCE_GRACE_MS, MESH_CA_FIELD, MESH_CA_KEY_REF, MESH_CA_SETTINGS_KEY, MESH_JOIN_AUTHENTICATE_ACTION, MESH_JOIN_CHALLENGE_ACTION, MESH_JOIN_CHALLENGE_INVALID_TYPE, MESH_JOIN_CHALLENGE_TTL_MS, MESH_JOIN_PROTOCOL, MESH_NODE_UNAUTHENTICATED_TYPE, MESH_QUEUE_TOP_N, METHOD_ACCESS_MAP, MeshAuthenticator, MeshCaKeeper, MeshCrl, MeshJoinClient, 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, REFRESH_TOKEN_PREFIX, 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, SYSTEM_SECRET_OWNER, ScopedLogger, ScopedTokenManager, SettingsReadUnavailableError, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemBackupService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, TlsTcpTransporter, ToastService, UDS_NO_ROUTE_PREFIX, UNCLAIMED, UPLOADED_CA_FILE, USER_MANAGEMENT_INTERNAL, UdsLocalTransportClient, UdsLocalTransportServer, UnlockTicketJtiStore, UserManager, WinstonDestination, WinstonLoggingAddon, ZERO_LOOP_DELAY, __resetCapUsageRegistryForTests, __resetLoggingGateForTests, adaptBrokerToCluster, addonSettingsCapability, adoptModelRevisions, afterWorkerOnlineAnnounce, allFamiliesListenHost, answerClaimedGetStatus, applyCertificateToListener, applyLanHttp, attachUserManagementInternal, attributeStall, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildNpmChildEnv, buildStorageLocationRegistry, builderMountedCapNames, caFingerprint, caFingerprintCompact, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionLabel, capActionName, capActionSuffix, capBareAction, capServiceName, checkClusterSecret, classifyAddonDir, classifyCapRoute, clearHttpsListener, clearPendingRestart, clearPlatformKeychainKey, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, computeHubJoinProof, computeNodeJoinProof, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonPeerBytesFacility, createAddonService, createArrayBufferCensusGate, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCapActionCensus, createCidrMatcher, createCoreCapService, createDeferredHeapWatchSink, createDoorSettingsView, createEventPlaneMeter, createEventPlaneReader, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createInspectorArrayBufferCensus, createKernelHwAccel, createKernelInferenceEngine, createLocalTransport, createLoopDelayMeter, createMeshAccessMiddleware, createMeshCsrPem, createMeshQueueReader, createOutboundQueueGate, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createSocketDirectionCounters, createSocketPlaneMeter, createSocketPlaneReader, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, decideMeshAutoEnforce, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, describeRss, detectWorkspacePackagesDir, deviceCapResolverLink, deviceOfGetStatus, diffCapActionCensus, diffEventPlane, diffSocketPlane, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, emitHeapDiagnosticReport, encodeFrame, enrollMeshNode, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, exportMeshPrivateKeyPem, fetchJson, findInPath, formatArrayBufferCensus, formatEventPlane, formatHeapSpaces, formatLogLine, formatMeshQueue, formatOutboundQueueVerdict, formatSocketPlane, generateBackupKeyPair, generateMeshCa, generateMeshKeyPair, getBrokerEventBus, getBrokerTlsTransporter, getCapUsageRegistry, getFfmpegDownloadUrl, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPlatformKeychainKey, getProcessClusterSecretGate, getProcessJwtSigningKeyState, getProcessMeshAuthMode, getProcessMeshAuthStatus, getProcessMeshCaState, getProcessNodeMeshTransport, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getUserManagementInternal, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, heapSpaceField, hostNodeIdOf, hubMainRssBudget, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcParentLink, isAddonDeploySource, isAllowedAgentDashboardReturnTo, isArrayBufferCensusReport, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isCredentialKeyName, isInfraCapability, isMeshAuthMode, isModelDownloaded, isOwnChildNodeId, isRemoteForbiddenAction, isRemoteForbiddenOnAgent, isSettingsReadUnavailable, isSourceNewer, isolatedBuiltinPhase, issueMeshLeafForNode, issueMeshLeafFromCsr, leafFingerprintOf, loadMeshCa, loadTlsCert, localEndpointPath, localProviderLink, localSupportedPythonRuntimes, mapSignalsToInferenceHardware, meshErrorType, mintAgentUiUnlockTicket, mintMeshJoinToken, mountNativeCapService, nextRssBudgetState, normalizeIp, overlayGetStatus, parseAgentDashboardOrigins, parseCapAction, parseCidrList, parseMeshAuthMode, parseRangeHeader, parseRssBudgetMb, parseTokenExpiry, parseTokenizedUrl, partitionIsolatedBuiltinIds, prepareBootTls, prepareRestoreArchive, probePlatform, processJoinTokenJtiStore, processJwtSigningKey, processMeshCrl, proxyToUpstream, quarantineAddonResidue, readBackupEncryptionHeader, readCidrSetting, readExtraSans, readHeapSpaces, readLanHttpState, readPendingRestart, readSocketQueues, readTlsAccessStatus, readTlsMode, readinessKey, reclaimIntervalMs, recordSocketFrame, redactLogEntry, redactLogMeta, redactLogText, regenerateCertificate, registerEventBusService, registerHttpsListener, registerLanHttpHandler, reissueTlsLeaf, reloadHttpsListener, requestProcessMeshEnforcement, requireProcessMeshCa, resolveFilePath, resolveFormatRevision, resolveHwAccel, resolveNpmInvocation, revertToGeneratedCertificate, revisionWeightUrl, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, servedHttpsLeafFingerprint, setHubConnected, setNodeEventInterest, setPlatformKeychainKey, setProcessClusterSecretGate, setProcessMeshAuthMode, setProcessMeshAuthStatusSource, setProcessMeshEnforcer, setProcessMeshPeerTransportLookup, setProcessMeshTlsEnabler, setWrapperActive, shouldReclaim, signalAllRunnerGroups, socketDirectionBytes, socketDirectionMessages, splitPemCertificates, stampCallerAddonId, startEventLoopStallMonitor, startHeapWatch, startRunnerHeapWatch, staticJwtSigningKey, storeMayAnswer, storeUploadedCertificate, strandedMb, stripCamstackDeps, stripForgedIdentity, stripForwardedCaller, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, verifyAgentUiUnlockTicket, verifyMeshJoinToken, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
|
package/dist/kernel/index.d.ts
CHANGED
|
@@ -39,8 +39,8 @@ export { buildStorageLocationRegistry } from "./storage-location-registry.js";
|
|
|
39
39
|
export type { StorageLocationRegistry } from "./storage-location-registry.js";
|
|
40
40
|
export { createBroker, deriveAgentListenPort, getBrokerTlsTransporter } from "./moleculer/broker-factory.js";
|
|
41
41
|
export type { BrokerConfig } from "./moleculer/broker-factory.js";
|
|
42
|
-
export {
|
|
43
|
-
export type { MeshCaSigner,
|
|
42
|
+
export { caFingerprint, caFingerprintCompact, createMeshCsrPem, enrollMeshNode, exportMeshPrivateKeyPem, getProcessNodeMeshTransport, setProcessMeshPeerTransportLookup, generateMeshCa, generateMeshKeyPair, getProcessMeshCaState, issueMeshLeafForNode, issueMeshLeafFromCsr, JoinTokenJtiStore, loadMeshCa, MESH_CA_FIELD, MESH_CA_KEY_REF, MESH_CA_SETTINGS_KEY, MeshCaKeeper, MeshCrl, mintMeshJoinToken, processMeshCrl, processJoinTokenJtiStore, requireProcessMeshCa, setProcessMeshTlsEnabler, TlsTcpTransporter, verifyMeshJoinToken, DEFAULT_HUB_TLS_TCP_PORT } from "./moleculer/mesh-mtls/index.js";
|
|
43
|
+
export type { MeshCaSigner, MeshEnrollResult, MeshPeerTransportLookup, MeshTransport, MeshJoinTokenClaims, MeshTlsMaterial } from "./moleculer/mesh-mtls/index.js";
|
|
44
44
|
export { type AddonDeploySource, isAddonDeploySource } from "./moleculer/addon-deploy-source.js";
|
|
45
45
|
export { createAddonService, validateProviderRegistrations } from "./moleculer/addon-service-factory.js";
|
|
46
46
|
export { createCoreCapService, CORE_CAP_SERVICE_NAME } from "./moleculer/core-cap-service.js";
|
|
@@ -8,7 +8,7 @@ export declare const MESH_CA_FIELD = "meshCa";
|
|
|
8
8
|
export declare const MESH_JOIN_TOKEN_MAX_TTL_SEC: number;
|
|
9
9
|
export declare const MESH_LEAF_VALIDITY_DAYS = 30;
|
|
10
10
|
export declare const MESH_CA_VALIDITY_DAYS = 3650;
|
|
11
|
-
/** Hub clear TCP (
|
|
11
|
+
/** Hub legacy clear TCP (retired on hub — D826) and TLS listen port. */
|
|
12
12
|
export declare const DEFAULT_HUB_TCP_PORT = 6e3;
|
|
13
13
|
export declare const DEFAULT_HUB_TLS_TCP_PORT = 6443;
|
|
14
14
|
/** Join token payload version. */
|
|
@@ -2,7 +2,7 @@ export { CLIENT_AUTH_OID, DEFAULT_HUB_TCP_PORT, DEFAULT_HUB_TLS_TCP_PORT, MESH_C
|
|
|
2
2
|
export { caFingerprint, caFingerprintCompact, createMeshCsrPem, exportMeshPrivateKeyPem, generateMeshCa, generateMeshKeyPair, issueMeshLeafForNode, issueMeshLeafFromCsr, loadMeshCa, MESH_KEY_ALGORITHM, MESH_SIGNING_ALGORITHM, subjectCn, type MeshCaSigner, type MeshLeafMaterial } from "./mesh-ca.js";
|
|
3
3
|
export { clearProcessMeshCa, getProcessMeshCaState, loadOrGenerateMeshCa, MESH_CA_RETRY_MS, MeshCaKeeper, requireProcessMeshCa, setProcessMeshCa, type MeshCaKeeperDeps, type MeshCaState } from "./mesh-ca-keeper.js";
|
|
4
4
|
export { clearProcessMeshCrl, MeshCrl, processMeshCrl } from "./mesh-crl.js";
|
|
5
|
-
export {
|
|
5
|
+
export { getProcessNodeMeshTransport, setProcessMeshPeerTransportLookup, type MeshPeerTransportLookup, type MeshTransport } from "./mesh-peer-transport.js";
|
|
6
6
|
export { enrollMeshNode } from "./mesh-enroll.js";
|
|
7
7
|
export type { EnrollMeshNodeDeps, MeshEnrollRequest, MeshEnrollResult } from "./mesh-enroll.js";
|
|
8
8
|
export { JoinTokenJtiStore, mintMeshJoinToken, processJoinTokenJtiStore, verifyMeshJoinToken, type MeshJoinTokenClaims, type MintJoinTokenInput } from "./mesh-join-token.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hub-side telemetry: how an agent node reached the mesh transporter.
|
|
3
|
+
* The clear mesh port is retired — only mutual TLS is offered on the hub.
|
|
4
|
+
*/
|
|
5
|
+
/** How a node reaches the hub (badge / topology). */
|
|
6
|
+
export type MeshTransport = "tls" | "clear";
|
|
7
|
+
export interface MeshPeerTransportLookup {
|
|
8
|
+
transportOf(nodeId: string): MeshTransport | undefined;
|
|
9
|
+
}
|
|
10
|
+
/** Published by the hub broker owner; cleared on shutdown. */
|
|
11
|
+
export declare function setProcessMeshPeerTransportLookup(lookup: MeshPeerTransportLookup | null): void;
|
|
12
|
+
/** `tls` / `clear` for an agent as the hub sees it; `undefined` off the hub. */
|
|
13
|
+
export declare function getProcessNodeMeshTransport(nodeId: string): MeshTransport | undefined;
|
|
@@ -69,6 +69,8 @@ export interface TlsTcpTransporterOptions {
|
|
|
69
69
|
/** When set at construction, TLS starts with the clear reader. */
|
|
70
70
|
readonly meshTls?: MeshTlsMaterial;
|
|
71
71
|
readonly crl?: MeshCrl;
|
|
72
|
+
/** Hub only (D826): never bind clear TCP or UDP discovery. */
|
|
73
|
+
readonly hubTlsOnly?: boolean;
|
|
72
74
|
}
|
|
73
75
|
export declare class TlsTcpTransporter extends TcpTransporterBase {
|
|
74
76
|
private tlsServer;
|
|
@@ -78,6 +80,7 @@ export declare class TlsTcpTransporter extends TcpTransporterBase {
|
|
|
78
80
|
/** Node id (certificate CN) → serial of every peer that completed a mutual-TLS handshake. */
|
|
79
81
|
private readonly tlsPeers;
|
|
80
82
|
private clearDisabled;
|
|
83
|
+
private readonly hubTlsOnly;
|
|
81
84
|
/** Clear-text `TcpWriter.connect` captured once before the TLS wrap (A→B). */
|
|
82
85
|
private clearWriterConnect;
|
|
83
86
|
private writerTlsPatched;
|
|
@@ -8,7 +8,7 @@ import path, { basename, join, posix, win32 } from "node:path";
|
|
|
8
8
|
import * as fs$2 from "node:fs";
|
|
9
9
|
import Kt from "node:fs";
|
|
10
10
|
import { EventEmitter } from "node:events";
|
|
11
|
-
import
|
|
11
|
+
import As, { Transform } from "node:stream";
|
|
12
12
|
import { StringDecoder } from "node:string_decoder";
|
|
13
13
|
import fs from "fs";
|
|
14
14
|
import path$1, { dirname as dirname$1, parse } from "path";
|
|
@@ -394,7 +394,7 @@ var Br = (s, t) => {
|
|
|
394
394
|
var xs = typeof process == "object" && process ? process : {
|
|
395
395
|
stdout: null,
|
|
396
396
|
stderr: null
|
|
397
|
-
}, zr = (s) => !!s && typeof s == "object" && (s instanceof A || s instanceof
|
|
397
|
+
}, zr = (s) => !!s && typeof s == "object" && (s instanceof A || s instanceof As || Ur(s) || Hr(s)), Ur = (s) => !!s && typeof s == "object" && s instanceof EventEmitter && typeof s.pipe == "function" && s.pipe !== As.Writable.prototype.pipe, Hr = (s) => !!s && typeof s == "object" && s instanceof EventEmitter && typeof s.write == "function" && typeof s.end == "function", q = Symbol("EOF"), Q = Symbol("maybeEmitEnd"), rt = Symbol("emittedEnd"), Le = Symbol("emittingEnd"), qt = Symbol("emittedError"), Ne = Symbol("closed"), Ls = Symbol("read"), De = Symbol("flush"), Ns = Symbol("flushChunk"), z = Symbol("encoding"), Mt = Symbol("decoder"), g = Symbol("flowing"), Qt = Symbol("paused"), Bt = Symbol("resume"), b = Symbol("buffer"), D = Symbol("pipes"), _ = Symbol("bufferLength"), gi = Symbol("bufferPush"), Ae = Symbol("bufferShift"), L = Symbol("objectMode"), w = Symbol("destroyed"), bi = Symbol("error"), _i = Symbol("emitData"), Ds = Symbol("emitEnd"), Oi = Symbol("emitEnd2"), Z = Symbol("async"), Ti = Symbol("abort"), Ie = Symbol("aborted"), Jt = Symbol("signal"), Rt = Symbol("dataListeners"), F = Symbol("discarded"), jt = (s) => Promise.resolve().then(s), Wr = (s) => s(), Gr = (s) => s === "end" || s === "finish" || s === "prefinish", Zr = (s) => s instanceof ArrayBuffer || !!s && typeof s == "object" && s.constructor && s.constructor.name === "ArrayBuffer" && s.byteLength >= 0, Yr = (s) => !Buffer.isBuffer(s) && ArrayBuffer.isView(s), Fe = class {
|
|
398
398
|
src;
|
|
399
399
|
dest;
|
|
400
400
|
opts;
|
|
@@ -1185,7 +1185,7 @@ var tn = Buffer$1.concat, Bs = Object.getOwnPropertyDescriptor(Buffer$1, "concat
|
|
|
1185
1185
|
}
|
|
1186
1186
|
}
|
|
1187
1187
|
};
|
|
1188
|
-
var Pe
|
|
1188
|
+
var Pe = class extends Be {
|
|
1189
1189
|
#t;
|
|
1190
1190
|
constructor(t) {
|
|
1191
1191
|
super(t, "Gzip"), this.#t = t && !!t.portable;
|
|
@@ -2345,7 +2345,7 @@ var mi = class {
|
|
|
2345
2345
|
constructor(t = {}) {
|
|
2346
2346
|
if (super(), this.opt = t, this.file = t.file || "", this.cwd = t.cwd || process.cwd(), this.maxReadSize = t.maxReadSize, this.preservePaths = !!t.preservePaths, this.strict = !!t.strict, this.noPax = !!t.noPax, this.prefix = f(t.prefix || ""), this.linkCache = t.linkCache || /* @__PURE__ */ new Map(), this.statCache = t.statCache || /* @__PURE__ */ new Map(), this.readdirCache = t.readdirCache || /* @__PURE__ */ new Map(), this.onWriteEntry = t.onWriteEntry, this[di] = fe, typeof t.onwarn == "function" && this.on("warn", t.onwarn), this.portable = !!t.portable, t.gzip || t.brotli || t.zstd) {
|
|
2347
2347
|
if ((t.gzip ? 1 : 0) + (t.brotli ? 1 : 0) + (t.zstd ? 1 : 0) > 1) throw new TypeError("gzip, brotli, zstd are mutually exclusive");
|
|
2348
|
-
if (t.gzip && (typeof t.gzip != "object" && (t.gzip = {}), this.portable && (t.gzip.portable = !0), this.zip = new Pe
|
|
2348
|
+
if (t.gzip && (typeof t.gzip != "object" && (t.gzip = {}), this.portable && (t.gzip.portable = !0), this.zip = new Pe(t.gzip)), t.brotli && (typeof t.brotli != "object" && (t.brotli = {}), this.zip = new He(t.brotli)), t.zstd && (typeof t.zstd != "object" && (t.zstd = {}), this.zip = new Ze(t.zstd)), !this.zip) throw new Error("impossible");
|
|
2349
2349
|
let e = this.zip;
|
|
2350
2350
|
e.on("data", (i) => super.write(i)), e.on("end", () => super.end()), e.on("drain", () => this[ls]()), this.on("resume", () => e.resume());
|
|
2351
2351
|
} else this.on("drain", this[ls]);
|
package/package.json
CHANGED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cutover switch for the hub's clear mesh port (Release A, rollout step 3).
|
|
3
|
-
*
|
|
4
|
-
* `cluster.meshClearPort` = `on` (default — clear :6000 + UDP discovery run next
|
|
5
|
-
* to the TLS :6443 listener) or `off` (the hub stops listening on :6000 and
|
|
6
|
-
* stops UDP discovery). Turning it off is REFUSED while any online agent still
|
|
7
|
-
* reaches the hub in clear — the same spirit as D803's auto-enforce: the switch
|
|
8
|
-
* must never cut off an agent that has not enrolled.
|
|
9
|
-
*
|
|
10
|
-
* The setting is owned by `system-config`; the transporter lives in the hub's
|
|
11
|
-
* broker. They meet through this process slot (same pattern as
|
|
12
|
-
* `mesh-auth-mode.ts` / `mesh-tls-enabler.ts`).
|
|
13
|
-
*/
|
|
14
|
-
/** How a node reaches the hub. */
|
|
15
|
-
export type MeshTransport = "tls" | "clear";
|
|
16
|
-
export type MeshClearPortMode = "on" | "off";
|
|
17
|
-
/** The field key inside the `cluster` section. */
|
|
18
|
-
export declare const MESH_CLEAR_PORT_FIELD = "meshClearPort";
|
|
19
|
-
export declare function isMeshClearPortMode(value: unknown): value is MeshClearPortMode;
|
|
20
|
-
/** A stored value that is not a mode reads as `on`: never cut the mesh on a typo. */
|
|
21
|
-
export declare function parseMeshClearPortMode(value: unknown): MeshClearPortMode;
|
|
22
|
-
export interface MeshClearPortAgent {
|
|
23
|
-
readonly nodeId: string;
|
|
24
|
-
readonly transport: MeshTransport;
|
|
25
|
-
}
|
|
26
|
-
export interface MeshClearPortControl {
|
|
27
|
-
/** Agents connected right now (never the hub, never `hub/<runner>` children). */
|
|
28
|
-
listOnlineAgents(): readonly MeshClearPortAgent[];
|
|
29
|
-
/** Whether the TLS listener is up — without it, closing the clear port cuts everyone. */
|
|
30
|
-
isTlsListening(): boolean;
|
|
31
|
-
/** Close (`off`) or reopen (`on`) the clear TCP reader and UDP discovery. */
|
|
32
|
-
apply(mode: MeshClearPortMode): Promise<void>;
|
|
33
|
-
/** How one node reaches the hub, `undefined` when the hub cannot tell. */
|
|
34
|
-
transportOf(nodeId: string): MeshTransport | undefined;
|
|
35
|
-
}
|
|
36
|
-
export type MeshClearPortDecision = {
|
|
37
|
-
readonly allowed: true;
|
|
38
|
-
} | {
|
|
39
|
-
readonly allowed: false;
|
|
40
|
-
readonly blocking: readonly string[];
|
|
41
|
-
readonly error: string;
|
|
42
|
-
};
|
|
43
|
-
/** Pure: may the clear port be switched off right now? */
|
|
44
|
-
export declare function decideMeshClearPortOff(control: Pick<MeshClearPortControl, "listOnlineAgents" | "isTlsListening"> | null): MeshClearPortDecision;
|
|
45
|
-
/** Published by the hub's broker owner; cleared on shutdown. */
|
|
46
|
-
export declare function setProcessMeshClearPortControl(control: MeshClearPortControl | null): void;
|
|
47
|
-
export declare function getProcessMeshClearPortControl(): MeshClearPortControl | null;
|
|
48
|
-
/** `tls` / `clear` for an agent as the hub sees it; `undefined` off the hub. */
|
|
49
|
-
export declare function getProcessNodeMeshTransport(nodeId: string): MeshTransport | undefined;
|
|
50
|
-
/**
|
|
51
|
-
* Validate a requested mode against the live mesh. `on` is always allowed; `off`
|
|
52
|
-
* only when {@link decideMeshClearPortOff} allows. Does NOT apply it.
|
|
53
|
-
*/
|
|
54
|
-
export declare function checkProcessMeshClearPort(mode: MeshClearPortMode): MeshClearPortDecision;
|
|
55
|
-
/** Apply a mode that {@link checkProcessMeshClearPort} allowed. No-op where nobody can. */
|
|
56
|
-
export declare function applyProcessMeshClearPort(mode: MeshClearPortMode): Promise<boolean>;
|