iobroker.eos-admin 9.0.25 → 9.0.26
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/NEXOWATT_EOS_BUILD_INFO.json +3 -3
- package/README.md +6 -4
- package/START_HIER_9.0.26.md +80 -0
- package/adminWww/.vite/manifest.json +39 -39
- package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +107 -107
- package/adminWww/assets/{AdapterUpdateDialog-CLDpmxDx.js → AdapterUpdateDialog-DIjnNZ5k.js} +1 -1
- package/adminWww/assets/{Adapters-BCGeX2v7.js → Adapters-D8UOQg1q.js} +1 -1
- package/adminWww/assets/{ConfigManager-B_sJf5_w.js → ConfigManager-CAvT_4-g.js} +1 -1
- package/adminWww/assets/{Enums-D3n1pOtc.js → Enums-CrNUOX0d.js} +1 -1
- package/adminWww/assets/{Fields-Bdx5gPoT.js → Fields-D-0qFiqr.js} +1 -1
- package/adminWww/assets/{Files-BPK84lYU.js → Files-BL8kvaeC.js} +1 -1
- package/adminWww/assets/{Hosts--Jr6oLf2.js → Hosts-BToJLy61.js} +1 -1
- package/adminWww/assets/{Instances-DxTOzFus.js → Instances-Dlrp1KGP.js} +1 -1
- package/adminWww/assets/{Intro-CYBGeZtu.js → Intro-5EbxvP4X.js} +1 -1
- package/adminWww/assets/{Logs-CVNC-4S8.js → Logs-xdFVJ6fZ.js} +1 -1
- package/adminWww/assets/{Objects-Cqm9Rvym.js → Objects-DhyJ5eAY.js} +1 -1
- package/adminWww/assets/{Overview-JgjcHwlz.js → Overview-BspgcFB7.js} +1 -1
- package/adminWww/assets/{State-BV14HSwZ.js → State-CJ1mKH_U.js} +1 -1
- package/adminWww/assets/{UsedResources-Dz48WzEF.js → UsedResources-BMiCxqWH.js} +1 -1
- package/adminWww/assets/{Users-D19YlRCD.js → Users-DrlJHRa5.js} +1 -1
- package/adminWww/assets/{bootstrap-a7POLSDr.js → bootstrap-BU7j1Fe_.js} +3 -3
- package/adminWww/assets/{hostInit-keGjwsZR.js → hostInit-Cgee6juw.js} +1 -1
- package/adminWww/assets/{icons-material-Omb_HCfb.js → icons-material-C0U9EKON.js} +1 -1
- package/adminWww/assets/{index-DqPrQK7T.js → index-BUZf1ftI.js} +2 -2
- package/adminWww/assets/{installSVGRenderer-iWfLFoQU.js → installSVGRenderer-CcjgaxiA.js} +1 -1
- package/adminWww/assets/{mf-entry-bootstrap-0-2a856bb6.js → mf-entry-bootstrap-0-96d40e57.js} +2 -2
- package/adminWww/index.html +23 -23
- package/adminWww/mf-manifest.json +1 -1
- package/adminWww/mf-stats.json +1 -1
- package/adminWww/remoteEntry-eos-9.0.26.js +12 -0
- package/adminWww/remoteEntry.js +1 -1
- package/build/lib/eosKiosk.js +11 -1
- package/build/lib/eosKiosk.js.map +1 -1
- package/build/lib/eosModuleHost.js +134 -38
- package/build/lib/eosModuleHost.js.map +1 -1
- package/build/lib/eosModuleHttp.js +9 -3
- package/build/lib/eosModuleHttp.js.map +1 -1
- package/build/lib/eosModuleLoad.js +83 -0
- package/build/lib/eosModuleLoad.js.map +1 -0
- package/build/lib/eosModuleProcess.js +16 -1
- package/build/lib/eosModuleProcess.js.map +1 -1
- package/build/lib/eosModuleProcessProtocol.js +13 -1
- package/build/lib/eosModuleProcessProtocol.js.map +1 -1
- package/build/lib/eosModuleProcessWorker.js +50 -23
- package/build/lib/eosModuleProcessWorker.js.map +1 -1
- package/build/lib/eosRuntimeControl.js +17 -6
- package/build/lib/eosRuntimeControl.js.map +1 -1
- package/build/lib/eosTlsHttp.js +84 -0
- package/build/lib/eosTlsHttp.js.map +1 -1
- package/build/lib/eosUiProcessWorker.js +1 -0
- package/build/lib/eosUiProcessWorker.js.map +1 -1
- package/build/lib/web.js +18 -1
- package/build/lib/web.js.map +1 -1
- package/docs/reports/unified-9.0.26/ACTIVATION.md +50 -0
- package/docs/reports/unified-9.0.26/BACKUP_READINESS_REVIEW.md +30 -0
- package/docs/reports/unified-9.0.26/BACKUP_UI.md +69 -0
- package/docs/reports/unified-9.0.26/CHARGING_CLIENT_REVIEW.md +24 -0
- package/docs/reports/unified-9.0.26/EVCS_DELETE_UI_REVIEW.md +120 -0
- package/docs/reports/unified-9.0.26/EVCS_IDENTITY_REVIEW.md +47 -0
- package/docs/reports/unified-9.0.26/INDEPENDENT_REVIEW.md +114 -0
- package/docs/reports/unified-9.0.26/LIFECYCLE_REVIEW.md +47 -0
- package/docs/reports/unified-9.0.26/OCPP_DELETION_REVIEW.md +49 -0
- package/docs/reports/unified-9.0.26/PIPELINE_OFFLINE_ASSERTION_REVIEW.md +71 -0
- package/docs/reports/unified-9.0.26/PRUEFBERICHT.md +71 -0
- package/docs/reports/unified-9.0.26/PWA_TLS.md +43 -0
- package/docs/reports/unified-9.0.26/TARIFF_STARTUP.md +42 -0
- package/docs/reports/unified-9.0.26/installed-package/README.md +105 -0
- package/docs/reports/unified-9.0.26/installed-package/baseline925-git-export.json +31 -0
- package/docs/reports/unified-9.0.26/installed-package/baseline925-node22-install.log +15 -0
- package/docs/reports/unified-9.0.26/installed-package/baseline925-node22-lifecycle.log +17 -0
- package/docs/reports/unified-9.0.26/installed-package/baseline925-node22.log +26 -0
- package/docs/reports/unified-9.0.26/installed-package/baseline925-node24-lifecycle.log +17 -0
- package/docs/reports/unified-9.0.26/installed-package/baseline925-node24.log +10 -0
- package/docs/reports/unified-9.0.26/installed-package/diagnostic-node22.log +26 -0
- package/docs/reports/unified-9.0.26/installed-package/diagnostic-node24.log +10 -0
- package/docs/reports/unified-9.0.26/installed-package/registry925-comparison.json +18 -0
- package/docs/reports/unified-9.0.26/raw/INDEX.json +43 -0
- package/docs/reports/unified-9.0.26/raw/activation/INTERNAL_VISUAL_CHECKS.md +1 -0
- package/docs/reports/unified-9.0.26/raw/activation/eslint.log +0 -0
- package/docs/reports/unified-9.0.26/raw/activation/node22-browser.json +74 -0
- package/docs/reports/unified-9.0.26/raw/activation/node22-browser.stderr.log +2 -0
- package/docs/reports/unified-9.0.26/raw/activation/node22-real-processes.log +40 -0
- package/docs/reports/unified-9.0.26/raw/activation/node22-unit-http.log +196 -0
- package/docs/reports/unified-9.0.26/raw/activation/node24-browser.json +74 -0
- package/docs/reports/unified-9.0.26/raw/activation/node24-browser.stderr.log +0 -0
- package/docs/reports/unified-9.0.26/raw/activation/node24-module-http.log +18 -0
- package/docs/reports/unified-9.0.26/raw/activation/node24-tests.log +43 -0
- package/docs/reports/unified-9.0.26/raw/activation/typecheck.log +0 -0
- package/docs/reports/unified-9.0.26/raw/activation/verification.json +38 -0
- package/docs/reports/unified-9.0.26/raw/backup-ui/field-map.json +497 -0
- package/docs/reports/unified-9.0.26/raw/backup-ui/node22-browser.json +67 -0
- package/docs/reports/unified-9.0.26/raw/backup-ui/node22-browser.stderr.log +2 -0
- package/docs/reports/unified-9.0.26/raw/backup-ui/node24-browser.json +67 -0
- package/docs/reports/unified-9.0.26/raw/backup-ui/node24-browser.stderr.log +0 -0
- package/docs/reports/unified-9.0.26/raw/backup-ui/verification.json +32 -0
- package/docs/reports/unified-9.0.26/raw/build-and-static/FINAL_CHECKS.json +45 -0
- package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-build-backend-before-ems-tariff.log +5 -0
- package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-build-backend-delivery.log +5 -0
- package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-build-frontend.log +152 -0
- package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-build-installer.log +26 -0
- package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-build-modules.log +5 -0
- package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-build-ui-runtime-delivery.log +7 -0
- package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-build-ui-runtime.log +7 -0
- package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-lint-complete.log +45 -0
- package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-lint-delivery.log +45 -0
- package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-production-audit.json +77 -0
- package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-production-audit.stderr +1 -0
- package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-registry-check.json +7 -0
- package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-registry-check.stderr +9 -0
- package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-sbom-vendored.log +1 -0
- package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-typecheck-complete.log +5 -0
- package/docs/reports/unified-9.0.26/raw/build-and-static/eos926-typecheck-delivery.log +5 -0
- package/docs/reports/unified-9.0.26/raw/charging-control-client-review-hashes.json +10 -0
- package/docs/reports/unified-9.0.26/raw/charging-control-client-review-node22.log +86 -0
- package/docs/reports/unified-9.0.26/raw/charging-control-client-review-node24.log +20 -0
- package/docs/reports/unified-9.0.26/raw/charging-identity/node22.log +130 -0
- package/docs/reports/unified-9.0.26/raw/charging-identity/node24.log +27 -0
- package/docs/reports/unified-9.0.26/raw/charging-identity-review/PRODUCT_REVIEW.md +45 -0
- package/docs/reports/unified-9.0.26/raw/charging-identity-review/independent-probes.json +18 -0
- package/docs/reports/unified-9.0.26/raw/charging-identity-review/independent-probes.stderr +0 -0
- package/docs/reports/unified-9.0.26/raw/charging-identity-review/node24-tests.log +38 -0
- package/docs/reports/unified-9.0.26/raw/charging-identity-review/registry-ipc.json +24 -0
- package/docs/reports/unified-9.0.26/raw/charging-identity-review/review-probes.cjs +81 -0
- package/docs/reports/unified-9.0.26/raw/deletion-station-kiosk-node22.log +188 -0
- package/docs/reports/unified-9.0.26/raw/deletion-station-kiosk-node24.log +36 -0
- package/docs/reports/unified-9.0.26/raw/evcs-control-fence-node22.log +148 -0
- package/docs/reports/unified-9.0.26/raw/evcs-control-fence-node24.log +30 -0
- package/docs/reports/unified-9.0.26/raw/evcs-delete/browser-lint.log +0 -0
- package/docs/reports/unified-9.0.26/raw/evcs-delete/node22-browser.json +28 -0
- package/docs/reports/unified-9.0.26/raw/evcs-delete/node22-browser.log +3 -0
- package/docs/reports/unified-9.0.26/raw/evcs-delete/node22-client-handshake.log +112 -0
- package/docs/reports/unified-9.0.26/raw/evcs-delete/node22-pipeline-corrected.log +94 -0
- package/docs/reports/unified-9.0.26/raw/evcs-delete/node22-pipeline-diagnostic.log +27 -0
- package/docs/reports/unified-9.0.26/raw/evcs-delete/node22-pipeline-repro.log +94 -0
- package/docs/reports/unified-9.0.26/raw/evcs-delete/node22-pipeline-tick-probe.log +36 -0
- package/docs/reports/unified-9.0.26/raw/evcs-delete/node24-browser.json +28 -0
- package/docs/reports/unified-9.0.26/raw/evcs-delete/node24-browser.log +1 -0
- package/docs/reports/unified-9.0.26/raw/evcs-delete/node24-client-handshake.log +24 -0
- package/docs/reports/unified-9.0.26/raw/evcs-delete/node24-pipeline-corrected.log +23 -0
- package/docs/reports/unified-9.0.26/raw/evcs-delete/node24-pipeline-repro.log +23 -0
- package/docs/reports/unified-9.0.26/raw/evcs-delete/node24-pipeline-tick-probe.log +28 -0
- package/docs/reports/unified-9.0.26/raw/evcs-delete/pipeline-corrected-snapshot.json +23 -0
- package/docs/reports/unified-9.0.26/raw/evcs-delete/pipeline-lint.log +6 -0
- package/docs/reports/unified-9.0.26/raw/final-source-snapshot.json +16 -0
- package/docs/reports/unified-9.0.26/raw/git-vendor-source/node22.log +28 -0
- package/docs/reports/unified-9.0.26/raw/git-vendor-source/node24.log +10 -0
- package/docs/reports/unified-9.0.26/raw/git-vendor-source/verification.json +29 -0
- package/docs/reports/unified-9.0.26/raw/independent-review/GIT_ADDENDUM.json +20 -0
- package/docs/reports/unified-9.0.26/raw/independent-review/INDEX.json +76 -0
- package/docs/reports/unified-9.0.26/raw/independent-review/baseline925-artifacts-independent.json +16 -0
- package/docs/reports/unified-9.0.26/raw/independent-review/git-runtime-complete-node22.log +22 -0
- package/docs/reports/unified-9.0.26/raw/independent-review/git-runtime-complete-node24.log +9 -0
- package/docs/reports/unified-9.0.26/raw/independent-review/git-runtime-node24.log +9 -0
- package/docs/reports/unified-9.0.26/raw/independent-review/git-transport-independent.json +33 -0
- package/docs/reports/unified-9.0.26/raw/independent-review/npm-dry-run-file-inventory.json +16271 -0
- package/docs/reports/unified-9.0.26/raw/independent-review/npm-git-complete-inventory.json +40 -0
- package/docs/reports/unified-9.0.26/raw/independent-review/public-trust-node24.log +9 -0
- package/docs/reports/unified-9.0.26/raw/independent-review/runtime-lifecycle-import-node24.log +35 -0
- package/docs/reports/unified-9.0.26/raw/lifecycle/node22-baseline925.json +30 -0
- package/docs/reports/unified-9.0.26/raw/lifecycle/node22-candidate926.json +30 -0
- package/docs/reports/unified-9.0.26/raw/lifecycle/node24-baseline925.json +30 -0
- package/docs/reports/unified-9.0.26/raw/lifecycle/node24-candidate926.json +30 -0
- package/docs/reports/unified-9.0.26/raw/node22-tests-before-backup-git-regression.log +16035 -0
- package/docs/reports/unified-9.0.26/raw/node22-tests-before-backup-ui.log +16037 -0
- package/docs/reports/unified-9.0.26/raw/node22-tests-before-ems-tariff.log +16064 -0
- package/docs/reports/unified-9.0.26/raw/node22-tests-before-git-regression.log +16027 -0
- package/docs/reports/unified-9.0.26/raw/node22-tests-before-pipeline-fixture.log +11584 -0
- package/docs/reports/unified-9.0.26/raw/node22-tests-before-remap-noop.log +11581 -0
- package/docs/reports/unified-9.0.26/raw/node22-tests-final.log +16520 -0
- package/docs/reports/unified-9.0.26/raw/node22-version.log +1 -0
- package/docs/reports/unified-9.0.26/raw/node24-tests-before-backup-git-regression.log +2678 -0
- package/docs/reports/unified-9.0.26/raw/node24-tests-before-backup-ui.log +2678 -0
- package/docs/reports/unified-9.0.26/raw/node24-tests-before-ems-tariff.log +1860 -0
- package/docs/reports/unified-9.0.26/raw/node24-tests-before-git-regression.log +2677 -0
- package/docs/reports/unified-9.0.26/raw/node24-tests-before-pipeline-fixture.log +1925 -0
- package/docs/reports/unified-9.0.26/raw/node24-tests-before-remap-noop.log +1924 -0
- package/docs/reports/unified-9.0.26/raw/node24-tests-final.log +2757 -0
- package/docs/reports/unified-9.0.26/raw/node24-version.log +1 -0
- package/docs/reports/unified-9.0.26/raw/ocpp-deletion-node22.log +148 -0
- package/docs/reports/unified-9.0.26/raw/ocpp-deletion-node24.log +30 -0
- package/docs/reports/unified-9.0.26/raw/publish-overlay-provenance.json +10 -0
- package/docs/reports/unified-9.0.26/raw/pwa/INTERNAL_VISUAL_CHECKS.md +1 -0
- package/docs/reports/unified-9.0.26/raw/pwa/index.json +18 -0
- package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-baseline.log +48 -0
- package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-browser-node22.json +33 -0
- package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-browser-node22.stderr +5 -0
- package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-browser.json +33 -0
- package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-browser.stderr +2 -0
- package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-focused-node22.log +137 -0
- package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-focused-node24.log +32 -0
- package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-lint.log +0 -0
- package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-recovery-node22.log +28 -0
- package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-recovery-node24.log +10 -0
- package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-tls-final.log +9 -0
- package/docs/reports/unified-9.0.26/raw/pwa/pwa-926-typecheck.log +0 -0
- package/docs/reports/unified-9.0.26/raw/tariff-deletion-station-kiosk-node22.log +250 -0
- package/docs/reports/unified-9.0.26/raw/tariff-deletion-station-kiosk-node24.log +46 -0
- package/docs/reports/unified-9.0.26/raw/tariff-startup/PRODUCT_REVIEW.md +30 -0
- package/docs/reports/unified-9.0.26/raw/tariff-startup/browser-eslint.log +0 -0
- package/docs/reports/unified-9.0.26/raw/tariff-startup/eslint.log +0 -0
- package/docs/reports/unified-9.0.26/raw/tariff-startup/independent-review-node24.log +35 -0
- package/docs/reports/unified-9.0.26/raw/tariff-startup/node22-browser.json +43 -0
- package/docs/reports/unified-9.0.26/raw/tariff-startup/node22-browser.stderr +2 -0
- package/docs/reports/unified-9.0.26/raw/tariff-startup/node22-process-final.log +26 -0
- package/docs/reports/unified-9.0.26/raw/tariff-startup/node22-tests.log +378 -0
- package/docs/reports/unified-9.0.26/raw/tariff-startup/node24-browser.json +43 -0
- package/docs/reports/unified-9.0.26/raw/tariff-startup/node24-browser.stderr +0 -0
- package/docs/reports/unified-9.0.26/raw/tariff-startup/node24-process-final.log +10 -0
- package/docs/reports/unified-9.0.26/raw/tariff-startup/node24-tests.log +66 -0
- package/docs/reports/unified-9.0.26/raw/tariff-startup/process-verification.json +41 -0
- package/docs/reports/unified-9.0.26/raw/tariff-startup/typecheck.log +0 -0
- package/docs/unified/NEXOWATT_TLS_DE.md +12 -2
- package/io-package.json +8 -9
- package/modules/backup/admin/index.html +24 -95
- package/modules/backup/admin/index.js +350 -98
- package/modules/backup/admin/style.css +40 -0
- package/package.json +12 -8
- package/public/eos-runtime/index.js +12 -2
- package/public/eos-tls/index.html +1 -1
- package/public/eos-tls/trust.css +19 -0
- package/public/eos-tls/trust.html +52 -0
- package/release-manifests/unified/build-environment.cdx.json +6 -6
- package/release-manifests/unified/files.json +316 -126
- package/release-manifests/unified/frontend.cdx.json +6 -6
- package/release-manifests/unified/installer.cdx.json +2 -2
- package/release-manifests/unified/obsolete-admin-assets.json +539 -457
- package/release-manifests/unified/runtime.cdx.json +26 -26
- package/release-manifests/unified/validation.json +15 -15
- package/tools/eos-lifecycle-benchmark.cjs +50 -0
- package/tools/eos-release-manifest.cjs +1 -1
- package/ui/ems/engine.js +5 -1
- package/ui/io-package.json +1 -1
- package/ui/lib/charging-point-identity.js +465 -0
- package/ui/lib/charging-station-identity.js +111 -0
- package/ui/lib/ocpp-auto-discovery.js +34 -3
- package/ui/main.js +165 -29
- package/ui/package.json +1 -1
- package/ui/www/app.js +63 -18
- package/ui/www/customer-tariff.js +67 -11
- package/ui/www/dc-station-display.js +15 -11
- package/ui/www/ems-apps.js +40 -6
- package/ui/www/evcs.js +55 -12
- package/ui/www/login.html +1 -0
- package/ui/www/manifest.webmanifest +2 -2
- package/adminWww/remoteEntry-eos-9.0.25.js +0 -12
|
@@ -8,14 +8,20 @@ const { EosModuleConfigStore } = require('./eosModuleConfigStore');
|
|
|
8
8
|
const { EosDeviceEmsService } = require('./eosDeviceEmsService');
|
|
9
9
|
const { resolveHistoryBackupRequirement } = require('./eosHistoryBackupScope');
|
|
10
10
|
const { EosModuleProcess } = require('./eosModuleProcess');
|
|
11
|
+
const { errorCode } = require('./eosModuleProcessProtocol');
|
|
12
|
+
const { loadModuleFactory } = require('./eosModuleLoad');
|
|
11
13
|
const SECRET_MARKER = '__EOS_SECRET_UNCHANGED__';
|
|
12
14
|
const MODULES = Object.freeze({ devices: 'nexowatt-devices', eebus: 'eebus', backup: 'nexowatt-backup', ocpp: 'ocpp21' });
|
|
15
|
+
const LEGACY_INSTANCE_OBJECT = /^system\.adapter\.([a-z0-9-]+)\.\d+$/;
|
|
16
|
+
const LEGACY_INSTANCE_ALIVE = /^system\.adapter\.([a-z0-9-]+)\.\d+\.alive$/;
|
|
13
17
|
const SECRET_KEY = /password|passwd|^pass$|accessjson|expertmount|secret|token|privatekey|pairingpin|apikey|credential|authorization|cookie/i;
|
|
14
18
|
const MAX_CONFIG_BYTES = 512 * 1024;
|
|
15
19
|
const MAX_LEGACY_INSTANCES = 64;
|
|
16
20
|
const LEASE_MS = 12000;
|
|
17
21
|
const DEVICES_START_IDLE_MS = 10000;
|
|
18
22
|
const DEVICES_START_TOTAL_MS = 120000;
|
|
23
|
+
const PERMANENT_PROCESS_ERRORS = new Set(['EOS_MODULE_DEPENDENCY_MISSING', 'EOS_MODULE_DEPENDENCY_INVALID',
|
|
24
|
+
'EOS_MODULE_SYNTAX_ERROR', 'EOS_MODULE_PROCESS_INIT']);
|
|
19
25
|
const isRecord = value => !!value && typeof value === 'object' && !Array.isArray(value);
|
|
20
26
|
const fail = code => Object.assign(new Error(code), { code });
|
|
21
27
|
function bounded(promise, milliseconds = 5000) {
|
|
@@ -132,7 +138,7 @@ class EosModuleHost {
|
|
|
132
138
|
factory(id) {
|
|
133
139
|
if (!Object.hasOwn(MODULES, id))
|
|
134
140
|
throw fail('EOS_MODULE_UNKNOWN');
|
|
135
|
-
return this.options.factories?.[id] ||
|
|
141
|
+
return this.options.factories?.[id] || loadModuleFactory(this.options.baseDir, id, message => this.owner.log.warn(message));
|
|
136
142
|
}
|
|
137
143
|
/** Bind only the internal hosted runtime, never a URL or browser callback. */
|
|
138
144
|
bindDeviceEms(handler, reserveProfileChange) {
|
|
@@ -183,8 +189,11 @@ class EosModuleHost {
|
|
|
183
189
|
return this.decodeConfig(id, this.owner.config.eosModules?.[id]);
|
|
184
190
|
}
|
|
185
191
|
decodeConfig(id, envelope) {
|
|
192
|
+
// A new module is available for setup. Starting the backup service must
|
|
193
|
+
// not opt a new installation into a scheduled job without configuration.
|
|
186
194
|
if (envelope == null)
|
|
187
|
-
return this.factory(id).validateConfig({ enabled:
|
|
195
|
+
return this.factory(id).validateConfig({ enabled: true,
|
|
196
|
+
...(id === 'backup' ? { minimalEnabled: false, ccuEnabled: false } : {}) });
|
|
188
197
|
if (!isRecord(envelope) || envelope.v !== 1 || typeof envelope.encrypted !== 'string') {
|
|
189
198
|
throw fail('EOS_MODULE_CONFIG_FORMAT');
|
|
190
199
|
}
|
|
@@ -194,15 +203,16 @@ class EosModuleHost {
|
|
|
194
203
|
// The authenticated configuration shell must read the real saved settings even
|
|
195
204
|
// while operational startup is fenced. This does not subscribe, start modules,
|
|
196
205
|
// claim ownership or write the instance/configuration objects.
|
|
197
|
-
async loadForEditing(id) {
|
|
206
|
+
async loadForEditing(id, retryConfiguration = false) {
|
|
198
207
|
if (this.configurationLoadPromise)
|
|
199
208
|
await this.configurationLoadPromise;
|
|
200
209
|
const entry = this.entries.get(id);
|
|
201
210
|
if (!entry)
|
|
202
211
|
throw fail('EOS_MODULE_UNKNOWN');
|
|
203
212
|
const startupAllowed = this.owner.eosMigration?.allowsStartup?.();
|
|
204
|
-
|
|
205
|
-
|
|
213
|
+
const retry = retryConfiguration && !entry.configLoaded;
|
|
214
|
+
if ((!retry && ((entry.configLoaded && entry.configurationStartupAllowed === startupAllowed) ||
|
|
215
|
+
this.initialized || this.startPromise)) || this.stopped || this.mutation)
|
|
206
216
|
return;
|
|
207
217
|
this.mutation = true;
|
|
208
218
|
this.configurationLoadPromise = (async () => {
|
|
@@ -217,10 +227,19 @@ class EosModuleHost {
|
|
|
217
227
|
entry.configLoaded = true;
|
|
218
228
|
entry.configurationStartupAllowed = startupAllowed;
|
|
219
229
|
entry.configurationError = '';
|
|
230
|
+
if (retry && !entry.stopFailed) {
|
|
231
|
+
entry.failed = false;
|
|
232
|
+
this.resetProcessFailure(entry);
|
|
233
|
+
entry.reason = config.enabled ? 'READY' : 'DISABLED';
|
|
234
|
+
}
|
|
220
235
|
}
|
|
221
236
|
catch (error) {
|
|
222
237
|
entry.configLoaded = false;
|
|
223
|
-
entry.configurationError =
|
|
238
|
+
entry.configurationError = this.failureCode(error, 'EOS_MODULE_CONFIG_UNAVAILABLE');
|
|
239
|
+
if (retry) {
|
|
240
|
+
entry.failed = true;
|
|
241
|
+
entry.reason = 'CONFIG_INVALID';
|
|
242
|
+
}
|
|
224
243
|
}
|
|
225
244
|
finally {
|
|
226
245
|
this.mutation = false;
|
|
@@ -268,6 +287,31 @@ class EosModuleHost {
|
|
|
268
287
|
}
|
|
269
288
|
}
|
|
270
289
|
processEnabled(id) { return this.options.processEnabled?.(id) !== false; }
|
|
290
|
+
failureCode(error, fallback) {
|
|
291
|
+
const code = errorCode(error);
|
|
292
|
+
return code === 'EOS_MODULE_PROCESS_OPERATION_FAILED' ? fallback : code;
|
|
293
|
+
}
|
|
294
|
+
resetProcessFailure(entry) {
|
|
295
|
+
entry.processFailure = '';
|
|
296
|
+
entry.restartAt = 0;
|
|
297
|
+
entry.consecutiveFailures = 0;
|
|
298
|
+
entry.startupError = '';
|
|
299
|
+
}
|
|
300
|
+
/** Called only after the previous PID, subscriptions and accepted writes drained. */
|
|
301
|
+
recordProcessFailure(entry, code) {
|
|
302
|
+
entry.processFailure = '';
|
|
303
|
+
if (entry.stopFailed || this.stopped)
|
|
304
|
+
return;
|
|
305
|
+
const permanent = PERMANENT_PROCESS_ERRORS.has(code);
|
|
306
|
+
entry.failed = permanent;
|
|
307
|
+
entry.consecutiveFailures++;
|
|
308
|
+
entry.restartAt = permanent ? 0 : performance.now() + Math.min(60000, 1000 * 2 ** Math.min(entry.consecutiveFailures - 1, 6));
|
|
309
|
+
entry.reason = permanent ? 'START_FAILED_RESTART_REQUIRED' : 'PROCESS_BACKOFF';
|
|
310
|
+
entry.processHealth = { ...entry.processHealth, mode: 'process', pid: null,
|
|
311
|
+
generation: entry.generation, lastHeartbeatAt: entry.processHealth?.lastHeartbeatAt || 0,
|
|
312
|
+
state: permanent ? 'error' : 'backoff', lastError: code };
|
|
313
|
+
this.nextOwnershipCheck = 0;
|
|
314
|
+
}
|
|
271
315
|
canOperate(id, generation) {
|
|
272
316
|
const entry = this.entries.get(id);
|
|
273
317
|
return this.running && this.initialized && !this.stopped && !!entry && this.processEnabled(id) && entry.config.enabled === true && !entry.failed &&
|
|
@@ -759,17 +803,11 @@ class EosModuleHost {
|
|
|
759
803
|
if (entry.processFailure) {
|
|
760
804
|
const code = entry.processFailure;
|
|
761
805
|
await this.stopEntry(entry);
|
|
762
|
-
entry
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
// per minute after the initial bounded exponential ramp.
|
|
768
|
-
entry.restartAt = performance.now() + Math.min(60000, 1000 * 2 ** Math.min(entry.consecutiveFailures - 1, 6));
|
|
769
|
-
entry.reason = 'PROCESS_BACKOFF';
|
|
770
|
-
entry.processHealth = { ...entry.processHealth, state: 'backoff', lastError: code };
|
|
771
|
-
this.nextOwnershipCheck = 0;
|
|
772
|
-
}
|
|
806
|
+
this.recordProcessFailure(entry, code);
|
|
807
|
+
}
|
|
808
|
+
if (!entry.configLoaded) {
|
|
809
|
+
this.revoke(entry, 'CONFIG_INVALID');
|
|
810
|
+
continue;
|
|
773
811
|
}
|
|
774
812
|
if (!this.processEnabled(entry.id))
|
|
775
813
|
this.revoke(entry, 'EOS_RUNTIME_DISABLED');
|
|
@@ -881,8 +919,7 @@ class EosModuleHost {
|
|
|
881
919
|
}
|
|
882
920
|
}
|
|
883
921
|
catch (error) {
|
|
884
|
-
entry.startupError =
|
|
885
|
-
'EOS_MODULE_START_CANCELLED'].includes(error?.code) ? error.code : 'EOS_MODULE_START_FAILED';
|
|
922
|
+
entry.startupError = this.failureCode(error, 'EOS_MODULE_START_FAILED');
|
|
886
923
|
if (!entry.stopFailed)
|
|
887
924
|
this.revoke(entry, 'START_FAILED_RESTART_REQUIRED');
|
|
888
925
|
entry.failed = true;
|
|
@@ -891,7 +928,7 @@ class EosModuleHost {
|
|
|
891
928
|
// old PID and accepted parent mutations have been drained.
|
|
892
929
|
// Injected legacy tests retain their original failure policy.
|
|
893
930
|
if (!this.options.factories?.[entry.id] && !entry.stopFailed && !this.stopped) {
|
|
894
|
-
entry.processFailure
|
|
931
|
+
this.recordProcessFailure(entry, entry.processFailure || entry.startupError);
|
|
895
932
|
}
|
|
896
933
|
this.owner.log.warn(`EOS_MODULE_START_FAILED: ${entry.id}; ${entry.startupError}; HTTPS remains available`);
|
|
897
934
|
}
|
|
@@ -959,7 +996,7 @@ class EosModuleHost {
|
|
|
959
996
|
entry.failed = true;
|
|
960
997
|
entry.configLoaded = false;
|
|
961
998
|
entry.reason = 'CONFIG_INVALID';
|
|
962
|
-
entry.configurationError =
|
|
999
|
+
entry.configurationError = this.failureCode(error, 'EOS_MODULE_CONFIG_UNAVAILABLE');
|
|
963
1000
|
}
|
|
964
1001
|
const name = MODULES[entry.id];
|
|
965
1002
|
await bounded(this.owner.subscribeForeignObjectsAsync(`system.adapter.${name}.*`));
|
|
@@ -982,25 +1019,37 @@ class EosModuleHost {
|
|
|
982
1019
|
})();
|
|
983
1020
|
return this.startPromise;
|
|
984
1021
|
}
|
|
1022
|
+
ownershipChanged(entry) {
|
|
1023
|
+
// A dormant module has no authority to revoke. External adapter
|
|
1024
|
+
// heartbeats must not look like hundreds of local process generations.
|
|
1025
|
+
if (!entry.configLoaded || !entry.config.enabled || !this.processEnabled(entry.id) || entry.failed)
|
|
1026
|
+
return false;
|
|
1027
|
+
const acquired = entry.module || entry.lease || entry.commandSubscriptionPending || this.leasePending;
|
|
1028
|
+
this.revoke(entry, 'OWNERSHIP_CHANGED');
|
|
1029
|
+
if (acquired)
|
|
1030
|
+
entry.generation++;
|
|
1031
|
+
this.nextOwnershipCheck = 0;
|
|
1032
|
+
return true;
|
|
1033
|
+
}
|
|
985
1034
|
onObjectChange(id) {
|
|
986
1035
|
this.deviceEms?.event(id);
|
|
1036
|
+
let relevant = false;
|
|
1037
|
+
const legacy = LEGACY_INSTANCE_OBJECT.exec(id)?.[1];
|
|
987
1038
|
for (const entry of this.entries.values()) {
|
|
988
|
-
if (
|
|
989
|
-
this.
|
|
990
|
-
entry.generation++;
|
|
991
|
-
this.nextOwnershipCheck = 0;
|
|
1039
|
+
if (legacy === MODULES[entry.id]) {
|
|
1040
|
+
relevant = this.ownershipChanged(entry) || relevant;
|
|
992
1041
|
}
|
|
993
1042
|
}
|
|
994
|
-
|
|
1043
|
+
if (relevant)
|
|
1044
|
+
void this.reconcile();
|
|
995
1045
|
}
|
|
996
1046
|
onStateChange(id, state) {
|
|
997
1047
|
this.deviceEms?.event(id, true);
|
|
1048
|
+
const legacy = LEGACY_INSTANCE_ALIVE.exec(id)?.[1];
|
|
1049
|
+
const hostLost = /^system\.host\..*\.alive$/.test(id) && state?.val !== true;
|
|
998
1050
|
for (const entry of this.entries.values()) {
|
|
999
|
-
if (
|
|
1000
|
-
(
|
|
1001
|
-
this.revoke(entry, 'OWNERSHIP_CHANGED');
|
|
1002
|
-
entry.generation++;
|
|
1003
|
-
this.nextOwnershipCheck = 0;
|
|
1051
|
+
if (legacy === MODULES[entry.id] || hostLost) {
|
|
1052
|
+
this.ownershipChanged(entry);
|
|
1004
1053
|
}
|
|
1005
1054
|
const prefix = entry.id === 'devices' ? `${this.namespace(entry.id)}.devices.` : `${this.namespace(entry.id)}.`;
|
|
1006
1055
|
if (entry.module && id.startsWith(prefix)) {
|
|
@@ -1029,15 +1078,21 @@ class EosModuleHost {
|
|
|
1029
1078
|
pending: !!entry.module && !entry.started && !entry.startup.settled,
|
|
1030
1079
|
error: entry.startupError || '' } };
|
|
1031
1080
|
}
|
|
1081
|
+
if (!entry.configLoaded)
|
|
1082
|
+
details = { ...details, configuration: { ready: false,
|
|
1083
|
+
error: entry.configurationError || 'EOS_MODULE_CONFIG_UNAVAILABLE' } };
|
|
1032
1084
|
if (!this.options.factories?.[id]) {
|
|
1033
1085
|
const processHealth = entry.module?.health?.() || entry.processHealth || {
|
|
1034
1086
|
mode: 'process', state: 'stopped', pid: null, generation: entry.generation, lastError: '', lastHeartbeatAt: 0,
|
|
1035
1087
|
};
|
|
1036
|
-
details = { ...details, process: { ...processHealth,
|
|
1088
|
+
details = { ...details, process: { ...processHealth,
|
|
1089
|
+
...(!entry.configLoaded ? { state: 'error', lastError: entry.configurationError || 'EOS_MODULE_CONFIG_UNAVAILABLE' } : {}),
|
|
1090
|
+
restarts: entry.processRestarts,
|
|
1037
1091
|
nextRestartAt: entry.restartAt ? Date.now() + Math.max(0, entry.restartAt - performance.now()) : 0 } };
|
|
1038
1092
|
}
|
|
1039
1093
|
return { id, enabled: entry.config.enabled === true, active: !!entry.module && entry.started === true && entry.moduleGeneration === entry.generation && this.canOperate(id, entry.generation),
|
|
1040
|
-
reason: !this.processEnabled(id) ? 'EOS_RUNTIME_DISABLED' : entry.reason,
|
|
1094
|
+
reason: !entry.configLoaded ? 'CONFIG_INVALID' : !this.processEnabled(id) ? 'EOS_RUNTIME_DISABLED' : entry.reason,
|
|
1095
|
+
blockers: entry.blockers, details: redact(assertJson(details)),
|
|
1041
1096
|
namespace: id === 'devices' ? `${this.namespace(id)}.devices` : this.namespace(id) };
|
|
1042
1097
|
}
|
|
1043
1098
|
/** Process controls do not replace module configuration or migration authority. */
|
|
@@ -1069,18 +1124,58 @@ class EosModuleHost {
|
|
|
1069
1124
|
await this.pending;
|
|
1070
1125
|
if (entry.stopFailed)
|
|
1071
1126
|
throw fail('EOS_RUNTIME_STOP_UNCONFIRMED');
|
|
1127
|
+
if (!entry.configLoaded)
|
|
1128
|
+
await this.loadForEditing(id, true);
|
|
1129
|
+
if (!entry.configLoaded)
|
|
1130
|
+
throw fail(entry.configurationError || 'EOS_MODULE_CONFIG_UNAVAILABLE');
|
|
1072
1131
|
if (!entry.config.enabled)
|
|
1073
1132
|
throw fail('EOS_RUNTIME_MODULE_DISABLED');
|
|
1074
1133
|
entry.failed = false;
|
|
1075
|
-
entry
|
|
1076
|
-
entry.restartAt = 0;
|
|
1077
|
-
entry.consecutiveFailures = 0;
|
|
1134
|
+
this.resetProcessFailure(entry);
|
|
1078
1135
|
this.nextOwnershipCheck = 0;
|
|
1079
1136
|
await this.reconcile();
|
|
1080
|
-
if (!entry.started || !this.canOperate(id, entry.generation))
|
|
1081
|
-
|
|
1137
|
+
if (!entry.started || !this.canOperate(id, entry.generation)) {
|
|
1138
|
+
const reason = { LEGACY_CONFLICT: 'EOS_MODULE_LEGACY_RUNNING', LICENSE_REQUIRED: 'EOS_RUNTIME_LICENSE_REQUIRED',
|
|
1139
|
+
EOS_OWNERSHIP_REQUIRED: 'EOS_RUNTIME_OWNERSHIP_REQUIRED', OWNERSHIP_UNAVAILABLE: 'EOS_MODULE_OWNERSHIP_UNAVAILABLE' }[entry.reason];
|
|
1140
|
+
throw fail(reason || entry.startupError || entry.processHealth?.lastError || 'EOS_RUNTIME_START_FAILED');
|
|
1141
|
+
}
|
|
1082
1142
|
this.deviceEms?.request('configuration');
|
|
1083
1143
|
}
|
|
1144
|
+
/** The caller keeps process permission inhibited until this real commit settles. */
|
|
1145
|
+
async enableProcessModule(id) {
|
|
1146
|
+
const entry = this.entries.get(id);
|
|
1147
|
+
if (!entry)
|
|
1148
|
+
throw fail('EOS_MODULE_UNKNOWN');
|
|
1149
|
+
if (entry.stopFailed)
|
|
1150
|
+
throw fail('EOS_RUNTIME_STOP_UNCONFIRMED');
|
|
1151
|
+
await this.loadForEditing(id, true);
|
|
1152
|
+
const reason = this.configurationReason(id);
|
|
1153
|
+
if (reason)
|
|
1154
|
+
throw fail(reason);
|
|
1155
|
+
if (entry.stopFailed)
|
|
1156
|
+
throw fail('EOS_RUNTIME_STOP_UNCONFIRMED');
|
|
1157
|
+
if (this.mutation || this.configurationSavePromise)
|
|
1158
|
+
throw fail('EOS_MODULE_BUSY');
|
|
1159
|
+
if (entry.config.enabled === true)
|
|
1160
|
+
return;
|
|
1161
|
+
const saving = this.save(id, { ...entry.config, enabled: true }, undefined, entry.configurationRevision);
|
|
1162
|
+
const committing = this.configurationSavePromise;
|
|
1163
|
+
// save() bounds its HTTP response; the accepted controller write may
|
|
1164
|
+
// still settle afterwards. Keep the runtime control transaction locked.
|
|
1165
|
+
let responseError;
|
|
1166
|
+
try {
|
|
1167
|
+
await saving;
|
|
1168
|
+
}
|
|
1169
|
+
catch (error) {
|
|
1170
|
+
responseError = error;
|
|
1171
|
+
}
|
|
1172
|
+
if (committing)
|
|
1173
|
+
await committing;
|
|
1174
|
+
else if (responseError)
|
|
1175
|
+
throw responseError;
|
|
1176
|
+
if (!entry.config.enabled)
|
|
1177
|
+
throw fail('EOS_RUNTIME_MODULE_DISABLED');
|
|
1178
|
+
}
|
|
1084
1179
|
async view(id) {
|
|
1085
1180
|
await this.loadForEditing(id);
|
|
1086
1181
|
const entry = this.entries.get(id);
|
|
@@ -1188,6 +1283,7 @@ class EosModuleHost {
|
|
|
1188
1283
|
entry.loadedEnvelope = envelope;
|
|
1189
1284
|
entry.configurationRevision = this.configStore.revisions.get(id);
|
|
1190
1285
|
if (!entry.stopFailed) {
|
|
1286
|
+
this.resetProcessFailure(entry);
|
|
1191
1287
|
entry.failed = false;
|
|
1192
1288
|
entry.reason = normalized.enabled ? 'STARTING' : 'DISABLED';
|
|
1193
1289
|
}
|