@camstack/system 1.2.436 → 1.2.438

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.
Files changed (96) hide show
  1. package/dist/addon-runner.js +64 -12
  2. package/dist/addon-runner.mjs +65 -13
  3. package/dist/{agent-https-B8lKYVtU.mjs → agent-https-BPfHrI4c.mjs} +3 -3
  4. package/dist/auth/login-session-manager.d.ts +2 -0
  5. package/dist/auth/session-revocation-bus.d.ts +32 -0
  6. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  7. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  8. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  9. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  10. package/dist/builtins/alerts/alerts.addon.js +7 -1
  11. package/dist/builtins/alerts/alerts.addon.mjs +7 -1
  12. package/dist/builtins/autotrack/index.js +1 -1
  13. package/dist/builtins/autotrack/index.mjs +1 -1
  14. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  15. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  16. package/dist/builtins/calendars/calendars.addon.js +1 -1
  17. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  18. package/dist/builtins/camera-grid/index.js +9 -1
  19. package/dist/builtins/camera-grid/index.mjs +9 -1
  20. package/dist/builtins/composer/composer.addon.js +2 -2
  21. package/dist/builtins/composer/composer.addon.mjs +2 -2
  22. package/dist/builtins/console-logging/index.js +12 -5
  23. package/dist/builtins/console-logging/index.mjs +12 -5
  24. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  25. package/dist/builtins/core-blocks/core-blocks.addon.mjs +5 -5
  26. package/dist/builtins/device-manager/device-manager.addon.d.ts +5 -0
  27. package/dist/builtins/device-manager/device-manager.addon.js +702 -28
  28. package/dist/builtins/device-manager/device-manager.addon.mjs +702 -28
  29. package/dist/builtins/device-manager/device-meta-types.d.ts +4 -0
  30. package/dist/builtins/device-manager/device-provider-context.d.ts +9 -0
  31. package/dist/builtins/device-manager/device-removal-hooks.d.ts +103 -0
  32. package/dist/builtins/device-manager/device-row-store.d.ts +1 -0
  33. package/dist/builtins/device-manager/device-tombstone-store.d.ts +58 -0
  34. package/dist/builtins/device-manager/removal-cleanup.d.ts +50 -0
  35. package/dist/builtins/hub-forwarder/index.js +1 -1
  36. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  37. package/dist/builtins/keychain/index.js +37 -4
  38. package/dist/builtins/keychain/index.mjs +37 -4
  39. package/dist/builtins/keychain/keychain-service.d.ts +14 -0
  40. package/dist/builtins/keychain/keychain-store.d.ts +1 -1
  41. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  42. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  43. package/dist/builtins/local-auth/local-auth.addon.js +53 -12
  44. package/dist/builtins/local-auth/local-auth.addon.mjs +53 -13
  45. package/dist/builtins/local-network/local-network.addon.js +10 -1
  46. package/dist/builtins/local-network/local-network.addon.mjs +13 -4
  47. package/dist/builtins/loki-logging/index.js +28 -5
  48. package/dist/builtins/loki-logging/index.mjs +28 -5
  49. package/dist/builtins/native-metrics/native-metrics.addon.js +11 -1
  50. package/dist/builtins/native-metrics/native-metrics.addon.mjs +20 -10
  51. package/dist/builtins/platform-probe/index.js +1 -1
  52. package/dist/builtins/platform-probe/index.mjs +8 -8
  53. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  54. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  55. package/dist/builtins/snapshot/index.js +11 -1
  56. package/dist/builtins/snapshot/index.mjs +11 -1
  57. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +4 -1
  58. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +4 -1
  59. package/dist/builtins/sqlite-storage/index.js +1 -1
  60. package/dist/builtins/sqlite-storage/index.mjs +1 -1
  61. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  62. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  63. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  64. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  65. package/dist/builtins/system-config/system-config.addon.d.ts +9 -0
  66. package/dist/builtins/system-config/system-config.addon.js +135 -72
  67. package/dist/builtins/system-config/system-config.addon.mjs +135 -73
  68. package/dist/builtins/winston-logging/index.js +14 -5
  69. package/dist/builtins/winston-logging/index.mjs +14 -5
  70. package/dist/{composition-sources-BAOlCu4j.js → composition-sources-DI3Z83vG.js} +1 -1
  71. package/dist/{composition-sources-gN_BWUKp.mjs → composition-sources-DpHGCjdL.mjs} +1 -1
  72. package/dist/{constants-BFpowodq.mjs → constants-DQK705Sb.mjs} +1 -1
  73. package/dist/{constants-GENKqk9k.js → constants-wkcn5Ij3.js} +1 -1
  74. package/dist/{device-ca-CuWuRW9N.js → device-ca-BSvkXqyI.js} +1 -1
  75. package/dist/{device-ca-BNM5ai4t.mjs → device-ca-DvIZjXIl.mjs} +1 -1
  76. package/dist/{dist-DjD2M79P.mjs → dist-Dc8GKC5H.mjs} +301 -6
  77. package/dist/{dist-DVe0Nsp8.js → dist-GgG-7amw.js} +348 -5
  78. package/dist/file-host-worker.js +1 -1
  79. package/dist/file-host-worker.mjs +1 -1
  80. package/dist/{hub-mdns-ciao-DJRwtlA8.mjs → hub-mdns-ciao-DMlQTdPU.mjs} +1 -1
  81. package/dist/i18n/catalog-registry.d.ts +35 -0
  82. package/dist/i18n/index.d.ts +2 -0
  83. package/dist/index.d.ts +3 -0
  84. package/dist/index.js +666 -21
  85. package/dist/index.mjs +676 -38
  86. package/dist/kernel/gc-census.d.ts +18 -1
  87. package/dist/kernel/settings-view-types.d.ts +2 -0
  88. package/dist/kernel/transport/local-transport.d.ts +3 -0
  89. package/dist/kernel/transport/peer-answered-error.d.ts +5 -1
  90. package/dist/{restore-archive-D4h904rb.js → restore-archive-CTRz8v9o.js} +1 -1
  91. package/dist/{restore-archive-BxmP1ChO.mjs → restore-archive-DPg9duVY.mjs} +1 -1
  92. package/dist/{retired-settings-keys-CYP5IZJ5.js → retired-settings-keys-Dr_4lfKu.js} +1 -1
  93. package/dist/{retired-settings-keys-CQaknvx1.mjs → retired-settings-keys-Is0zO8gX.mjs} +1 -1
  94. package/dist/{wal-maintenance-CaDsrJM_.mjs → wal-maintenance-Bx3lcVA7.mjs} +0 -0
  95. package/dist/{wal-maintenance-Br60onAQ.js → wal-maintenance-mjB2i-VR.js} +0 -0
  96. package/package.json +1 -1
