@camstack/server 1.2.798 → 1.2.800
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/CHANGELOG.md +12 -0
- package/dist/boot/boot-config.js +5 -6
- package/dist/main.js +6 -11
- package/dist/manual-boot.js +2 -4
- package/dist/pending-restore.js +8 -0
- package/package.json +7 -8
- package/system/dist/addon-runner.js +3 -3
- package/system/dist/addon-runner.mjs +3 -3
- package/system/dist/{agent-https-LDtzwOC3.mjs → agent-https-BAH8C9GM.mjs} +1 -1
- package/system/dist/{agent-https-dPSUE1iZ.js → agent-https-RIQ3lut4.js} +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composer.addon.js +3 -3
- package/system/dist/builtins/composer/composer.addon.mjs +3 -3
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
- package/system/dist/builtins/device-history/device-history.addon.js +2 -2
- package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +4 -4
- package/system/dist/builtins/keychain/index.mjs +4 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/system/dist/builtins/local-network/local-network.addon.js +2 -2
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/system-backup/system-backup.service.d.ts +1 -1
- package/system/dist/builtins/system-config/system-config.addon.js +9 -9
- package/system/dist/builtins/system-config/system-config.addon.mjs +9 -9
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{capture-engine-B-X0ZNPG.js → capture-engine-CQzuDOjQ.js} +1 -1
- package/system/dist/{capture-engine-ek8d0K7v.mjs → capture-engine-DjCOsYGG.mjs} +1 -1
- package/system/dist/{composition-sources-Dr69aWyC.mjs → composition-sources-CVANj84Y.mjs} +1 -1
- package/system/dist/{composition-sources-DGKK9sGT.js → composition-sources-DHd3GBBX.js} +1 -1
- package/system/dist/{constants-CAlOFVXO.mjs → constants-DKszZoAC.mjs} +1 -1
- package/system/dist/{constants-DuVFATnX.js → constants-DjZvX7em.js} +1 -1
- package/system/dist/{device-ca-CJyaKA2l.js → device-ca-DtYudkE1.js} +1 -1
- package/system/dist/{device-ca-FfLv_YPi.mjs → device-ca-XCnTGi5h.mjs} +1 -1
- package/system/dist/{dist-CJoLQeEj.js → dist-Z_rnH_d0.js} +5 -1
- package/system/dist/{dist-Dgkqkron.mjs → dist-o_M5WSYU.mjs} +5 -1
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-q3IAAxK6.js → hub-mdns-ciao-Bl5j8wrj.js} +2 -2
- package/system/dist/{hub-mdns-ciao-Bczd9NSt.mjs → hub-mdns-ciao-CA6iSuS1.mjs} +2 -2
- package/system/dist/index.js +198 -75
- package/system/dist/index.mjs +198 -75
- package/system/dist/kernel/bootstrap-config.d.ts +11 -6
- package/system/dist/kernel/config-manager.d.ts +5 -5
- package/system/dist/kernel/config-schema.d.ts +3 -4
- package/system/dist/kernel/legacy-config-yaml.d.ts +37 -0
- package/system/dist/kernel/sections-store.d.ts +1 -1
- package/system/dist/kernel/system-settings-policy.d.ts +1 -1
- package/system/dist/{legacy-integration-rows-door-CfpoIqz-.js → legacy-integration-rows-door-DoR0o565.js} +1 -1
- package/system/dist/{legacy-integration-rows-door-CTCq-5la.mjs → legacy-integration-rows-door-dQUzxTo_.mjs} +1 -1
- package/system/dist/{restore-archive-HS5O901O.js → restore-archive-CAAEnwaO.js} +1 -2
- package/system/dist/{restore-archive-DfFB1J2w.mjs → restore-archive-Cqm3OJpy.mjs} +1 -2
- package/system/dist/{wal-maintenance-DHtTtKh4.js → wal-maintenance-Cjg3kYzJ.js} +0 -0
- package/system/dist/{wal-maintenance-D5xF2jrM.mjs → wal-maintenance-UVhlv-i5.mjs} +0 -0
- package/system/package.json +1 -1
package/system/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as __require } from "./chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { $r as isObjectInput, Ba as supportedRuntimes, Cc as userError, Cs as asString$1, D as CatalogFileSchema, Go as DEVICE_STATUS_METHOD, Gs as isDebugChannelName, Ho as CALLER_STAMPED_CAPABILITIES$1, Is as defineRecordKinds, Jr as isCollectionArrayMethod, Ls as emitDownForOwnedCaps, Ma as splitTranslationRef, Ni as objectInputDeclaresAddonId, Nt as PackageRequiresSchema, Oc as errMsg$1, Pi as objectInputDeclaresRequiredDeviceId, Sa as scopesAllowDeviceCap, Ss as asNumber, St as METHOD_ACCESS_MAP, Tn as bareAddonId, Un as compareVersions, Uo as DATAPLANE_SECRET_HEADER$1, Ur as interpolate, Vs as getDebugInterest, Wo as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Yi as procedureAuthKey, a as AGENT_MDNS_SERVICE_TYPE, b as CATALOG_LANGS, bt as LOG_LEVEL_RANK, cc as parseJsonObject, cs as ReadinessTimeoutError, dc as readinessKey, fa as resolveMethodAuth, fr as describeUnmet, gn as addonSettingsCapability, hc as scopeKey, hi as looseSchema, js as createEvent$1, kc as EventCategory$1, kr as extractNestedAddonId, ks as collectSecretMarkerRefs, lc as parseJsonUnknown, mi as logLevelAtMost, ni as kebabToCamel$1, o as AGENT_MDNS_TXT_KEYS, os as RUNTIME_DEFAULTS, pc as resolveCapMount, qa as unmetRequirements, qr as isArrayOutputSchema, s as ALL_CAPABILITY_DEFINITIONS, si as lifecycleJobSchema, ss as ReadinessRegistry, ti as isVoidInput, wc as withoutCallerStamp, xa as scopesAllowAddon, xs as asJsonObject$1, zs as expandCapMethods } from "./dist-
|
|
3
|
-
import { d as JWT_SIGNING_KEY_REF, f as JwtSigningKeyUnavailableError, g as processJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, p as SYSTEM_SECRET_OWNER, s as loadDeviceCa, u as verifyDeviceSignature, v as staticJwtSigningKey } from "./device-ca-
|
|
2
|
+
import { $r as isObjectInput, Ba as supportedRuntimes, Cc as userError, Cs as asString$1, D as CatalogFileSchema, Go as DEVICE_STATUS_METHOD, Gs as isDebugChannelName, Ho as CALLER_STAMPED_CAPABILITIES$1, Is as defineRecordKinds, Jr as isCollectionArrayMethod, Ls as emitDownForOwnedCaps, Ma as splitTranslationRef, Ni as objectInputDeclaresAddonId, Nt as PackageRequiresSchema, Oc as errMsg$1, Pi as objectInputDeclaresRequiredDeviceId, Sa as scopesAllowDeviceCap, Ss as asNumber, St as METHOD_ACCESS_MAP, Tn as bareAddonId, Un as compareVersions, Uo as DATAPLANE_SECRET_HEADER$1, Ur as interpolate, Vs as getDebugInterest, Wo as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Yi as procedureAuthKey, a as AGENT_MDNS_SERVICE_TYPE, b as CATALOG_LANGS, bt as LOG_LEVEL_RANK, cc as parseJsonObject, cs as ReadinessTimeoutError, dc as readinessKey, fa as resolveMethodAuth, fr as describeUnmet, gn as addonSettingsCapability, hc as scopeKey, hi as looseSchema, js as createEvent$1, kc as EventCategory$1, kr as extractNestedAddonId, ks as collectSecretMarkerRefs, lc as parseJsonUnknown, mi as logLevelAtMost, ni as kebabToCamel$1, o as AGENT_MDNS_TXT_KEYS, os as RUNTIME_DEFAULTS, pc as resolveCapMount, qa as unmetRequirements, qr as isArrayOutputSchema, s as ALL_CAPABILITY_DEFINITIONS, si as lifecycleJobSchema, ss as ReadinessRegistry, ti as isVoidInput, wc as withoutCallerStamp, xa as scopesAllowAddon, xs as asJsonObject$1, zs as expandCapMethods } from "./dist-o_M5WSYU.mjs";
|
|
3
|
+
import { d as JWT_SIGNING_KEY_REF, f as JwtSigningKeyUnavailableError, g as processJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, p as SYSTEM_SECRET_OWNER, s as loadDeviceCa, u as verifyDeviceSignature, v as staticJwtSigningKey } from "./device-ca-XCnTGi5h.mjs";
|
|
4
4
|
import { t as require_read_all_rows } from "./read-all-rows-TaPqdWNF.mjs";
|
|
5
5
|
import { AlertCenterAddon, a as redactLogEntry, i as isCredentialKeyName, n as lastCauseAfterChunk, o as redactLogMeta, r as readRunnerDisplayName, s as redactLogText, t as CRASH_BREAKER_ERROR_PREFIX } from "./builtins/alerts/alerts.addon.mjs";
|
|
6
6
|
import "./builtins/alerts/index.mjs";
|
|
@@ -25,22 +25,22 @@ import { LokiDestination, LokiLoggingAddon } from "./builtins/loki-logging/index
|
|
|
25
25
|
import NativeMetricsAddon, { a as NativeMetricsProvider, i as parseProcStatusRss, n as nodeProcReader, r as parseProcStat } from "./builtins/native-metrics/native-metrics.addon.mjs";
|
|
26
26
|
import { DeviceHistoryAddon } from "./builtins/device-history/device-history.addon.mjs";
|
|
27
27
|
import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./builtins/sqlite-storage/filesystem-storage.addon.mjs";
|
|
28
|
-
import { D as RecordsEngine, l as SqliteSettingsBackend } from "./wal-maintenance-
|
|
29
|
-
import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-
|
|
28
|
+
import { D as RecordsEngine, l as SqliteSettingsBackend } from "./wal-maintenance-UVhlv-i5.mjs";
|
|
29
|
+
import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-dQUzxTo_.mjs";
|
|
30
30
|
import { SqliteSettingsAddon } from "./builtins/sqlite-storage/sqlite-settings.addon.mjs";
|
|
31
31
|
import { ConfigStore, DeviceStore } from "./builtins/sqlite-storage/index.mjs";
|
|
32
32
|
import { StorageOrchestratorAddon, a as createHubCapForwardService, i as HUB_CAP_FWD_SERVICE, o as stripForwardedCaller, r as HUB_CAP_FWD_ACTION, s as buildStorageLocationRegistry, t as StorageOrchestratorService, u as storageOrchestratorRecordKinds } from "./builtins/storage-orchestrator/storage-orchestrator.addon.mjs";
|
|
33
33
|
import "./builtins/storage-orchestrator/index.mjs";
|
|
34
|
-
import { A as buildNameConstraintSet, B as setProcessAgentHttpsNames, C as LEAF_RENEWAL_WINDOW_DAYS, E as evaluateExistingCert, F as readNameConstraints, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, N as permitsIdentity, O as PERMITTED_DNS_SUFFIXES, P as permitsName, R as AgentHttpsNames, S as CA_VALIDITY_DAYS, T as SERVER_AUTH_OID, a as collectAgentNames, b as collectCertIdentity, c as installAgentHttps, d as issueAgentHttpsLeaf, f as loadAgentHttps, h as CA_COMMON_NAME, i as certificateNames, j as isConstrainedCa, k as PERMITTED_IP_RANGES, l as isContainerBridgeAddress, m as pinnedHttpsCaFingerprint, n as acceptAgentSans, o as createAgentHttpsRequest, p as pemDigest, r as agentHttpsPaths, s as describeHttpsLeaf, t as AgentHttpsInstallError, u as isPrivateAddress, w as MAX_LEAF_VALIDITY_DAYS, x as systemHostFacts, y as localCaCommonName, z as getProcessAgentHttpsNames } from "./agent-https-
|
|
35
|
-
import { a as MESH_CA_KEY_REF, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY } from "./constants-
|
|
34
|
+
import { A as buildNameConstraintSet, B as setProcessAgentHttpsNames, C as LEAF_RENEWAL_WINDOW_DAYS, E as evaluateExistingCert, F as readNameConstraints, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, N as permitsIdentity, O as PERMITTED_DNS_SUFFIXES, P as permitsName, R as AgentHttpsNames, S as CA_VALIDITY_DAYS, T as SERVER_AUTH_OID, a as collectAgentNames, b as collectCertIdentity, c as installAgentHttps, d as issueAgentHttpsLeaf, f as loadAgentHttps, h as CA_COMMON_NAME, i as certificateNames, j as isConstrainedCa, k as PERMITTED_IP_RANGES, l as isContainerBridgeAddress, m as pinnedHttpsCaFingerprint, n as acceptAgentSans, o as createAgentHttpsRequest, p as pemDigest, r as agentHttpsPaths, s as describeHttpsLeaf, t as AgentHttpsInstallError, u as isPrivateAddress, w as MAX_LEAF_VALIDITY_DAYS, x as systemHostFacts, y as localCaCommonName, z as getProcessAgentHttpsNames } from "./agent-https-BAH8C9GM.mjs";
|
|
35
|
+
import { a as MESH_CA_KEY_REF, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY } from "./constants-DKszZoAC.mjs";
|
|
36
36
|
import { $ as caFingerprintCompact, A as getProcessNodeMeshTransport, B as MESH_NODE_CERTIFICATES_COLLECTION, C as MESH_TLS_PORT_HELLO_FIELD, Ct as readOriginSetting, D as setProcessMeshTlsEnabler, Dt as readCidrSetting, E as ServiceBroker, Et as parseCidrList, F as renewMeshCertificate, G as getProcessMeshCertificateRegistry, H as MeshCertificateRegistry, I as revokeMeshCertificate, J as processMeshCrl, K as setProcessMeshCertificateRegistry, L as getProcessMeshTlsListenerState, M as isProcessVerifiedMeshPeer, N as onProcessNodeRegistered, O as dropProcessPeer, P as setProcessMeshPeerTransportLookup, Q as caFingerprint, R as openMeshTlsWhenRevocationsLoaded, S as verifyMembershipAnswer, St as parseOriginList, SystemConfigAddon, T as Errors, Tt as normalizeIp, U as RENEWAL_ABANDONED, V as MESH_NODE_CERTIFICATES_COLUMNS, W as describeMeshLeaf, X as getProcessMeshCaState, Y as MeshCaKeeper, Z as requireProcessMeshCa, _ as signPairingProof, _t as verifyAgentUiUnlockTicket, a as hubHostFromMeshAddress, at as issueMeshLeafForNode, b as MembershipResponder, bt as isInsecureOrigin, c as PAIRING_MAX_SESSIONS, ct as AGENT_DASHBOARD_ORIGINS_FIELD, d as PAIRING_PROTOCOL, dt as AGENT_UI_UNLOCK_USE, et as createMeshCsrPem, f as PAIRING_TTL_MS, ft as AGENT_UI_UNLOCK_VERSION, g as keyFingerprintShort, gt as parseAgentDashboardOrigins, h as describeCsr, ht as mintAgentUiUnlockTicket, i as AgentPairing, it as isValidAgentNodeId, j as getProcessPeerLeaf, k as emitProcessNodeRegistered, l as PAIRING_PATHS, lt as AGENT_UI_UNLOCK_TTL_MS, m as computePairingSas, mt as isAllowedAgentDashboardReturnTo, n as HubPairing, nt as generateMeshCa, o as PAIRING_CODE_DIGITS, ot as issueMeshLeafFromCsr, p as computePairingCommitment, pt as UnlockTicketJtiStore, q as MeshCrl, r as PairingHttpError, rt as generateMeshKeyPair, s as PAIRING_MAX_CODE_ATTEMPTS, st as loadMeshCa, tt as exportMeshPrivateKeyPem, u as PAIRING_PIN_DIGITS, ut as AGENT_UI_UNLOCK_TYP, v as verifyPairingProof, vt as InvalidCorsOriginError, w as TlsTcpTransporter, wt as createCidrMatcher, x as signMembershipProof, xt as normalizeOrigin, y as MEMBERSHIP_PATHS, yt as OPAQUE_ORIGIN, z as setProcessMeshTlsListenerState } from "./builtins/system-config/system-config.addon.mjs";
|
|
37
37
|
import "./builtins/system-config/index.mjs";
|
|
38
38
|
import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
|
|
39
39
|
import { C as isModelDownloaded, E as setHuggingFaceReachabilityObserver, T as revisionWeightUrl, _ as downloadFile, a as startEventLoopStallMonitor, b as fetchJson, c as createAuthenticatedFileServer, d as resolveFilePath, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, u as parseTokenizedUrl, v as downloadModel, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-B9zFBNVa.mjs";
|
|
40
|
-
import { A as retirePreviousLocalCa, C as checkUploadedCa, D as loadTlsCert, E as ensureTlsCert, F as closeLanHttp, I as readLanHttpState, L as registerLanHttpHandler, M as allFamiliesListenHost, N as applyLanHttp, O as reissueTlsLeaf, P as bindPendingLanHttp, S as chainsToPublicRoot, T as caReplacementMarkerFile, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, c as leafFingerprintOf, d as servedHttpsLeafFingerprint, f as prepareBootTls, g as readTlsEnabled, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, k as replaceUnconstrainedLocalCa, l as registerHttpsListener, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, p as UPLOADED_CA_FILE, r as regenerateCertificate, s as clearHttpsListener, t as createCiaoPublisher, u as reloadHttpsListener, v as splitPemCertificates, w as validateUploadedTls, x as writeTlsMode, y as writeExtraSans } from "./hub-mdns-ciao-
|
|
40
|
+
import { A as retirePreviousLocalCa, C as checkUploadedCa, D as loadTlsCert, E as ensureTlsCert, F as closeLanHttp, I as readLanHttpState, L as registerLanHttpHandler, M as allFamiliesListenHost, N as applyLanHttp, O as reissueTlsLeaf, P as bindPendingLanHttp, S as chainsToPublicRoot, T as caReplacementMarkerFile, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, c as leafFingerprintOf, d as servedHttpsLeafFingerprint, f as prepareBootTls, g as readTlsEnabled, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, k as replaceUnconstrainedLocalCa, l as registerHttpsListener, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, p as UPLOADED_CA_FILE, r as regenerateCertificate, s as clearHttpsListener, t as createCiaoPublisher, u as reloadHttpsListener, v as splitPemCertificates, w as validateUploadedTls, x as writeTlsMode, y as writeExtraSans } from "./hub-mdns-ciao-CA6iSuS1.mjs";
|
|
41
41
|
import { n as getPlatformKeychainKey, r as setPlatformKeychainKey, t as clearPlatformKeychainKey } from "./platform-key-source-BWlq0jjn.mjs";
|
|
42
42
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-Di9daRwI.mjs";
|
|
43
|
-
import { _ as backupRecordStoresOf, c as BackupDecryptError, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-
|
|
43
|
+
import { _ as backupRecordStoresOf, c as BackupDecryptError, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-Cqm3OJpy.mjs";
|
|
44
44
|
import { r as nodeCoralFs, t as classifyCoralAccelerator } from "./coral-accelerators-DBlgWB8k.mjs";
|
|
45
45
|
import { z } from "zod";
|
|
46
46
|
import * as crypto$1 from "node:crypto";
|
|
@@ -1177,23 +1177,23 @@ function formatSocketPlane(window) {
|
|
|
1177
1177
|
}
|
|
1178
1178
|
//#endregion
|
|
1179
1179
|
//#region src/kernel/moleculer/mesh-queue-report.ts
|
|
1180
|
-
function isRecord$
|
|
1180
|
+
function isRecord$7(value) {
|
|
1181
1181
|
return typeof value === "object" && value !== null;
|
|
1182
1182
|
}
|
|
1183
1183
|
/** The shape `TcpWriter` keeps its sockets in. Anything else is not a mesh. */
|
|
1184
1184
|
function writerSocketsOf(broker) {
|
|
1185
|
-
if (!isRecord$
|
|
1185
|
+
if (!isRecord$7(broker)) return void 0;
|
|
1186
1186
|
const transit = broker["transit"];
|
|
1187
|
-
if (!isRecord$
|
|
1187
|
+
if (!isRecord$7(transit)) return void 0;
|
|
1188
1188
|
const transporter = transit["tx"];
|
|
1189
|
-
if (!isRecord$
|
|
1189
|
+
if (!isRecord$7(transporter)) return void 0;
|
|
1190
1190
|
const writer = transporter["writer"];
|
|
1191
|
-
if (!isRecord$
|
|
1191
|
+
if (!isRecord$7(writer)) return void 0;
|
|
1192
1192
|
const sockets = writer["sockets"];
|
|
1193
1193
|
return sockets instanceof Map ? sockets : void 0;
|
|
1194
1194
|
}
|
|
1195
1195
|
function readSocket(nodeId, socket) {
|
|
1196
|
-
if (typeof nodeId !== "string" || !isRecord$
|
|
1196
|
+
if (typeof nodeId !== "string" || !isRecord$7(socket)) return void 0;
|
|
1197
1197
|
const queuedBytes = socket["writableLength"];
|
|
1198
1198
|
const bytesWritten = socket["bytesWritten"];
|
|
1199
1199
|
if (typeof queuedBytes !== "number" || typeof bytesWritten !== "number") return void 0;
|
|
@@ -6243,7 +6243,7 @@ async function resolveUncached(options) {
|
|
|
6243
6243
|
}
|
|
6244
6244
|
//#endregion
|
|
6245
6245
|
//#region src/kernel/addon-class-resolver.ts
|
|
6246
|
-
function isRecord$
|
|
6246
|
+
function isRecord$6(value) {
|
|
6247
6247
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6248
6248
|
}
|
|
6249
6249
|
/**
|
|
@@ -6267,14 +6267,14 @@ function isRecord$5(value) {
|
|
|
6267
6267
|
function isAddonConstructor(fn) {
|
|
6268
6268
|
if (typeof fn !== "function") return false;
|
|
6269
6269
|
const proto = fn.prototype;
|
|
6270
|
-
if (!isRecord$
|
|
6270
|
+
if (!isRecord$6(proto)) return false;
|
|
6271
6271
|
return typeof proto["initialize"] === "function";
|
|
6272
6272
|
}
|
|
6273
6273
|
function resolveAddonClass(mod) {
|
|
6274
6274
|
let candidate = mod["default"];
|
|
6275
|
-
if (isRecord$
|
|
6275
|
+
if (isRecord$6(candidate) && "default" in candidate) candidate = candidate["default"];
|
|
6276
6276
|
if (isAddonConstructor(candidate)) return candidate;
|
|
6277
|
-
if (isRecord$
|
|
6277
|
+
if (isRecord$6(candidate)) {
|
|
6278
6278
|
const fn = Object.values(candidate).find(isAddonConstructor);
|
|
6279
6279
|
if (fn) return fn;
|
|
6280
6280
|
}
|
|
@@ -6283,7 +6283,7 @@ function resolveAddonClass(mod) {
|
|
|
6283
6283
|
}
|
|
6284
6284
|
//#endregion
|
|
6285
6285
|
//#region src/kernel/addon-loader.ts
|
|
6286
|
-
function isRecord$
|
|
6286
|
+
function isRecord$5(value) {
|
|
6287
6287
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6288
6288
|
}
|
|
6289
6289
|
/**
|
|
@@ -6381,12 +6381,12 @@ async function importAddonModuleFresh(entryPath) {
|
|
|
6381
6381
|
* AddonPackageManifest + AddonDeclaration.
|
|
6382
6382
|
*/
|
|
6383
6383
|
function isAddonPackageManifest(value) {
|
|
6384
|
-
if (!isRecord$
|
|
6384
|
+
if (!isRecord$5(value)) return false;
|
|
6385
6385
|
if (!Array.isArray(value.addons)) return false;
|
|
6386
|
-
return value.addons.every((a) => isRecord$
|
|
6386
|
+
return value.addons.every((a) => isRecord$5(a) && typeof a.id === "string");
|
|
6387
6387
|
}
|
|
6388
6388
|
function toAddonPackageManifest(value) {
|
|
6389
|
-
if (!isRecord$
|
|
6389
|
+
if (!isRecord$5(value)) return void 0;
|
|
6390
6390
|
if (!isAddonPackageManifest(value)) return void 0;
|
|
6391
6391
|
return value;
|
|
6392
6392
|
}
|
|
@@ -6552,7 +6552,7 @@ var AddonLoader = class {
|
|
|
6552
6552
|
}
|
|
6553
6553
|
if (!fs$1.existsSync(entryPath)) throw new Error(`Entry not found: ${entryPath}`);
|
|
6554
6554
|
const modUnknown = await importAddonModuleFresh(entryPath);
|
|
6555
|
-
const mod = isRecord$
|
|
6555
|
+
const mod = isRecord$5(modUnknown) ? modUnknown : {};
|
|
6556
6556
|
const AddonClass = resolveAddonClass(mod);
|
|
6557
6557
|
if (!AddonClass) throw new Error(`No addon class in ${entryPath}`);
|
|
6558
6558
|
this.addons.set(declaration.id, {
|
|
@@ -6568,7 +6568,7 @@ var AddonLoader = class {
|
|
|
6568
6568
|
/** Load addon from a direct path (for development/testing) */
|
|
6569
6569
|
async loadFromPath(addonId, modulePath, packageName, declaration, packageVersion = "0.0.0") {
|
|
6570
6570
|
const modUnknown = await importAddonModuleFresh(modulePath);
|
|
6571
|
-
const mod = isRecord$
|
|
6571
|
+
const mod = isRecord$5(modUnknown) ? modUnknown : {};
|
|
6572
6572
|
const AddonClass = resolveAddonClass(mod);
|
|
6573
6573
|
if (!AddonClass) throw new Error(`Module ${modulePath} has no default export`);
|
|
6574
6574
|
this.addons.set(addonId, {
|
|
@@ -11844,11 +11844,11 @@ function createDeviceSettingsResolver(door, addonId) {
|
|
|
11844
11844
|
}
|
|
11845
11845
|
//#endregion
|
|
11846
11846
|
//#region src/kernel/settings-door-view.ts
|
|
11847
|
-
function isRecord$
|
|
11847
|
+
function isRecord$4(value) {
|
|
11848
11848
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
11849
11849
|
}
|
|
11850
11850
|
function asBlob(value) {
|
|
11851
|
-
return isRecord$
|
|
11851
|
+
return isRecord$4(value) ? value : {};
|
|
11852
11852
|
}
|
|
11853
11853
|
/**
|
|
11854
11854
|
* Every `system-settings` row under `prefix`, keyed by the suffix — or a throw.
|
|
@@ -14283,9 +14283,147 @@ var import_js_yaml = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((ex
|
|
|
14283
14283
|
var { Type, Schema, FAILSAFE_SCHEMA, JSON_SCHEMA, CORE_SCHEMA, DEFAULT_SCHEMA, load, loadAll, dump, YAMLException, types, safeLoad, safeLoadAll, safeDump } = import_js_yaml.default;
|
|
14284
14284
|
import_js_yaml.default;
|
|
14285
14285
|
//#endregion
|
|
14286
|
+
//#region src/kernel/legacy-config-yaml.ts
|
|
14287
|
+
/**
|
|
14288
|
+
* TRANSITION — delete this module, its spec and the `js-yaml` dependency one
|
|
14289
|
+
* release after it ships (D1018).
|
|
14290
|
+
*
|
|
14291
|
+
* CamStack no longer has a `config.yaml`: the bootstrap config is the
|
|
14292
|
+
* environment plus built-in defaults. A node updated from a release that still
|
|
14293
|
+
* had the file must not change port, host or data directory silently, so for
|
|
14294
|
+
* ONE release the file is parsed here, only to compare: a key whose legacy value
|
|
14295
|
+
* differs from the effective env/default value, and whose environment variable
|
|
14296
|
+
* is not set, is still applied, with a warning naming the variable that
|
|
14297
|
+
* replaces it. A file that matches the defaults is ignored.
|
|
14298
|
+
*
|
|
14299
|
+
* Like `bootstrap-config.ts`, this runs before any logger exists, so the
|
|
14300
|
+
* `console.*` calls are the documented residual (see `ConfigManager`).
|
|
14301
|
+
*/
|
|
14302
|
+
/** The former image default, searched after `CONFIG_PATH` so a recreated container still finds its volume. */
|
|
14303
|
+
var FORMER_IMAGE_CONFIG_PATH = "/config/config.yaml";
|
|
14304
|
+
/** The bootstrap keys a legacy file could still set, with the variable that now owns each. */
|
|
14305
|
+
var LEGACY_KEYS = [
|
|
14306
|
+
{
|
|
14307
|
+
key: "port",
|
|
14308
|
+
envVar: "CAMSTACK_PORT"
|
|
14309
|
+
},
|
|
14310
|
+
{
|
|
14311
|
+
key: "host",
|
|
14312
|
+
envVar: "CAMSTACK_HOST"
|
|
14313
|
+
},
|
|
14314
|
+
{
|
|
14315
|
+
key: "dataPath",
|
|
14316
|
+
envVar: "CAMSTACK_DATA"
|
|
14317
|
+
}
|
|
14318
|
+
];
|
|
14319
|
+
var NO_LEGACY = {
|
|
14320
|
+
overrides: {},
|
|
14321
|
+
notes: []
|
|
14322
|
+
};
|
|
14323
|
+
function isRecord$3(value) {
|
|
14324
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
14325
|
+
}
|
|
14326
|
+
function isEnvSet(env, name) {
|
|
14327
|
+
const value = env[name];
|
|
14328
|
+
return value !== void 0 && value !== "";
|
|
14329
|
+
}
|
|
14330
|
+
/** Where the legacy file would be: `CONFIG_PATH`, the former image default, then under the data root. */
|
|
14331
|
+
function legacyConfigYamlCandidates(env) {
|
|
14332
|
+
const dataRoot = isEnvSet(env, "CAMSTACK_DATA") ? env["CAMSTACK_DATA"] ?? "camstack-data" : path$1.join(process.cwd(), DEFAULT_DATA_PATH);
|
|
14333
|
+
return [
|
|
14334
|
+
...isEnvSet(env, "CONFIG_PATH") ? [env["CONFIG_PATH"] ?? ""] : [],
|
|
14335
|
+
FORMER_IMAGE_CONFIG_PATH,
|
|
14336
|
+
path$1.join(dataRoot, "config.yaml")
|
|
14337
|
+
];
|
|
14338
|
+
}
|
|
14339
|
+
function findLegacyFile(env) {
|
|
14340
|
+
return legacyConfigYamlCandidates(env).find((candidate) => fs$1.existsSync(candidate));
|
|
14341
|
+
}
|
|
14342
|
+
/** The legacy value of a key when it is well-formed, else undefined. */
|
|
14343
|
+
function legacyValue(server, key) {
|
|
14344
|
+
const value = server[key];
|
|
14345
|
+
if (key === "port") return typeof value === "number" && Number.isInteger(value) && value > 0 && value < 65536 ? value : void 0;
|
|
14346
|
+
return typeof value === "string" && value !== "" ? value : void 0;
|
|
14347
|
+
}
|
|
14348
|
+
/** Retired-key notices the file used to earn at boot; they leave with the file. */
|
|
14349
|
+
function retiredKeyNotes(raw) {
|
|
14350
|
+
const notes = [];
|
|
14351
|
+
const section = raw["bootstrap"];
|
|
14352
|
+
if (isRecord$3(section) && "installSource" in section) notes.push({
|
|
14353
|
+
level: "warn",
|
|
14354
|
+
message: "bootstrap.installSource ignored — addons always install from npm; a workspace build reaches a node through `camstack deploy`."
|
|
14355
|
+
});
|
|
14356
|
+
if (isRecord$3(section) && "requiredAddons" in section) notes.push({
|
|
14357
|
+
level: "warn",
|
|
14358
|
+
message: "bootstrap.requiredAddons ignored — the first-boot addon set always comes from the server package."
|
|
14359
|
+
});
|
|
14360
|
+
const keychain = raw["keychain"];
|
|
14361
|
+
if (isRecord$3(keychain) && ("keyFile" in keychain || "previousKeyFile" in keychain)) notes.push({
|
|
14362
|
+
level: "warn",
|
|
14363
|
+
message: "keychain.keyFile / keychain.previousKeyFile ignored — the external master key is a fixed mounted path: mount the file at /run/secrets/camstack-master-key (the key being rotated away from at /run/secrets/camstack-master-key.previous)."
|
|
14364
|
+
});
|
|
14365
|
+
return notes;
|
|
14366
|
+
}
|
|
14367
|
+
/**
|
|
14368
|
+
* Compare a legacy config.yaml, if one exists, with what env and defaults give.
|
|
14369
|
+
* Pure of side effects except for reading the file.
|
|
14370
|
+
*/
|
|
14371
|
+
function reconcileLegacyConfigYaml(env, effective) {
|
|
14372
|
+
const file = findLegacyFile(env);
|
|
14373
|
+
if (file === void 0) return NO_LEGACY;
|
|
14374
|
+
let raw;
|
|
14375
|
+
try {
|
|
14376
|
+
raw = asJsonObject(load(fs$1.readFileSync(file, "utf-8"))) ?? {};
|
|
14377
|
+
} catch (err) {
|
|
14378
|
+
return {
|
|
14379
|
+
overrides: {},
|
|
14380
|
+
notes: [{
|
|
14381
|
+
level: "warn",
|
|
14382
|
+
message: `${file} could not be parsed (${err instanceof Error ? err.message : String(err)}) and is ignored — config.yaml is no longer read. Delete it.`
|
|
14383
|
+
}]
|
|
14384
|
+
};
|
|
14385
|
+
}
|
|
14386
|
+
const serverRaw = raw["server"];
|
|
14387
|
+
const server = isRecord$3(serverRaw) ? serverRaw : {};
|
|
14388
|
+
const overrides = {};
|
|
14389
|
+
const notes = [...retiredKeyNotes(raw)];
|
|
14390
|
+
for (const { key, envVar } of LEGACY_KEYS) {
|
|
14391
|
+
if (isEnvSet(env, envVar)) continue;
|
|
14392
|
+
const legacy = legacyValue(server, key);
|
|
14393
|
+
if (legacy === void 0 || legacy === effective[key]) continue;
|
|
14394
|
+
if (key === "port" && typeof legacy === "number") overrides.port = legacy;
|
|
14395
|
+
else if (key === "host" && typeof legacy === "string") overrides.host = legacy;
|
|
14396
|
+
else if (key === "dataPath" && typeof legacy === "string") overrides.dataPath = legacy;
|
|
14397
|
+
notes.push({
|
|
14398
|
+
level: "warn",
|
|
14399
|
+
message: `${file} is no longer read, but sets server.${key}=${String(legacy)}, still applied for this release: set ${envVar}=${String(legacy)} and delete ${file}.`
|
|
14400
|
+
});
|
|
14401
|
+
}
|
|
14402
|
+
if (!notes.some((n) => n.level === "warn")) notes.push({
|
|
14403
|
+
level: "info",
|
|
14404
|
+
message: `${file} is no longer read and matches the defaults: it can be deleted.`
|
|
14405
|
+
});
|
|
14406
|
+
return {
|
|
14407
|
+
overrides,
|
|
14408
|
+
notes
|
|
14409
|
+
};
|
|
14410
|
+
}
|
|
14411
|
+
/** Notes already printed by this process: the loader runs twice per boot (main.ts and ConfigManager). */
|
|
14412
|
+
var printedNotes = /* @__PURE__ */ new Set();
|
|
14413
|
+
/** Print each note once per process, the way the bootstrap prints everything else. */
|
|
14414
|
+
function logLegacyNotes(notes) {
|
|
14415
|
+
for (const note of notes) {
|
|
14416
|
+
const id = `${note.level}:${note.message}`;
|
|
14417
|
+
if (printedNotes.has(id)) continue;
|
|
14418
|
+
printedNotes.add(id);
|
|
14419
|
+
if (note.level === "warn") console.warn(`[Phase1] WARN ${note.message}`);
|
|
14420
|
+
else console.log(`[Phase1] ${note.message}`);
|
|
14421
|
+
}
|
|
14422
|
+
}
|
|
14423
|
+
//#endregion
|
|
14286
14424
|
//#region src/kernel/bootstrap-config.ts
|
|
14287
14425
|
/**
|
|
14288
|
-
*
|
|
14426
|
+
* Environment + defaults: loading —
|
|
14289
14427
|
* `ConfigManager`'s bootstrap layer, split out of `config-manager.ts` (D675)
|
|
14290
14428
|
* so that file stays one class. The `console.*` calls are the documented
|
|
14291
14429
|
* residuals described on `ConfigManager` (no logger exists yet at boot).
|
|
@@ -14304,26 +14442,20 @@ var ENV_VAR_MAP = {
|
|
|
14304
14442
|
CAMSTACK_DATA: "server.dataPath"
|
|
14305
14443
|
};
|
|
14306
14444
|
/**
|
|
14307
|
-
*
|
|
14308
|
-
* `main.ts` and `ConfigManager` come through here, so a key is
|
|
14309
|
-
*
|
|
14310
|
-
|
|
14311
|
-
|
|
14312
|
-
|
|
14313
|
-
|
|
14314
|
-
|
|
14315
|
-
|
|
14316
|
-
|
|
14317
|
-
|
|
14318
|
-
|
|
14319
|
-
|
|
14320
|
-
|
|
14321
|
-
function warnRetiredYamlKeys(raw) {
|
|
14322
|
-
const section = raw["bootstrap"];
|
|
14323
|
-
if (isRecord$2(section) && "installSource" in section) console.warn("[Phase1] WARN bootstrap.installSource ignored — addons always install from npm; a workspace build reaches a node through `camstack deploy`. Remove the key.");
|
|
14324
|
-
if (isRecord$2(section) && "requiredAddons" in section) console.warn("[Phase1] WARN bootstrap.requiredAddons ignored — the first-boot addon set always comes from the server package. Remove the key.");
|
|
14325
|
-
const keychain = raw["keychain"];
|
|
14326
|
-
if (isRecord$2(keychain) && ("keyFile" in keychain || "previousKeyFile" in keychain)) console.warn("[Phase1] WARN keychain.keyFile / keychain.previousKeyFile ignored — the external master key is a fixed mounted path: mount the file at /run/secrets/camstack-master-key (the key being rotated away from at /run/secrets/camstack-master-key.previous). Remove the keys.");
|
|
14445
|
+
* Built-in defaults with the environment applied — THE bootstrap loader: the
|
|
14446
|
+
* hub's `main.ts` and `ConfigManager` come through here, so a key is read in one
|
|
14447
|
+
* place. There is no config.yaml (D1018); the one release of transition for a
|
|
14448
|
+
* node that still has one lives in `legacy-config-yaml.ts`.
|
|
14449
|
+
*/
|
|
14450
|
+
function loadBootstrapConfig(env = process.env) {
|
|
14451
|
+
const fromEnv = applyEnvOverrides({}, env);
|
|
14452
|
+
const envServer = isRecord$2(fromEnv["server"]) ? fromEnv["server"] : {};
|
|
14453
|
+
const legacy = reconcileLegacyConfigYaml(env, bootstrapSchema.parse(fromEnv).server);
|
|
14454
|
+
logLegacyNotes(legacy.notes);
|
|
14455
|
+
return bootstrapSchema.parse({ server: {
|
|
14456
|
+
...envServer,
|
|
14457
|
+
...legacy.overrides
|
|
14458
|
+
} });
|
|
14327
14459
|
}
|
|
14328
14460
|
/**
|
|
14329
14461
|
* Deep-set a value in a nested plain object using a dot-notation path.
|
|
@@ -14344,13 +14476,13 @@ function setNested(obj, configPath, value) {
|
|
|
14344
14476
|
};
|
|
14345
14477
|
}
|
|
14346
14478
|
/**
|
|
14347
|
-
* Apply env var overrides onto the raw
|
|
14479
|
+
* Apply env var overrides onto the raw object.
|
|
14348
14480
|
* Only bootstrap-level env vars are applied.
|
|
14349
14481
|
*/
|
|
14350
|
-
function applyEnvOverrides(raw) {
|
|
14482
|
+
function applyEnvOverrides(raw, env) {
|
|
14351
14483
|
let result = { ...raw };
|
|
14352
14484
|
for (const [envKey, configPath] of Object.entries(ENV_VAR_MAP)) {
|
|
14353
|
-
const envValue =
|
|
14485
|
+
const envValue = env[envKey];
|
|
14354
14486
|
if (envValue === void 0 || envValue === "") continue;
|
|
14355
14487
|
const coerced = configPath === "server.port" ? Number(envValue) : envValue;
|
|
14356
14488
|
result = setNested(result, configPath, coerced);
|
|
@@ -14358,15 +14490,6 @@ function applyEnvOverrides(raw) {
|
|
|
14358
14490
|
}
|
|
14359
14491
|
return result;
|
|
14360
14492
|
}
|
|
14361
|
-
function loadYaml(configPath) {
|
|
14362
|
-
if (!fs$1.existsSync(configPath)) {
|
|
14363
|
-
console.warn(`[ConfigManager] Config file not found at: ${configPath}\n → Using built-in defaults. Set CONFIG_PATH env var or create the file.\n → Example path from project root: ./server/backend/data/config.yaml`);
|
|
14364
|
-
return {};
|
|
14365
|
-
}
|
|
14366
|
-
const parsed = load(fs$1.readFileSync(configPath, "utf-8")) ?? {};
|
|
14367
|
-
console.log(`[ConfigManager] Loaded config from: ${configPath}`);
|
|
14368
|
-
return parsed;
|
|
14369
|
-
}
|
|
14370
14493
|
//#endregion
|
|
14371
14494
|
//#region src/kernel/store-settings-view.ts
|
|
14372
14495
|
function createStoreSettingsView(addonId, cm) {
|
|
@@ -14446,13 +14569,13 @@ function createStoreSettingsView(addonId, cm) {
|
|
|
14446
14569
|
* the stale rows must still never answer: merging them back in would let a
|
|
14447
14570
|
* stale DB copy stand in for a credential. The one-off ops script deletes them.
|
|
14448
14571
|
*
|
|
14449
|
-
* So a bootstrap-owned section is answered from
|
|
14572
|
+
* So a bootstrap-owned section is answered from the environment and built-in defaults ONLY, and
|
|
14450
14573
|
* the store may add exactly the keys in {@link STORE_READABLE_BOOTSTRAP_KEYS}:
|
|
14451
14574
|
* the values the operator edits on System → Authentication (`auth.tokenExpiry`,
|
|
14452
14575
|
* `auth.accessTokenExpiry`, `auth.trustedProxies`). Widening this list is a security decision, not a
|
|
14453
14576
|
* convenience.
|
|
14454
14577
|
*/
|
|
14455
|
-
/** Top-level sections whose authority is
|
|
14578
|
+
/** Top-level sections whose authority is the environment and built-in defaults (`bootstrapSchema`). */
|
|
14456
14579
|
var BOOTSTRAP_OWNED_SECTIONS = new Set([
|
|
14457
14580
|
"server",
|
|
14458
14581
|
"auth",
|
|
@@ -14467,7 +14590,7 @@ var STORE_READABLE_BOOTSTRAP_KEYS = new Set([
|
|
|
14467
14590
|
"auth.corsOrigins",
|
|
14468
14591
|
"server.name"
|
|
14469
14592
|
]);
|
|
14470
|
-
/** May the settings store answer `key`, or is it
|
|
14593
|
+
/** May the settings store answer `key`, or is it environment and defaults only? */
|
|
14471
14594
|
function storeMayAnswer(key) {
|
|
14472
14595
|
const dot = key.indexOf(".");
|
|
14473
14596
|
const section = dot === -1 ? key : key.slice(0, dot);
|
|
@@ -14605,8 +14728,8 @@ var ConfigManager = class {
|
|
|
14605
14728
|
settingsDoor = null;
|
|
14606
14729
|
/** Boot-time mirror of the preloaded `system-settings` keys (door mode, D675). */
|
|
14607
14730
|
systemMirror = new SystemSettingsMirror();
|
|
14608
|
-
constructor(
|
|
14609
|
-
this.bootstrapConfig = loadBootstrapConfig(
|
|
14731
|
+
constructor() {
|
|
14732
|
+
this.bootstrapConfig = loadBootstrapConfig();
|
|
14610
14733
|
}
|
|
14611
14734
|
/**
|
|
14612
14735
|
* Wire the settings-store backend. Called once, after the `settings-store`
|
|
@@ -14702,12 +14825,12 @@ var ConfigManager = class {
|
|
|
14702
14825
|
*
|
|
14703
14826
|
* Sources are merged in priority order (lowest → highest):
|
|
14704
14827
|
* 1. RUNTIME_DEFAULTS — kernel constants.
|
|
14705
|
-
* 2. Bootstrap config — values
|
|
14828
|
+
* 2. Bootstrap config — values from the environment and built-in defaults at boot.
|
|
14706
14829
|
* 3. Settings-store — runtime writes via the `settings-store` capability.
|
|
14707
14830
|
*
|
|
14708
14831
|
* Higher layers override earlier ones. Merging (instead of short-circuiting
|
|
14709
14832
|
* on the first non-null source) prevents a single store-seeded key from
|
|
14710
|
-
* shadowing the rest of the section that only lives in config.
|
|
14833
|
+
* shadowing the rest of the section that only lives in the bootstrap config.
|
|
14711
14834
|
* The kernel is agnostic about the store backend — any `ISettingsStore`
|
|
14712
14835
|
* implementation (sqlite, redis, in-memory, …) behaves identically here.
|
|
14713
14836
|
*
|
|
@@ -14726,7 +14849,7 @@ var ConfigManager = class {
|
|
|
14726
14849
|
}
|
|
14727
14850
|
return merged;
|
|
14728
14851
|
}
|
|
14729
|
-
/** Runtime defaults, then
|
|
14852
|
+
/** Runtime defaults, then environment + defaults — the layers under the store. */
|
|
14730
14853
|
sectionBase(section) {
|
|
14731
14854
|
const merged = {};
|
|
14732
14855
|
const defaults = asJsonObject(this.getFromRuntimeDefaults(section));
|
|
@@ -27889,14 +28012,14 @@ var en_default = {
|
|
|
27889
28012
|
"providerInfo.s_filesystem-storage.title": "Filesystem",
|
|
27890
28013
|
"providerInfo.s_filesystem-storage.basePath.label": "Base path",
|
|
27891
28014
|
"providerInfo.s_filesystem-storage.basePath.description": "Absolute directory path where files are stored.",
|
|
27892
|
-
"global.s_system-config-server.description": "The name of this server, and its connection settings (read-only,
|
|
28015
|
+
"global.s_system-config-server.description": "The name of this server, and its connection settings (read-only, set by the environment).",
|
|
27893
28016
|
"global.s_system-config-server.server-restart-note.label": "Restart required",
|
|
27894
28017
|
"global.s_system-config-server.port.label": "Port",
|
|
27895
|
-
"global.s_system-config-server.port.description": "Listening port",
|
|
28018
|
+
"global.s_system-config-server.port.description": "Listening port (CAMSTACK_PORT)",
|
|
27896
28019
|
"global.s_system-config-server.host.label": "Host",
|
|
27897
|
-
"global.s_system-config-server.host.description": "Bind address",
|
|
28020
|
+
"global.s_system-config-server.host.description": "Bind address (CAMSTACK_HOST)",
|
|
27898
28021
|
"global.s_system-config-server.dataPath.label": "Data Path",
|
|
27899
|
-
"global.s_system-config-server.dataPath.description": "Root data directory",
|
|
28022
|
+
"global.s_system-config-server.dataPath.description": "Root data directory (CAMSTACK_DATA)",
|
|
27900
28023
|
"global.s_system-config-auth.description": "Token and session settings.",
|
|
27901
28024
|
"global.s_system-config-auth.tokenExpiry.label": "Session lifetime",
|
|
27902
28025
|
"global.s_system-config-auth.tokenExpiry.description": "How long a sign-in lasts without being used, as a duration string (e.g. 7d, 30d). Every refresh starts it again, so a device in use stays signed in; one left unopened this long must sign in again. A bare number is rejected — it would be read as milliseconds. Applies from the next sign-in or refresh.",
|
|
@@ -28148,14 +28271,14 @@ var it_default = {
|
|
|
28148
28271
|
"providerInfo.s_filesystem-storage.title": "File system",
|
|
28149
28272
|
"providerInfo.s_filesystem-storage.basePath.label": "Percorso base",
|
|
28150
28273
|
"providerInfo.s_filesystem-storage.basePath.description": "Percorso assoluto della cartella dove vengono salvati i file.",
|
|
28151
|
-
"global.s_system-config-server.description": "Il nome di questo server e le sue impostazioni di connessione (sola lettura,
|
|
28274
|
+
"global.s_system-config-server.description": "Il nome di questo server e le sue impostazioni di connessione (sola lettura, impostate dall'ambiente).",
|
|
28152
28275
|
"global.s_system-config-server.server-restart-note.label": "Riavvio necessario",
|
|
28153
28276
|
"global.s_system-config-server.port.label": "Porta",
|
|
28154
|
-
"global.s_system-config-server.port.description": "Porta di ascolto",
|
|
28277
|
+
"global.s_system-config-server.port.description": "Porta di ascolto (CAMSTACK_PORT)",
|
|
28155
28278
|
"global.s_system-config-server.host.label": "Host",
|
|
28156
|
-
"global.s_system-config-server.host.description": "Indirizzo di bind",
|
|
28279
|
+
"global.s_system-config-server.host.description": "Indirizzo di bind (CAMSTACK_HOST)",
|
|
28157
28280
|
"global.s_system-config-server.dataPath.label": "Percorso dei dati",
|
|
28158
|
-
"global.s_system-config-server.dataPath.description": "Cartella radice dei dati",
|
|
28281
|
+
"global.s_system-config-server.dataPath.description": "Cartella radice dei dati (CAMSTACK_DATA)",
|
|
28159
28282
|
"global.s_system-config-auth.description": "Impostazioni di token e sessione.",
|
|
28160
28283
|
"global.s_system-config-auth.tokenExpiry.label": "Durata della sessione",
|
|
28161
28284
|
"global.s_system-config-auth.tokenExpiry.description": "Per quanto tempo resta valido un accesso senza essere usato, come stringa di durata (ad es. 7d, 30d). Ogni rinnovo lo fa ripartire, quindi un dispositivo in uso resta connesso; uno lasciato inutilizzato per questo tempo deve accedere di nuovo. Un numero senza unità viene rifiutato: sarebbe letto come millisecondi. Si applica dal prossimo accesso o rinnovo.",
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment + defaults: loading —
|
|
3
|
+
* `ConfigManager`'s bootstrap layer, split out of `config-manager.ts` (D675)
|
|
4
|
+
* so that file stays one class. The `console.*` calls are the documented
|
|
5
|
+
* residuals described on `ConfigManager` (no logger exists yet at boot).
|
|
6
|
+
*/
|
|
1
7
|
import { type BootstrapConfig } from "./config-schema.js";
|
|
2
8
|
/**
|
|
3
|
-
*
|
|
4
|
-
* `main.ts` and `ConfigManager` come through here, so a key is
|
|
5
|
-
*
|
|
9
|
+
* Built-in defaults with the environment applied — THE bootstrap loader: the
|
|
10
|
+
* hub's `main.ts` and `ConfigManager` come through here, so a key is read in one
|
|
11
|
+
* place. There is no config.yaml (D1018); the one release of transition for a
|
|
12
|
+
* node that still has one lives in `legacy-config-yaml.ts`.
|
|
6
13
|
*/
|
|
7
|
-
export declare function loadBootstrapConfig(
|
|
8
|
-
readonly warnRetiredKeys?: boolean;
|
|
9
|
-
}): BootstrapConfig;
|
|
14
|
+
export declare function loadBootstrapConfig(env?: Readonly<Record<string, string | undefined>>): BootstrapConfig;
|
|
@@ -9,7 +9,7 @@ export declare class ConfigManager {
|
|
|
9
9
|
private settingsDoor;
|
|
10
10
|
/** Boot-time mirror of the preloaded `system-settings` keys (door mode, D675). */
|
|
11
11
|
private readonly systemMirror;
|
|
12
|
-
constructor(
|
|
12
|
+
constructor();
|
|
13
13
|
/**
|
|
14
14
|
* Wire the settings-store backend. Called once, after the `settings-store`
|
|
15
15
|
* capability provider has registered (normally during Phase-1 infra boot).
|
|
@@ -70,12 +70,12 @@ export declare class ConfigManager {
|
|
|
70
70
|
*
|
|
71
71
|
* Sources are merged in priority order (lowest → highest):
|
|
72
72
|
* 1. RUNTIME_DEFAULTS — kernel constants.
|
|
73
|
-
* 2. Bootstrap config — values
|
|
73
|
+
* 2. Bootstrap config — values from the environment and built-in defaults at boot.
|
|
74
74
|
* 3. Settings-store — runtime writes via the `settings-store` capability.
|
|
75
75
|
*
|
|
76
76
|
* Higher layers override earlier ones. Merging (instead of short-circuiting
|
|
77
77
|
* on the first non-null source) prevents a single store-seeded key from
|
|
78
|
-
* shadowing the rest of the section that only lives in config.
|
|
78
|
+
* shadowing the rest of the section that only lives in the bootstrap config.
|
|
79
79
|
* The kernel is agnostic about the store backend — any `ISettingsStore`
|
|
80
80
|
* implementation (sqlite, redis, in-memory, …) behaves identically here.
|
|
81
81
|
*
|
|
@@ -85,7 +85,7 @@ export declare class ConfigManager {
|
|
|
85
85
|
* the door.
|
|
86
86
|
*/
|
|
87
87
|
getSection(section: string): Record<string, unknown>;
|
|
88
|
-
/** Runtime defaults, then
|
|
88
|
+
/** Runtime defaults, then environment + defaults — the layers under the store. */
|
|
89
89
|
private sectionBase;
|
|
90
90
|
/**
|
|
91
91
|
* {@link getSection} through the async door — what the door-backed settings
|
|
@@ -153,7 +153,7 @@ export declare class ConfigManager {
|
|
|
153
153
|
hasSyncStore(): boolean;
|
|
154
154
|
/** Get a value from the parsed bootstrap config.
|
|
155
155
|
* Generic overload is a documented type-level bridge — callers are responsible
|
|
156
|
-
* for passing a T that matches the config
|
|
156
|
+
* for passing a T that matches the bootstrap config shape. */
|
|
157
157
|
getBootstrap(configPath: string): unknown;
|
|
158
158
|
getBootstrap<T>(configPath: string): T | undefined;
|
|
159
159
|
/**
|
|
@@ -10,10 +10,9 @@ export type BootstrapServerConfig = {
|
|
|
10
10
|
/** Bootstrap `bootstrap` section — see {@link bootstrapAddonsSchema}. */
|
|
11
11
|
export type BootstrapAddonsConfig = Record<never, never>;
|
|
12
12
|
/**
|
|
13
|
-
* Bootstrap config —
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* `tls`, `keychain.keyFile` / `previousKeyFile` or `bootstrap.settingsStoreAddon` / `forceDisable` / `installSource` / `requiredAddons` boots with them ignored.
|
|
13
|
+
* Bootstrap config — the three env overrides over built-in defaults, ONLY, at
|
|
14
|
+
* startup, by `loadBootstrapConfig`, the one loader (D1018: there is no
|
|
15
|
+
* config.yaml). A key not named here is not read.
|
|
17
16
|
*/
|
|
18
17
|
export type BootstrapConfig = {
|
|
19
18
|
server: BootstrapServerConfig;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** The bootstrap keys a legacy file could still set, with the variable that now owns each. */
|
|
2
|
+
declare const LEGACY_KEYS: readonly [{
|
|
3
|
+
readonly key: "port";
|
|
4
|
+
readonly envVar: "CAMSTACK_PORT";
|
|
5
|
+
}, {
|
|
6
|
+
readonly key: "host";
|
|
7
|
+
readonly envVar: "CAMSTACK_HOST";
|
|
8
|
+
}, {
|
|
9
|
+
readonly key: "dataPath";
|
|
10
|
+
readonly envVar: "CAMSTACK_DATA";
|
|
11
|
+
}];
|
|
12
|
+
export type LegacyBootstrapKey = (typeof LEGACY_KEYS)[number]["key"];
|
|
13
|
+
/** The effective value of each key, from env and defaults, before the legacy file is consulted. */
|
|
14
|
+
export interface EffectiveBootstrapValues {
|
|
15
|
+
readonly port: number;
|
|
16
|
+
readonly host: string;
|
|
17
|
+
readonly dataPath: string;
|
|
18
|
+
}
|
|
19
|
+
export interface LegacyNote {
|
|
20
|
+
readonly level: "info" | "warn";
|
|
21
|
+
readonly message: string;
|
|
22
|
+
}
|
|
23
|
+
export interface LegacyConfigYamlResult {
|
|
24
|
+
/** Values to apply under the environment: only keys whose env var is unset and whose legacy value differs. */
|
|
25
|
+
readonly overrides: Partial<EffectiveBootstrapValues>;
|
|
26
|
+
readonly notes: readonly LegacyNote[];
|
|
27
|
+
}
|
|
28
|
+
/** Where the legacy file would be: `CONFIG_PATH`, the former image default, then under the data root. */
|
|
29
|
+
export declare function legacyConfigYamlCandidates(env: Readonly<Record<string, string | undefined>>): readonly string[];
|
|
30
|
+
/**
|
|
31
|
+
* Compare a legacy config.yaml, if one exists, with what env and defaults give.
|
|
32
|
+
* Pure of side effects except for reading the file.
|
|
33
|
+
*/
|
|
34
|
+
export declare function reconcileLegacyConfigYaml(env: Readonly<Record<string, string | undefined>>, effective: EffectiveBootstrapValues): LegacyConfigYamlResult;
|
|
35
|
+
/** Print each note once per process, the way the bootstrap prints everything else. */
|
|
36
|
+
export declare function logLegacyNotes(notes: readonly LegacyNote[]): void;
|
|
37
|
+
export {};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* A section a bootstrap file owns (`auth`, `server`, ...) is answered only for
|
|
8
8
|
* the keys the store may answer ({@link storeMayAnswer}); the rest of such a
|
|
9
|
-
* section is
|
|
9
|
+
* section is the environment and built-in defaults and lives in the hub process alone.
|
|
10
10
|
*/
|
|
11
11
|
import type { ISettingsStoreProvider } from "@camstack/types";
|
|
12
12
|
/** The door slice sections need. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** The only keys under a bootstrap-owned section the store may answer. */
|
|
2
2
|
export declare const STORE_READABLE_BOOTSTRAP_KEYS: ReadonlySet<string>;
|
|
3
|
-
/** May the settings store answer `key`, or is it
|
|
3
|
+
/** May the settings store answer `key`, or is it environment and defaults only? */
|
|
4
4
|
export declare function storeMayAnswer(key: string): boolean;
|
|
5
5
|
/**
|
|
6
6
|
* Key prefixes loaded from the door into memory ONCE at boot, so the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ks as collectSecretMarkerRefs } from "./dist-
|
|
1
|
+
import { ks as collectSecretMarkerRefs } from "./dist-o_M5WSYU.mjs";
|
|
2
2
|
//#region src/builtins/sqlite-storage/migrations/legacy-integration-rows-door.ts
|
|
3
3
|
/**
|
|
4
4
|
* Migration-only door for the leftover integration rows (planning#416).
|