@matterbridge/core 3.5.4-dev-20260211-520e349 → 3.5.4-dev-20260212-4db2fd6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -128,6 +128,10 @@ function help() {
128
128
  --enable [plugin name]: enable the globally installed plugin with the given name
129
129
  --disable [plugin path]: disable the plugin from the given absolute or relative path
130
130
  --disable [plugin name]: disable the globally installed plugin with the given name
131
+ --list: list the registered plugins
132
+ --loginterfaces: log the network interfaces (usefull for finding the name of the interface to use with -mdnsinterface option)
133
+ --logstorage: log the node storage
134
+ --systemcheck: perform a system check (check Node.js version and network interfaces)
131
135
 
132
136
  Reset Commands:
133
137
  --reset: remove the commissioning for Matterbridge (bridge mode and childbridge mode). Shutdown Matterbridge before using it!
@@ -148,9 +152,6 @@ function help() {
148
152
  --filelogger: enable the matterbridge file logger (matterbridge.log)
149
153
  --matterlogger: set the matter.js logger level: debug | info | notice | warn | error | fatal (default info)
150
154
  --matterfilelogger: enable the matter.js file logger (matter.log)
151
- --list: list the registered plugins
152
- --loginterfaces: log the network interfaces (usefull for finding the name of the interface to use with -mdnsinterface option)
153
- --logstorage: log the node storage
154
155
  --sudo: force the use of sudo to install or update packages if the internal logic fails
155
156
  --nosudo: force not to use sudo to install or update packages if the internal logic fails
156
157
  --norestore: force not to automatically restore the matterbridge node storage and the matter storage from backup if it is corrupted
@@ -74,6 +74,7 @@ export declare class Matterbridge extends EventEmitter<MatterbridgeEvents> {
74
74
  private readonly startMatterIntervalMs;
75
75
  private checkUpdateInterval;
76
76
  private checkUpdateTimeout;
77
+ private systemCheckTimeout;
77
78
  private configureTimeout;
78
79
  private reachabilityTimeout;
79
80
  private sigintHandler;
@@ -15,7 +15,7 @@ import { Endpoint, ServerNode } from '@matter/node';
15
15
  import { DeviceTypeId, VendorId } from '@matter/types/datatype';
16
16
  import { AggregatorEndpoint } from '@matter/node/endpoints';
17
17
  import { BasicInformationServer } from '@matter/node/behaviors/basic-information';
18
- import { copyDirectory, createDirectory, formatBytes, formatPercent, formatUptime, getIntParameter, getParameter, hasParameter, isValidNumber, isValidObject, isValidString, parseVersionString, } from '@matterbridge/utils';
18
+ import { copyDirectory, createDirectory, formatBytes, formatPercent, formatUptime, getIntParameter, getParameter, hasParameter, isValidNumber, isValidObject, isValidString, parseVersionString, excludedInterfaceNamePattern, } from '@matterbridge/utils';
19
19
  import { dev, MATTER_LOGGER_FILE, MATTER_STORAGE_NAME, MATTERBRIDGE_LOGGER_FILE, NODE_STORAGE_DIR, plg, typ } from '@matterbridge/types';
20
20
  import { BroadcastServer } from '@matterbridge/thread';
21
21
  import { PluginManager } from './pluginManager.js';
@@ -93,6 +93,7 @@ export class Matterbridge extends EventEmitter {
93
93
  startMatterIntervalMs = 1000;
94
94
  checkUpdateInterval;
95
95
  checkUpdateTimeout;
96
+ systemCheckTimeout;
96
97
  configureTimeout;
97
98
  reachabilityTimeout;
98
99
  sigintHandler;
@@ -541,7 +542,8 @@ export class Matterbridge extends EventEmitter {
541
542
  !hasParameter('enable') &&
542
543
  !hasParameter('disable') &&
543
544
  !hasParameter('reset') &&
544
- !hasParameter('factoryreset')) {
545
+ !hasParameter('factoryreset') &&
546
+ !hasParameter('systemcheck')) {
545
547
  this.log.info(`Error parsing plugin ${plg}${plugin.name}${nf}. Trying to reinstall it from npm...`);
546
548
  const { spawnCommand } = await import('./spawn.js');
547
549
  if (await spawnCommand('npm', ['install', '-g', `${plugin.name}${plugin.version.includes('-dev-') ? '@dev' : ''}`, '--omit=dev', '--verbose'], 'install', plugin.name)) {
@@ -635,6 +637,12 @@ export class Matterbridge extends EventEmitter {
635
637
  this.shutdown = true;
636
638
  return;
637
639
  }
640
+ if (hasParameter('systemcheck')) {
641
+ const { systemCheck } = await import('@matterbridge/thread');
642
+ await systemCheck();
643
+ this.shutdown = true;
644
+ return;
645
+ }
638
646
  if (getParameter('add')) {
639
647
  this.log.debug(`Adding plugin ${getParameter('add')}`);
640
648
  await this.plugins.add(getParameter('add'));
@@ -710,6 +718,11 @@ export class Matterbridge extends EventEmitter {
710
718
  this.shutdown = true;
711
719
  return;
712
720
  }
721
+ clearTimeout(this.systemCheckTimeout);
722
+ this.systemCheckTimeout = setTimeout(async () => {
723
+ const { createESMWorker } = await import('@matterbridge/thread');
724
+ createESMWorker('SystemCheck', this.resolveWorkerDistFilePath('workerSystemCheck.js'));
725
+ }, 120 * 1000).unref();
713
726
  clearTimeout(this.checkUpdateTimeout);
714
727
  this.checkUpdateTimeout = setTimeout(async () => {
715
728
  const { createESMWorker } = await import('@matterbridge/thread');
@@ -828,7 +841,6 @@ export class Matterbridge extends EventEmitter {
828
841
  this.sigtermHandler = undefined;
829
842
  }
830
843
  async logNodeAndSystemInfo() {
831
- const excludedInterfaceNamePattern = /(tailscale|wireguard|openvpn|zerotier|hamachi|\bwg\d+\b|\btun\d+\b|\btap\d+\b|\butun\d+\b|docker|podman|\bveth[a-z0-9]*\b|\bbr-[a-z0-9]+\b|cni|kube|flannel|calico|virbr\d*\b|vmware|vmnet\d*\b|virtualbox|vboxnet\d*\b|teredo|isatap)/i;
832
844
  const networkInterfaces = os.networkInterfaces();
833
845
  this.systemInformation.interfaceName = '';
834
846
  this.systemInformation.ipv4Address = '';
@@ -919,7 +931,6 @@ export class Matterbridge extends EventEmitter {
919
931
  }
920
932
  }
921
933
  else {
922
- this.log.debug(`Global node_modules Directory: ${this.globalModulesDirectory}`);
923
934
  const { createESMWorker } = await import('@matterbridge/thread');
924
935
  createESMWorker('NpmGlobalPrefix', this.resolveWorkerDistFilePath('workerGlobalPrefix.js'));
925
936
  }
@@ -1050,6 +1061,11 @@ export class Matterbridge extends EventEmitter {
1050
1061
  this.startMatterInterval = undefined;
1051
1062
  this.log.debug('Start matter interval cleared');
1052
1063
  }
1064
+ if (this.systemCheckTimeout) {
1065
+ clearTimeout(this.systemCheckTimeout);
1066
+ this.systemCheckTimeout = undefined;
1067
+ this.log.debug('System check timeout cleared');
1068
+ }
1053
1069
  if (this.checkUpdateTimeout) {
1054
1070
  clearTimeout(this.checkUpdateTimeout);
1055
1071
  this.checkUpdateTimeout = undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matterbridge/core",
3
- "version": "3.5.4-dev-20260211-520e349",
3
+ "version": "3.5.4-dev-20260212-4db2fd6",
4
4
  "description": "Matterbridge core library",
5
5
  "author": "https://github.com/Luligu",
6
6
  "homepage": "https://matterbridge.io/",
@@ -126,10 +126,10 @@
126
126
  },
127
127
  "dependencies": {
128
128
  "@matter/main": "0.16.8",
129
- "@matterbridge/dgram": "3.5.4-dev-20260211-520e349",
130
- "@matterbridge/thread": "3.5.4-dev-20260211-520e349",
131
- "@matterbridge/types": "3.5.4-dev-20260211-520e349",
132
- "@matterbridge/utils": "3.5.4-dev-20260211-520e349",
129
+ "@matterbridge/dgram": "3.5.4-dev-20260212-4db2fd6",
130
+ "@matterbridge/thread": "3.5.4-dev-20260212-4db2fd6",
131
+ "@matterbridge/types": "3.5.4-dev-20260212-4db2fd6",
132
+ "@matterbridge/utils": "3.5.4-dev-20260212-4db2fd6",
133
133
  "archiver": "7.0.1",
134
134
  "express": "5.2.1",
135
135
  "glob": "13.0.1",