@@ -1,15 +1,16 @@
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
- import { Rr as customAction, Wr as hydrateSchema, br as errMsg, xr as BaseAddon, zr as defineCustomActions } from "../../dist-DjD2M79P.mjs";
2
+ import { Dr as errMsg, Gr as customAction, Jn as shortHostname, Kr as defineCustomActions, Or as BaseAddon, Y as ServerNameSchema, Zr as hydrateSchema } from "../../dist-Dc8GKC5H.mjs";
3
3
  import { t as require_safe_buffer } from "../../safe-buffer-B1OjL1I9.mjs";
4
4
  import { a as KeyUsagesExtension, c as Pkcs10CertificateRequestGenerator, d as X509Certificate$1, f as X509CertificateGenerator, g as backdatedNotBefore, 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-CDvj67p1.mjs";
5
- import { A as AgentHttpsNames, M as setProcessAgentHttpsNames, O as AGENT_HTTPS_NAMES_COLLECTION, d as isPrivateAddress, j as getProcessAgentHttpsNames, k as AGENT_HTTPS_NAMES_COLUMNS, u as isLocalOnlyHostname } from "../../agent-https-B8lKYVtU.mjs";
6
- import { a as MESH_CA_KEY_REF, c as SERVER_AUTH_OID, i as MESH_CA_FIELD, 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 } from "../../constants-BFpowodq.mjs";
5
+ import { A as AgentHttpsNames, M as setProcessAgentHttpsNames, O as AGENT_HTTPS_NAMES_COLLECTION, d as isPrivateAddress, j as getProcessAgentHttpsNames, k as AGENT_HTTPS_NAMES_COLUMNS, u as isLocalOnlyHostname } from "../../agent-https-BPfHrI4c.mjs";
6
+ import { a as MESH_CA_KEY_REF, c as SERVER_AUTH_OID, i as MESH_CA_FIELD, 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 } from "../../constants-DQK705Sb.mjs";
7
7
  import { t as require_src } from "../../src-hG4grMU4.mjs";
8
8
  import { z } from "zod";
9
9
  import { X509Certificate, createHash, createPrivateKey, randomBytes, randomInt, sign, timingSafeEqual, verify, webcrypto } from "node:crypto";
10
10
  import { BlockList, isIP } from "node:net";
11
11
  import { lstat, readdir, readlink, realpath } from "node:fs/promises";
12
12
  import { posix, win32 } from "node:path";
13
+ import os from "node:os";
13
14
  import { fileURLToPath } from "node:url";
14
15
  import * as xi from "node:fs";
15
16
  import * as tls from "node:tls";
@@ -21356,7 +21357,7 @@ var require_kleur = /* @__PURE__ */ __commonJSMin(((exports, module) => {
21356
21357
  //#region ../../node_modules/moleculer/src/utils.js
21357
21358
  var require_utils$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
21358
21359
  var kleur = require_kleur();
21359
- var os$16 = __require("os");
21360
+ var os$17 = __require("os");
21360
21361
  var path$39 = __require("path");
21361
21362
  var fs$18 = __require("fs");
21362
21363
  var { TimeoutError } = require_errors$2();
@@ -21455,7 +21456,7 @@ var require_utils$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
21455
21456
  * @returns
21456
21457
  */
21457
21458
  getNodeID() {
21458
- return os$16.hostname().toLowerCase() + "-" + process.pid;
21459
+ return os$17.hostname().toLowerCase() + "-" + process.pid;
21459
21460
  },
21460
21461
  /**
21461
21462
  * Get list of local IPs
@@ -21465,7 +21466,7 @@ var require_utils$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
21465
21466
  getIpList() {
21466
21467
  const list = [];
21467
21468
  const ilist = [];
21468
- const interfaces = os$16.networkInterfaces();
21469
+ const interfaces = os$17.networkInterfaces();
21469
21470
  for (let iface in interfaces) for (let i in interfaces[iface]) {
21470
21471
  const f = interfaces[iface]?.[i];
21471
21472
  if (f.family === "IPv4") if (f.internal) {
@@ -23151,7 +23152,7 @@ var require_event$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23151
23152
  var require_datadog$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23152
23153
  var BaseReporter = require_base$8();
23153
23154
  var _ = require_lodash();
23154
- var os$15 = __require("os");
23155
+ var os$16 = __require("os");
23155
23156
  var { MoleculerError } = require_errors$2();
23156
23157
  var METRIC = require_constants$6();
23157
23158
  var { isFunction } = require_utils$3();
@@ -23184,7 +23185,7 @@ var require_datadog$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23184
23185
  super(opts);
23185
23186
  /** @type {DatadogReporterOptions} */
23186
23187
  this.opts = _.defaultsDeep(this.opts, {
23187
- host: os$15.hostname(),
23188
+ host: os$16.hostname(),
23188
23189
  baseUrl: BASE_URL,
23189
23190
  apiVersion: "v1",
23190
23191
  path: "/series",
@@ -23860,18 +23861,18 @@ var require_cpu_usage$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23860
23861
  *
23861
23862
  * Based on: https://github.com/icebob/cpu
23862
23863
  */
23863
- var os$14 = __require("os");
23864
+ var os$15 = __require("os");
23864
23865
  /* istanbul ignore next */
23865
23866
  module.exports = function getCpuUsage(sampleTime = 100) {
23866
23867
  return new Promise((resolve, reject) => {
23867
23868
  try {
23868
- const first = os$14.cpus().map((cpu) => cpu.times);
23869
+ const first = os$15.cpus().map((cpu) => cpu.times);
23869
23870
  setTimeout(() => {
23870
23871
  try {
23871
- const second = os$14.cpus().map((cpu) => cpu.times);
23872
+ const second = os$15.cpus().map((cpu) => cpu.times);
23872
23873
  setTimeout(() => {
23873
23874
  try {
23874
- const third = os$14.cpus().map((cpu) => cpu.times);
23875
+ const third = os$15.cpus().map((cpu) => cpu.times);
23875
23876
  const usages = [];
23876
23877
  for (let i = 0; i < first.length; i++) {
23877
23878
  const first_idle = first[i].idle;
@@ -23904,7 +23905,7 @@ var require_cpu_usage$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23904
23905
  //#endregion
23905
23906
  //#region ../../node_modules/moleculer/src/metrics/commons.js
23906
23907
  var require_commons = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23907
- var os$13 = __require("os");
23908
+ var os$14 = __require("os");
23908
23909
  var METRIC = require_constants$6();
23909
23910
  var cpuUsage = require_cpu_usage$1();
23910
23911
  var v8;
@@ -24083,27 +24084,27 @@ var require_commons = /* @__PURE__ */ __commonJSMin(((exports, module) => {
24083
24084
  name: METRIC.OS_TYPE,
24084
24085
  type: METRIC.TYPE_INFO,
24085
24086
  description: "OS type"
24086
- }).set(os$13.type());
24087
+ }).set(os$14.type());
24087
24088
  this.register({
24088
24089
  name: METRIC.OS_RELEASE,
24089
24090
  type: METRIC.TYPE_INFO,
24090
24091
  description: "OS release"
24091
- }).set(os$13.release());
24092
+ }).set(os$14.release());
24092
24093
  this.register({
24093
24094
  name: METRIC.OS_HOSTNAME,
24094
24095
  type: METRIC.TYPE_INFO,
24095
24096
  description: "Hostname"
24096
- }).set(os$13.hostname());
24097
+ }).set(os$14.hostname());
24097
24098
  this.register({
24098
24099
  name: METRIC.OS_ARCH,
24099
24100
  type: METRIC.TYPE_INFO,
24100
24101
  description: "OS architecture"
24101
- }).set(os$13.arch());
24102
+ }).set(os$14.arch());
24102
24103
  this.register({
24103
24104
  name: METRIC.OS_PLATFORM,
24104
24105
  type: METRIC.TYPE_INFO,
24105
24106
  description: "OS platform"
24106
- }).set(os$13.platform());
24107
+ }).set(os$14.platform());
24107
24108
  const userInfo = getUserInfo();
24108
24109
  this.register({
24109
24110
  name: METRIC.OS_USER_UID,
@@ -24254,22 +24255,22 @@ var require_commons = /* @__PURE__ */ __commonJSMin(((exports, module) => {
24254
24255
  }
24255
24256
  this.set(METRIC.PROCESS_UPTIME, process.uptime());
24256
24257
  this.set(METRIC.PROCESS_INTERNAL_ACTIVE_HANDLES, process.getActiveResourcesInfo().length);
24257
- const freeMem = os$13.freemem();
24258
- const totalMem = os$13.totalmem();
24258
+ const freeMem = os$14.freemem();
24259
+ const totalMem = os$14.totalmem();
24259
24260
  const usedMem = totalMem - freeMem;
24260
24261
  this.set(METRIC.OS_MEMORY_FREE, freeMem);
24261
24262
  this.set(METRIC.OS_MEMORY_USED, usedMem);
24262
24263
  this.set(METRIC.OS_MEMORY_TOTAL, totalMem);
24263
- this.set(METRIC.OS_UPTIME, os$13.uptime());
24264
- this.set(METRIC.OS_TYPE, os$13.type());
24265
- this.set(METRIC.OS_RELEASE, os$13.release());
24266
- this.set(METRIC.OS_HOSTNAME, os$13.hostname());
24267
- this.set(METRIC.OS_ARCH, os$13.arch());
24268
- this.set(METRIC.OS_PLATFORM, os$13.platform());
24264
+ this.set(METRIC.OS_UPTIME, os$14.uptime());
24265
+ this.set(METRIC.OS_TYPE, os$14.type());
24266
+ this.set(METRIC.OS_RELEASE, os$14.release());
24267
+ this.set(METRIC.OS_HOSTNAME, os$14.hostname());
24268
+ this.set(METRIC.OS_ARCH, os$14.arch());
24269
+ this.set(METRIC.OS_PLATFORM, os$14.platform());
24269
24270
  const getNetworkInterfaces = () => {
24270
24271
  const list = [];
24271
24272
  const ilist = [];
24272
- const interfaces = os$13.networkInterfaces();
24273
+ const interfaces = os$14.networkInterfaces();
24273
24274
  for (let iface in interfaces) for (let i in interfaces[iface]) {
24274
24275
  const f = interfaces[iface][i];
24275
24276
  if (f.internal) ilist.push({
@@ -24299,7 +24300,7 @@ var require_commons = /* @__PURE__ */ __commonJSMin(((exports, module) => {
24299
24300
  this.set(METRIC.OS_DATETIME_ISO, d.toISOString());
24300
24301
  this.set(METRIC.OS_DATETIME_UTC, d.toUTCString());
24301
24302
  this.set(METRIC.OS_DATETIME_TZ_OFFSET, d.getTimezoneOffset());
24302
- const load = os$13.loadavg();
24303
+ const load = os$14.loadavg();
24303
24304
  this.set(METRIC.OS_CPU_LOAD_1, load[0]);
24304
24305
  this.set(METRIC.OS_CPU_LOAD_5, load[1]);
24305
24306
  this.set(METRIC.OS_CPU_LOAD_15, load[2]);
@@ -24307,7 +24308,7 @@ var require_commons = /* @__PURE__ */ __commonJSMin(((exports, module) => {
24307
24308
  return this.broker.Promise.resolve().then(() => cpuUsage().then((res) => {
24308
24309
  this.set(METRIC.OS_CPU_UTILIZATION, res.avg);
24309
24310
  try {
24310
- const cpus = os$13.cpus();
24311
+ const cpus = os$14.cpus();
24311
24312
  this.set(METRIC.OS_CPU_TOTAL, cpus.length);
24312
24313
  this.set(METRIC.OS_CPU_USER, cpus.reduce((a, b) => a + b.times.user, 0));
24313
24314
  this.set(METRIC.OS_CPU_SYSTEM, cpus.reduce((a, b) => a + b.times.sys, 0));
@@ -24329,7 +24330,7 @@ var require_commons = /* @__PURE__ */ __commonJSMin(((exports, module) => {
24329
24330
  */
24330
24331
  function getUserInfo() {
24331
24332
  try {
24332
- return os$13.userInfo();
24333
+ return os$14.userInfo();
24333
24334
  } catch {
24334
24335
  /* istanbul ignore next */
24335
24336
  return {};
@@ -34551,7 +34552,7 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
34551
34552
  //#region ../../node_modules/moleculer/src/registry/node-catalog.js
34552
34553
  var require_node_catalog = /* @__PURE__ */ __commonJSMin(((exports, module) => {
34553
34554
  var _ = require_lodash();
34554
- var os$12 = __require("os");
34555
+ var os$13 = __require("os");
34555
34556
  var Node = require_node();
34556
34557
  var { getIpList } = require_utils$3();
34557
34558
  /**
@@ -34597,7 +34598,7 @@ var require_node_catalog = /* @__PURE__ */ __commonJSMin(((exports, module) => {
34597
34598
  node.local = true;
34598
34599
  node.ipList = getIpList();
34599
34600
  node.instanceID = this.broker.instanceID;
34600
- node.hostname = os$12.hostname();
34601
+ node.hostname = os$13.hostname();
34601
34602
  node.client = {
34602
34603
  type: "nodejs",
34603
34604
  version: this.broker.MOLECULER_VERSION,
@@ -36671,7 +36672,7 @@ var require_console$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
36671
36672
  var require_datadog$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
36672
36673
  var BaseLogger = require_base$4();
36673
36674
  var _ = require_lodash();
36674
- var os$11 = __require("os");
36675
+ var os$12 = __require("os");
36675
36676
  var { MoleculerError } = require_errors$2();
36676
36677
  var util$5 = __require("util");
36677
36678
  var { isObject } = require_utils$3();
@@ -36704,7 +36705,7 @@ var require_datadog$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
36704
36705
  apiKey: process.env.DATADOG_API_KEY,
36705
36706
  ddSource: "moleculer",
36706
36707
  env: void 0,
36707
- hostname: os$11.hostname(),
36708
+ hostname: os$12.hostname(),
36708
36709
  objectPrinter: null,
36709
36710
  interval: 10 * 1e3
36710
36711
  });
@@ -36900,7 +36901,7 @@ var require_file$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
36900
36901
  var _ = require_lodash();
36901
36902
  var fs$14 = __require("fs/promises");
36902
36903
  var path$36 = __require("path");
36903
- var os$10 = __require("os");
36904
+ var os$11 = __require("os");
36904
36905
  var { makeDirs } = require_utils$3();
36905
36906
  /**
36906
36907
  * Import types
@@ -36929,7 +36930,7 @@ var require_file$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
36929
36930
  this.opts = _.defaultsDeep(this.opts, {
36930
36931
  folder: "./logs",
36931
36932
  filename: "moleculer-{date}.log",
36932
- eol: os$10.EOL,
36933
+ eol: os$11.EOL,
36933
36934
  interval: 1 * 1e3
36934
36935
  });
36935
36936
  this.opts.colors = false;
@@ -37349,7 +37350,7 @@ var require_lib$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
37349
37350
  //#region ../../node_modules/log4js/lib/layouts.js
37350
37351
  var require_layouts = /* @__PURE__ */ __commonJSMin(((exports, module) => {
37351
37352
  var dateFormat = require_lib$5();
37352
- var os$9 = __require("os");
37353
+ var os$10 = __require("os");
37353
37354
  var util$3 = __require("util");
37354
37355
  var path$35 = __require("path");
37355
37356
  var styles = {
@@ -37475,13 +37476,13 @@ var require_layouts = /* @__PURE__ */ __commonJSMin(((exports, module) => {
37475
37476
  return dateFormat.asString(format, loggingEvent.startTime);
37476
37477
  }
37477
37478
  function hostname() {
37478
- return os$9.hostname().toString();
37479
+ return os$10.hostname().toString();
37479
37480
  }
37480
37481
  function formatMessage(loggingEvent) {
37481
37482
  return util$3.format(...loggingEvent.data);
37482
37483
  }
37483
37484
  function endOfLine() {
37484
- return os$9.EOL;
37485
+ return os$10.EOL;
37485
37486
  }
37486
37487
  function logLevel(loggingEvent) {
37487
37488
  return loggingEvent.level.toString();
@@ -39080,11 +39081,11 @@ var require_mkdirs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39080
39081
  //#region ../../node_modules/streamroller/node_modules/fs-extra/lib/util/utimes.js
39081
39082
  var require_utimes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39082
39083
  var fs = require_graceful_fs();
39083
- var os$8 = __require("os");
39084
+ var os$9 = __require("os");
39084
39085
  var path$31 = __require("path");
39085
39086
  function hasMillisResSync() {
39086
39087
  let tmpfile = path$31.join("millis-test-sync" + Date.now().toString() + Math.random().toString().slice(2));
39087
- tmpfile = path$31.join(os$8.tmpdir(), tmpfile);
39088
+ tmpfile = path$31.join(os$9.tmpdir(), tmpfile);
39088
39089
  const d = /* @__PURE__ */ new Date(1435410243862);
39089
39090
  fs.writeFileSync(tmpfile, "https://github.com/jprichardson/node-fs-extra/pull/141");
39090
39091
  const fd = fs.openSync(tmpfile, "r+");
@@ -39094,7 +39095,7 @@ var require_utimes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39094
39095
  }
39095
39096
  function hasMillisRes(callback) {
39096
39097
  let tmpfile = path$31.join("millis-test" + Date.now().toString() + Math.random().toString().slice(2));
39097
- tmpfile = path$31.join(os$8.tmpdir(), tmpfile);
39098
+ tmpfile = path$31.join(os$9.tmpdir(), tmpfile);
39098
39099
  const d = /* @__PURE__ */ new Date(1435410243862);
39099
39100
  fs.writeFile(tmpfile, "https://github.com/jprichardson/node-fs-extra/pull/141", (err) => {
39100
39101
  if (err) return callback(err);
@@ -45396,7 +45397,7 @@ var require_multistream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
45396
45397
  //#endregion
45397
45398
  //#region ../../node_modules/pino/pino.js
45398
45399
  var require_pino$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
45399
- var os$7 = __require("node:os");
45400
+ var os$8 = __require("node:os");
45400
45401
  var stdSerializers = require_pino_std_serializers();
45401
45402
  var caller = require_caller();
45402
45403
  var redaction = require_redaction();
@@ -45411,7 +45412,7 @@ var require_pino$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
45411
45412
  var { chindingsSym, redactFmtSym, serializersSym, timeSym, timeSliceIndexSym, streamSym, stringifySym, stringifySafeSym, stringifiersSym, setLevelSym, endSym, formatOptsSym, messageKeySym, errorKeySym, nestedKeySym, mixinSym, levelCompSym, useOnlyCustomLevelsSym, formattersSym, hooksSym, nestedKeyStrSym, mixinMergeStrategySym, msgPrefixSym } = symbols;
45412
45413
  var { epochTime, nullTime } = time;
45413
45414
  var { pid } = process;
45414
- var hostname = os$7.hostname();
45415
+ var hostname = os$8.hostname();
45415
45416
  var defaultErrorSerializer = stdSerializers.err;
45416
45417
  var normalize = createArgsNormalizer({
45417
45418
  level: "info",
@@ -71516,7 +71517,7 @@ var require_ipaddr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
71516
71517
  //#region ../../node_modules/moleculer/src/transporters/tcp/udp-broadcaster.js
71517
71518
  var require_udp_broadcaster = /* @__PURE__ */ __commonJSMin(((exports, module) => {
71518
71519
  var EventEmitter$3 = __require("events");
71519
- var os$6 = __require("os");
71520
+ var os$7 = __require("os");
71520
71521
  var dgram = __require("dgram");
71521
71522
  var ipaddr = require_ipaddr();
71522
71523
  var { randomInt } = require_utils$3();
@@ -71727,7 +71728,7 @@ var require_udp_broadcaster = /* @__PURE__ */ __commonJSMin(((exports, module) =
71727
71728
  */
71728
71729
  getBroadcastAddresses() {
71729
71730
  const list = [];
71730
- const interfaces = os$6.networkInterfaces();
71731
+ const interfaces = os$7.networkInterfaces();
71731
71732
  for (let iface in interfaces) for (let i in interfaces[iface]) {
71732
71733
  const f = interfaces[iface][i];
71733
71734
  if (f.family === "IPv4") list.push(ipaddr.IPv4.broadcastAddressFromCIDR(f.cidr).toString());
@@ -71742,7 +71743,7 @@ var require_udp_broadcaster = /* @__PURE__ */ __commonJSMin(((exports, module) =
71742
71743
  */
71743
71744
  getInterfaceAddresses() {
71744
71745
  const list = [];
71745
- const interfaces = os$6.networkInterfaces();
71746
+ const interfaces = os$7.networkInterfaces();
71746
71747
  for (let iface in interfaces) for (let i in interfaces[iface]) {
71747
71748
  const f = interfaces[iface][i];
71748
71749
  if (f.family === "IPv4") list.push(f.address);
@@ -73025,7 +73026,7 @@ var init_package = __esmMin((() => {
73025
73026
  //#endregion
73026
73027
  //#region ../../node_modules/moleculer/src/health.js
73027
73028
  var require_health = /* @__PURE__ */ __commonJSMin(((exports, module) => {
73028
- var os$5 = __require("os");
73029
+ var os$6 = __require("os");
73029
73030
  var { getIpList } = require_utils$3();
73030
73031
  var MOLECULER_VERSION = (init_package(), __toCommonJS(package_exports).default).version;
73031
73032
  /**
@@ -73041,9 +73042,9 @@ var require_health = /* @__PURE__ */ __commonJSMin(((exports, module) => {
73041
73042
  };
73042
73043
  };
73043
73044
  var getCpuInfo = () => {
73044
- const cpus = os$5.cpus();
73045
- const load = os$5.loadavg();
73046
- const cores = Array.isArray(cpus) ? os$5.cpus().length : null;
73045
+ const cpus = os$6.cpus();
73046
+ const load = os$6.loadavg();
73047
+ const cores = Array.isArray(cpus) ? os$6.cpus().length : null;
73047
73048
  return {
73048
73049
  load1: load[0],
73049
73050
  load5: load[1],
@@ -73054,8 +73055,8 @@ var require_health = /* @__PURE__ */ __commonJSMin(((exports, module) => {
73054
73055
  };
73055
73056
  var getMemoryInfo = () => {
73056
73057
  const mem = {
73057
- free: os$5.freemem(),
73058
- total: os$5.totalmem(),
73058
+ free: os$6.freemem(),
73059
+ total: os$6.totalmem(),
73059
73060
  percent: null
73060
73061
  };
73061
73062
  mem.percent = mem.free * 100 / mem.total;
@@ -73067,19 +73068,19 @@ var require_health = /* @__PURE__ */ __commonJSMin(((exports, module) => {
73067
73068
  */
73068
73069
  var getUserInfo = () => {
73069
73070
  try {
73070
- return os$5.userInfo();
73071
+ return os$6.userInfo();
73071
73072
  } catch {
73072
73073
  return {};
73073
73074
  }
73074
73075
  };
73075
73076
  var getOsInfo = () => {
73076
73077
  return {
73077
- uptime: os$5.uptime(),
73078
- type: os$5.type(),
73079
- release: os$5.release(),
73080
- hostname: os$5.hostname(),
73081
- arch: os$5.arch(),
73082
- platform: os$5.platform(),
73078
+ uptime: os$6.uptime(),
73079
+ type: os$6.type(),
73080
+ release: os$6.release(),
73081
+ hostname: os$6.hostname(),
73082
+ arch: os$6.arch(),
73083
+ platform: os$6.platform(),
73083
73084
  user: getUserInfo()
73084
73085
  };
73085
73086
  };
@@ -74772,11 +74773,11 @@ var require_ttl = /* @__PURE__ */ __commonJSMin(((exports, module) => {
74772
74773
  //#endregion
74773
74774
  //#region ../../node_modules/recursive-watch/index.js
74774
74775
  var require_recursive_watch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
74775
- var os$4 = __require("os");
74776
+ var os$5 = __require("os");
74776
74777
  var fs$7 = __require("fs");
74777
74778
  var path$10 = __require("path");
74778
74779
  var Cache = require_ttl();
74779
- var watchDirectory = os$4.platform() === "linux" ? watchFallback : watchRecursive;
74780
+ var watchDirectory = os$5.platform() === "linux" ? watchFallback : watchRecursive;
74780
74781
  module.exports = watch;
74781
74782
  function watch(name, onchange) {
74782
74783
  var clear = null;
@@ -81752,7 +81753,7 @@ var require_has_flag = /* @__PURE__ */ __commonJSMin(((exports, module) => {
81752
81753
  //#endregion
81753
81754
  //#region ../../node_modules/args/node_modules/supports-color/index.js
81754
81755
  var require_supports_color = /* @__PURE__ */ __commonJSMin(((exports, module) => {
81755
- var os$3 = __require("os");
81756
+ var os$4 = __require("os");
81756
81757
  var hasFlag = require_has_flag();
81757
81758
  var env = process.env;
81758
81759
  var forceColor;
@@ -81775,7 +81776,7 @@ var require_supports_color = /* @__PURE__ */ __commonJSMin(((exports, module) =>
81775
81776
  if (stream && !stream.isTTY && forceColor !== true) return 0;
81776
81777
  const min = forceColor ? 1 : 0;
81777
81778
  if (process.platform === "win32") {
81778
- const osRelease = os$3.release().split(".");
81779
+ const osRelease = os$4.release().split(".");
81779
81780
  if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
81780
81781
  return 1;
81781
81782
  }
@@ -82665,7 +82666,7 @@ var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
82665
82666
  var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => {
82666
82667
  var fs$2 = __require("fs");
82667
82668
  var path$2 = __require("path");
82668
- var os$2 = __require("os");
82669
+ var os$3 = __require("os");
82669
82670
  var crypto = __require("crypto");
82670
82671
  var TIPS = [
82671
82672
  "◈ encrypted .env [www.dotenvx.com]",
@@ -82798,7 +82799,7 @@ var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => {
82798
82799
  return null;
82799
82800
  }
82800
82801
  function _resolveHome(envPath) {
82801
- return envPath[0] === "~" ? path$2.join(os$2.homedir(), envPath.slice(1)) : envPath;
82802
+ return envPath[0] === "~" ? path$2.join(os$3.homedir(), envPath.slice(1)) : envPath;
82802
82803
  }
82803
82804
  function _configVault(options) {
82804
82805
  const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
@@ -82946,7 +82947,7 @@ var require_runner = /* @__PURE__ */ __commonJSMin(((exports, module) => {
82946
82947
  var inspect = __require("util").inspect;
82947
82948
  var _ = require_lodash();
82948
82949
  var Args = require_lib();
82949
- var os$1 = __require("os");
82950
+ var os$2 = __require("os");
82950
82951
  /** @type {Cluster} */
82951
82952
  var cluster = __require("cluster");
82952
82953
  var kleur = require_kleur();
@@ -83252,7 +83253,7 @@ var require_runner = /* @__PURE__ */ __commonJSMin(((exports, module) => {
83252
83253
  logger.info(`Worker #${worker.id} restarted`);
83253
83254
  } else process.exit(code);
83254
83255
  });
83255
- const workerCount = Number.isInteger(instances) && instances > 0 ? instances : os$1.cpus().length;
83256
+ const workerCount = Number.isInteger(instances) && instances > 0 ? instances : os$2.cpus().length;
83256
83257
  logger.info(`Starting ${workerCount} workers...`);
83257
83258
  for (let i = 0; i < workerCount; i++) cluster.fork();
83258
83259
  stopSignals.forEach(function(signal) {
@@ -83390,7 +83391,7 @@ var Gt = (n, t, e) => {
83390
83391
  }
83391
83392
  return h;
83392
83393
  };
83393
- var fe = "\0SLASH" + Math.random() + "\0", ue = "\0OPEN" + Math.random() + "\0", qt = "\0CLOSE" + Math.random() + "\0", de = "\0COMMA" + Math.random() + "\0", pe = "\0PERIOD" + Math.random() + "\0", is = new RegExp(fe, "g"), rs = new RegExp(ue, "g"), ns = new RegExp(qt, "g"), os = new RegExp(de, "g"), hs = new RegExp(pe, "g"), as = /\\\\/g, ls = /\\{/g, cs = /\\}/g, fs = /\\,/g, us = /\\./g, ds = 1e5;
83394
+ var fe = "\0SLASH" + Math.random() + "\0", ue = "\0OPEN" + Math.random() + "\0", qt = "\0CLOSE" + Math.random() + "\0", de = "\0COMMA" + Math.random() + "\0", pe = "\0PERIOD" + Math.random() + "\0", is = new RegExp(fe, "g"), rs = new RegExp(ue, "g"), ns = new RegExp(qt, "g"), os$1 = new RegExp(de, "g"), hs = new RegExp(pe, "g"), as = /\\\\/g, ls = /\\{/g, cs = /\\}/g, fs = /\\,/g, us = /\\./g, ds = 1e5;
83394
83395
  function Ht(n) {
83395
83396
  return isNaN(n) ? n.charCodeAt(0) : parseInt(n, 10);
83396
83397
  }
@@ -83398,7 +83399,7 @@ function ps(n) {
83398
83399
  return n.replace(as, fe).replace(ls, ue).replace(cs, qt).replace(fs, de).replace(us, pe);
83399
83400
  }
83400
83401
  function ms(n) {
83401
- return n.replace(is, "\\").replace(rs, "{").replace(ns, "}").replace(os, ",").replace(hs, ".");
83402
+ return n.replace(is, "\\").replace(rs, "{").replace(ns, "}").replace(os$1, ",").replace(hs, ".");
83402
83403
  }
83403
83404
  function me(n) {
83404
83405
  if (!n) return [""];
@@ -88345,7 +88346,8 @@ var MESH_REAP_MS = 24 * 36e5;
88345
88346
  * state of their own (the session token lifetime).
88346
88347
  *
88347
88348
  * Sections exposed — this list is the whole of it:
88348
- * - server (port, host, dataPath — READ-ONLY, loaded from config.yaml at bootstrap)
88349
+ * - server (port, host, dataPath — READ-ONLY, loaded from config.yaml at bootstrap;
88350
+ * name = the hub's human name, `server.name`, editable — D861)
88349
88351
  * - auth (tokenExpiry = session lifetime, accessTokenExpiry, trustedProxies,
88350
88352
  * trustedNetworks)
88351
88353
  * - cluster (no operator field remains: the cluster secret and the mesh auth
@@ -88384,12 +88386,15 @@ var SECTION_TITLES = {
88384
88386
  };
88385
88387
  /** The keychain owner of the hub's own secrets (D797). */
88386
88388
  var SYSTEM_SECRET_OWNER = "system";
88389
+ /** The form key (and the `server` section key) of the hub's human name (D861). */
88390
+ var SERVER_NAME_FIELD = "name";
88387
88391
  /** Keys that map 1:1 to a given yml section — used by `updateGlobalSettings`
88388
88392
  * to figure out which section owns each key in the incoming patch. */
88389
88393
  var KEY_TO_SECTION = {
88390
88394
  port: "server",
88391
88395
  host: "server",
88392
88396
  dataPath: "server",
88397
+ [SERVER_NAME_FIELD]: "server",
88393
88398
  tokenExpiry: "auth",
88394
88399
  accessTokenExpiry: "auth",
88395
88400
  trustedProxies: "auth",
@@ -88580,35 +88585,51 @@ var SystemConfigAddon = class extends BaseAddon {
88580
88585
  {
88581
88586
  id: "system-config-server",
88582
88587
  title: SECTION_TITLES["server"],
88583
- description: "Core server connection settings — read-only, loaded from config.yaml at bootstrap.",
88588
+ description: "The name of this server, and its connection settings (read-only, loaded from config.yaml at bootstrap).",
88589
+ descriptionKey: "server:global.s_system-config-server.description",
88584
88590
  columns: 2,
88585
88591
  fields: [
88592
+ {
88593
+ type: "text",
88594
+ key: SERVER_NAME_FIELD,
88595
+ label: "Server name",
88596
+ description: `Shown in the admin UI and on the apps' sign-in screen (1 to 48 characters). Leave empty to use this machine's hostname.`,
88597
+ placeholder: hostnameWithoutDomain(),
88598
+ span: 2
88599
+ },
88586
88600
  {
88587
88601
  type: "info",
88588
88602
  key: "server-restart-note",
88589
88603
  label: "Restart required",
88590
- content: "Server settings are read-only. Change them in config.yaml and restart.",
88604
+ labelKey: "server:global.s_system-config-server.server-restart-note.label",
88605
+ content: "Port, host and data path are read-only. Change them in config.yaml and restart.",
88591
88606
  variant: "warning"
88592
88607
  },
88593
88608
  {
88594
88609
  type: "text",
88595
88610
  key: "port",
88596
88611
  label: "Port",
88612
+ labelKey: "server:global.s_system-config-server.port.label",
88597
88613
  description: "Listening port",
88614
+ descriptionKey: "server:global.s_system-config-server.port.description",
88598
88615
  disabled: true
88599
88616
  },
88600
88617
  {
88601
88618
  type: "text",
88602
88619
  key: "host",
88603
88620
  label: "Host",
88621
+ labelKey: "server:global.s_system-config-server.host.label",
88604
88622
  description: "Bind address",
88623
+ descriptionKey: "server:global.s_system-config-server.host.description",
88605
88624
  disabled: true
88606
88625
  },
88607
88626
  {
88608
88627
  type: "text",
88609
88628
  key: "dataPath",
88610
88629
  label: "Data Path",
88630
+ labelKey: "server:global.s_system-config-server.dataPath.label",
88611
88631
  description: "Root data directory",
88632
+ descriptionKey: "server:global.s_system-config-server.dataPath.description",
88612
88633
  disabled: true,
88613
88634
  span: 2
88614
88635
  }
@@ -88618,13 +88639,16 @@ var SystemConfigAddon = class extends BaseAddon {
88618
88639
  id: "system-config-auth",
88619
88640
  title: SECTION_TITLES["auth"],
88620
88641
  description: "Token and session settings.",
88642
+ descriptionKey: "server:global.s_system-config-auth.description",
88621
88643
  columns: 1,
88622
88644
  fields: [
88623
88645
  {
88624
88646
  type: "text",
88625
88647
  key: "tokenExpiry",
88626
88648
  label: "Session lifetime",
88649
+ labelKey: "server:global.s_system-config-auth.tokenExpiry.label",
88627
88650
  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.",
88651
+ descriptionKey: "server:global.s_system-config-auth.tokenExpiry.description",
88628
88652
  placeholder: "30d",
88629
88653
  default: "30d"
88630
88654
  },
@@ -88632,7 +88656,9 @@ var SystemConfigAddon = class extends BaseAddon {
88632
88656
  type: "text",
88633
88657
  key: "accessTokenExpiry",
88634
88658
  label: "Access token lifetime",
88659
+ labelKey: "server:global.s_system-config-auth.accessTokenExpiry.label",
88635
88660
  description: "How long one access token lives before the app silently swaps it for a new one (e.g. 2h; between 5m and 24h, never longer than the session). Shorter limits how long a copied token is useful. Apps that predate refresh tokens get one token for the whole session instead.",
88661
+ descriptionKey: "server:global.s_system-config-auth.accessTokenExpiry.description",
88636
88662
  placeholder: "2h",
88637
88663
  default: "2h"
88638
88664
  },
@@ -88640,13 +88666,16 @@ var SystemConfigAddon = class extends BaseAddon {
88640
88666
  type: "tags",
88641
88667
  key: "trustedProxies",
88642
88668
  label: "Trusted reverse proxies",
88669
+ labelKey: "server:global.s_system-config-auth.trustedProxies.label",
88643
88670
  description: "Addresses or CIDR ranges (e.g. 192.168.1.2 or 10.0.0.0/24) of reverse proxies in front of the hub. Only a request whose direct sender is one of these — or this host itself, as with the Cloudflare tunnel — has its X-Forwarded-For / CF-Connecting-IP read as the real client address for rate limits. Leave empty unless a proxy on another host forwards to the hub.",
88671
+ descriptionKey: "server:global.s_system-config-auth.trustedProxies.description",
88644
88672
  creatable: true
88645
88673
  },
88646
88674
  {
88647
88675
  type: "info",
88648
88676
  key: "trustedNetworksWarning",
88649
88677
  label: "Skipping two-factor authentication",
88678
+ labelKey: "server:global.s_system-config-auth.trustedNetworksWarning.label",
88650
88679
  variant: "danger",
88651
88680
  content: "A sign-in made DIRECTLY from a network listed below skips the second factor (TOTP or passkey): anyone on that network who knows or guesses a password gets in with the password alone — including a compromised camera or a guest device. Requests that come through the Cloudflare tunnel, the public address or any reverse proxy never skip it, whatever address they claim. Every skip is recorded in the authentication audit log. Leave empty (the default) to always ask for the second factor."
88652
88681
  },
@@ -88654,7 +88683,9 @@ var SystemConfigAddon = class extends BaseAddon {
88654
88683
  type: "tags",
88655
88684
  key: "trustedNetworks",
88656
88685
  label: "Trusted networks (skip the second factor)",
88686
+ labelKey: "server:global.s_system-config-auth.trustedNetworks.label",
88657
88687
  description: "Addresses or CIDR ranges, e.g. 192.168.1.0/24. Keep it as narrow as you can — a single trusted VLAN, not the whole LAN.",
88688
+ descriptionKey: "server:global.s_system-config-auth.trustedNetworks.description",
88658
88689
  creatable: true
88659
88690
  }
88660
88691
  ]
@@ -88694,6 +88725,25 @@ var SystemConfigAddon = class extends BaseAddon {
88694
88725
  async updateGlobalSettingsAsOperator(patch, _nodeId) {
88695
88726
  await this.updateGlobalSettings(patch);
88696
88727
  }
88728
+ /**
88729
+ * The value to store for a `name` in a save, or `undefined` for "leave the row
88730
+ * alone". The whole form posts every field, so an empty box on a hub that was
88731
+ * never named is the NORMAL case and must write nothing (D861: a seed never
88732
+ * overwrites); an empty box over a stored name is the operator clearing it,
88733
+ * which stores `''` (readers treat it as unset). Anything else must be a valid
88734
+ * name — refused whole, like the network lists.
88735
+ */
88736
+ async normalizeServerName(value) {
88737
+ if (value === void 0 || value === null) return void 0;
88738
+ if (typeof value !== "string") throw new Error("The server name must be text");
88739
+ if (value.trim() === "") {
88740
+ const current = (await this.ctx.settings.getSection("server"))[SERVER_NAME_FIELD];
88741
+ return typeof current === "string" && current !== "" ? "" : void 0;
88742
+ }
88743
+ const parsed = ServerNameSchema.safeParse(value);
88744
+ if (!parsed.success) throw new Error(parsed.error.issues[0]?.message ?? "The server name is not valid");
88745
+ return parsed.data;
88746
+ }
88697
88747
  async updateGlobalSettings(patch) {
88698
88748
  if (!this.ctx.settings) throw new Error("system-config: ctx.settings not available — cannot write sections");
88699
88749
  const perSection = /* @__PURE__ */ new Map();
@@ -88715,6 +88765,14 @@ var SystemConfigAddon = class extends BaseAddon {
88715
88765
  this.ctx.logger.warn("update ignored unknown key (not mapped to any section)", { meta: { key } });
88716
88766
  continue;
88717
88767
  }
88768
+ if (key === SERVER_NAME_FIELD) {
88769
+ const name = await this.normalizeServerName(value);
88770
+ if (name === void 0) continue;
88771
+ const bucket = perSection.get("server") ?? {};
88772
+ bucket[key] = name;
88773
+ perSection.set("server", bucket);
88774
+ continue;
88775
+ }
88718
88776
  if (section === "server") {
88719
88777
  this.ctx.logger.warn("update ignored read-only server-section key", { meta: { key } });
88720
88778
  continue;
@@ -88739,6 +88797,10 @@ var SystemConfigAddon = class extends BaseAddon {
88739
88797
  }
88740
88798
  }
88741
88799
  };
88800
+ /** This machine's hostname without its domain: what an unnamed hub is called. */
88801
+ function hostnameWithoutDomain() {
88802
+ return shortHostname(os.hostname());
88803
+ }
88742
88804
  function parseMintUnlockInput(input) {
88743
88805
  if (input === null || typeof input !== "object") throw new Error("system-config: mintAgentUiUnlockTicket requires { nodeId }");
88744
88806
  const nodeId = Reflect.get(input, "nodeId");