matterbridge 1.5.4 → 1.5.6
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 +34 -0
- package/README-DEV.md +10 -3
- package/README.md +32 -11
- package/dist/deviceManager.d.ts +1 -1
- package/dist/matterbridge.d.ts.map +1 -1
- package/dist/matterbridge.js +57 -35
- package/dist/matterbridge.js.map +1 -1
- package/dist/matterbridgeDevice.d.ts +22 -24
- package/dist/matterbridgeDevice.d.ts.map +1 -1
- package/dist/matterbridgeDevice.js +7 -7
- package/dist/matterbridgeDevice.js.map +1 -1
- package/dist/matterbridgePlatform.d.ts +6 -0
- package/dist/matterbridgePlatform.d.ts.map +1 -1
- package/dist/matterbridgePlatform.js +29 -0
- package/dist/matterbridgePlatform.js.map +1 -1
- package/dist/pluginManager.d.ts +1 -1
- package/dist/pluginManager.d.ts.map +1 -1
- package/dist/pluginManager.js +52 -1
- package/dist/pluginManager.js.map +1 -1
- package/frontend/build/asset-manifest.json +8 -8
- package/frontend/build/index.html +1 -1
- package/frontend/build/static/js/{main.f86befcf.js → main.af741b33.js} +3 -3
- package/frontend/build/static/js/main.af741b33.js.map +1 -0
- package/npm-shrinkwrap.json +7346 -0
- package/package.json +14 -13
- package/frontend/build/static/js/main.f86befcf.js.map +0 -1
- /package/frontend/build/static/js/{main.f86befcf.js.LICENSE.txt → main.af741b33.js.LICENSE.txt} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,40 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
If you like this project and find it useful, please consider giving it a star on GitHub at https://github.com/Luligu/matterbridge and sponsoring it.
|
|
6
6
|
|
|
7
|
+
### Home Assistant Community Add-ons
|
|
8
|
+
|
|
9
|
+
The Home Assistant Community Add-ons and plugins are not verified to work with Matterbridge. I strongly advise against using them. If you do use them and encounter an issue (which is likely because some do not meet the Matterbridge guidelines), please do not open an issue in the Matterbridge repository.
|
|
10
|
+
|
|
11
|
+
## [1.5.6] - 2024-09-13
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- [matterbridge]: Updated to support ingress (will be released soon in the [Official Matterbridge Home Assistant Add-on](https://github.com/Luligu/matterbridge-home-assistant-addon)).
|
|
16
|
+
- [frontend]: Updated to support ingress.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- [package]: Updated typescript to 5.6.2.
|
|
21
|
+
- [package]: Updated express to 4.21.0.
|
|
22
|
+
- [package]: Updated dependencies.
|
|
23
|
+
|
|
24
|
+
<a href="https://www.buymeacoffee.com/luligugithub">
|
|
25
|
+
<img src="./yellow-button.png" alt="Buy me a coffee" width="120">
|
|
26
|
+
</a>
|
|
27
|
+
|
|
28
|
+
## [1.5.5] - 2024-09-09
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
|
|
32
|
+
- [matterbridge]: Changed startMatterInterval from 30 to 60 seconds.
|
|
33
|
+
- [package]: Update matter-node.js to 0.10.1.
|
|
34
|
+
- [package]: Update matter-history to 1.1.11.
|
|
35
|
+
- [package]: Update dependencies.
|
|
36
|
+
|
|
37
|
+
<a href="https://www.buymeacoffee.com/luligugithub">
|
|
38
|
+
<img src="./yellow-button.png" alt="Buy me a coffee" width="120">
|
|
39
|
+
</a>
|
|
40
|
+
|
|
7
41
|
## [1.5.4] - 2024-09-05
|
|
8
42
|
|
|
9
43
|
### Changed
|
package/README-DEV.md
CHANGED
|
@@ -38,14 +38,21 @@ Matterbridge exports from:
|
|
|
38
38
|
- NodeStorage classes.
|
|
39
39
|
|
|
40
40
|
# **********
|
|
41
|
-
A plugin
|
|
41
|
+
A plugin must never install or import from `matter-node.js` or `matter.js` directly, as this leads to a second instance of `matter.js`, causing instability and unpredictable errors such as "The only instance is Endpoint". Additionally, when Matterbridge updates the `matter.js` version, it should be consistent across all plugins.
|
|
42
42
|
# **********
|
|
43
|
-
A plugin
|
|
43
|
+
A plugin must never install Matterbridge (neither as dependencies nor as devDependencies). Matterbridge must be linked to the plugin:
|
|
44
|
+
```json
|
|
45
|
+
"scripts": {
|
|
46
|
+
'''
|
|
47
|
+
"install": "node link-matterbridge-script.js",
|
|
48
|
+
'''
|
|
49
|
+
}
|
|
50
|
+
```
|
|
44
51
|
# **********
|
|
45
52
|
|
|
46
53
|
In the next releases I will remove the duplicated exports so please update your plugins.
|
|
47
54
|
|
|
48
|
-
I
|
|
55
|
+
I added some error messages when a plugin has wrong imports or configurations and the plugin will be disabled to prevent instability and crashes.
|
|
49
56
|
|
|
50
57
|
## Guidelines on the migration to matter.js V8
|
|
51
58
|
|
package/README.md
CHANGED
|
@@ -132,6 +132,10 @@ Config editor:
|
|
|
132
132
|
|
|
133
133
|
[Advanced configurations](https://github.com/Luligu/matterbridge/blob/main/README-DOCKER.md)
|
|
134
134
|
|
|
135
|
+
### Home Assistant Community Add-ons
|
|
136
|
+
|
|
137
|
+
The Home Assistant Community Add-ons and plugins are not verified to work with Matterbridge. I strongly advise against using them. If you do use them and encounter an issue (which is likely because some do not meet the Matterbridge guidelines), please do not open an issue in the Matterbridge repository.
|
|
138
|
+
|
|
135
139
|
## Development
|
|
136
140
|
|
|
137
141
|
[Development](https://github.com/Luligu/matterbridge/blob/main/README-DEV.md)
|
|
@@ -201,14 +205,29 @@ An Accessory platform plugin only exposes one device.
|
|
|
201
205
|
|
|
202
206
|
This an example of a dynamic platform plugin.
|
|
203
207
|
|
|
204
|
-
It exposes
|
|
208
|
+
It exposes:
|
|
209
|
+
- a switch with onOff cluster
|
|
210
|
+
- a light with onOff
|
|
211
|
+
- a light with onOff and levelControl (dimmer)
|
|
212
|
+
- a light with onOff, levelControl and colorControl (with XY, HS and CT) clusters
|
|
213
|
+
- a light with onOff, levelControl and colorControl (with HS only) clusters
|
|
214
|
+
- a light with onOff, levelControl and colorControl (with XY only) clusters
|
|
215
|
+
- a light with onOff, levelControl and colorControl (with CT only) clusters
|
|
216
|
+
- an outlet (plug) with onOff cluster
|
|
217
|
+
- a cover with windowCovering cluster
|
|
218
|
+
- a lock with doorLock cluster
|
|
219
|
+
- a thermo with thermostat cluster and 3 sub endpoints with flowMeasurement cluster, temperatureMeasurement cluster
|
|
220
|
+
and relativeHumidityMeasurement cluster (to show how to create a composed device with sub endpoints)
|
|
221
|
+
- a fan with FanControl cluster
|
|
222
|
+
- a rainSensor device
|
|
223
|
+
- a waterFreezeDetector device
|
|
224
|
+
- a waterLeakDetector device
|
|
225
|
+
- a smokeCoAlarm device
|
|
205
226
|
|
|
206
227
|
All these virtual devices continuously change state and position. The plugin also shows how to use all the command handlers (you can control all the devices).
|
|
207
228
|
|
|
208
229
|
A Dynamic platform plugin exposes as many devices as you need (the limit for the Home app is 150 accessories for bridge).
|
|
209
230
|
|
|
210
|
-
Matterbridge can run as many plugins as you want.
|
|
211
|
-
|
|
212
231
|
[See the plugin homepage here](https://github.com/Luligu/matterbridge-example-dynamic-platform)
|
|
213
232
|
|
|
214
233
|
### Example plugins to show the usage of history in matter
|
|
@@ -231,7 +250,6 @@ The Eve app only shows the history when the plugins run like an AccessoryPlatfor
|
|
|
231
250
|
|
|
232
251
|
Just open the frontend on the link provided in the log, select a plugin and click install.
|
|
233
252
|
|
|
234
|
-
|
|
235
253
|
## How to install and add a plugin manually from a terminal (from npm)
|
|
236
254
|
|
|
237
255
|
To install i.e. https://github.com/Luligu/matterbridge-zigbee2mqtt
|
|
@@ -314,15 +332,18 @@ All issues have been solved from the version 17.5 of the HomePod/AppleTV. Now th
|
|
|
314
332
|
|
|
315
333
|
So far is the only controller supporting some Matter 1.2 and 1.3 device type:
|
|
316
334
|
|
|
317
|
-
-
|
|
318
|
-
|
|
319
|
-
|
|
335
|
+
- airQualitySensor code 0x002c (Matter 1.2)
|
|
336
|
+
- waterFreezeDetector code 0x0041 (Matter 1.3 with only BooleanState cluster)
|
|
337
|
+
- waterLeakDetector code 0x0043 (Matter 1.3 with only BooleanState cluster)
|
|
338
|
+
- rainSensor code 0x0044 (Matter 1.3 with only BooleanState cluster)
|
|
339
|
+
- deviceEnergyManagement code 0x050d (Matter 1.3 with only DeviceEnergyManagementMode cluster)
|
|
320
340
|
|
|
321
|
-
|
|
322
|
-
-
|
|
323
|
-
-
|
|
341
|
+
Electrical measurements:
|
|
342
|
+
- electrical measurements from EveHistoryCluster (used in Matterbridge plugins)
|
|
343
|
+
- electricalSensor code 0x0510 with clusters: ElectricalPowerMeasurement and ElectricalEnergyMeasurement (still in dev but fully working!)
|
|
324
344
|
|
|
325
|
-
|
|
345
|
+
Other supported cluster:
|
|
346
|
+
- ModeSelect
|
|
326
347
|
|
|
327
348
|
## Home Assistant issues (Matter Server for HA is still in Beta)
|
|
328
349
|
|
package/dist/deviceManager.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export declare class DeviceManager {
|
|
|
38
38
|
remove(device: MatterbridgeDevice): boolean;
|
|
39
39
|
clear(): void;
|
|
40
40
|
array(): MatterbridgeDevice[];
|
|
41
|
-
[Symbol.iterator]():
|
|
41
|
+
[Symbol.iterator](): MapIterator<MatterbridgeDevice>;
|
|
42
42
|
forEach(callback: (device: MatterbridgeDevice) => Promise<void>): Promise<void>;
|
|
43
43
|
get logLevel(): LogLevel;
|
|
44
44
|
set logLevel(logLevel: LogLevel);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matterbridge.d.ts","sourceRoot":"","sources":["../src/matterbridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AASH,OAAO,YAAY,MAAM,QAAQ,CAAC;AAQlC,OAAO,EAAE,UAAU,EAAyK,MAAM,kBAAkB,CAAC;AAGrN,OAAO,EAAE,kBAAkB,EAAgC,MAAM,yBAAyB,CAAC;AAE3F,OAAO,EAAwB,uBAAuB,EAAsC,iCAAiC,EAAE,2BAA2B,EAAsB,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAkClO;;GAEG;AACH,qBAAa,YAAa,SAAQ,YAAY;IACrC,iBAAiB,EA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gBAAgB;IAc9B;;;;OAIG;YACW,sBAAsB;IA6CpC;;;;;;OAMG;YACW,wBAAwB;IA6LtC;;;;;;;;;;;;;;;;;OAiBG;YACW,gCAAgC;IA4B9C;;;;;;OAMG;YACW,gCAAgC;IAqC9C;;;;;;;OAOG;YACW,uBAAuB;IAyDrC;;;;;OAKG;IACH,OAAO,CAAC,0BAA0B;IAclC;;;;;OAKG;IACH,OAAO,CAAC,0BAA0B;IA0BlC;;;;;OAKG;IACH,OAAO,CAAC,kCAAkC;IAM1C;;;;OAIG;IACH,OAAO,CAAC,yBAAyB;IAWjC;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAM7B,OAAO,CAAC,eAAe,CAoCrB;IAEF;;;OAGG;YACW,wBAAwB;IAgCtC;;;;;OAKG;YACW,YAAY;IAqF1B;;;;;;;OAOG;IACH,OAAO,CAAC,cAAc;IAuCtB;;;;OAIG;IACG,kBAAkB,CAAC,IAAI,SAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA0sBpD;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;IAmDhC;;;;;OAKG;IACU,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,SAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAsEtG;;;;;OAKG;IACU,aAAa;IAa1B;;;;;OAKG;IACI,uBAAuB,IAAI,OAAO;CAI1C"}
|
package/dist/matterbridge.js
CHANGED
|
@@ -219,7 +219,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
219
219
|
if (hasParameter('docker'))
|
|
220
220
|
this.restartMode = 'docker';
|
|
221
221
|
// Set the matterbridge directory
|
|
222
|
-
this.homeDirectory = os.homedir();
|
|
222
|
+
this.homeDirectory = getParameter('homedir') ?? os.homedir();
|
|
223
223
|
this.matterbridgeDirectory = path.join(this.homeDirectory, '.matterbridge');
|
|
224
224
|
// Initialize nodeStorage and nodeContext
|
|
225
225
|
// this.log.debug(`Creating node storage manager: ${CYAN}${this.nodeStorageName}${db}`);
|
|
@@ -263,7 +263,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
263
263
|
this.log.logLevel = await this.nodeContext.get('matterbridgeLogLevel', "info" /* LogLevel.INFO */);
|
|
264
264
|
}
|
|
265
265
|
MatterbridgeDevice.logLevel = this.log.logLevel;
|
|
266
|
-
this.log.
|
|
266
|
+
this.log.notice('Matterbridge is starting...');
|
|
267
267
|
this.log.debug(`Matterbridge logLevel: ${this.log.logLevel} fileLoger: ${this.matterbridgeInformation.fileLogger}.`);
|
|
268
268
|
// Set matter.js logger level, format and logger (context: matterLogLevel)
|
|
269
269
|
if (hasParameter('matterlogger')) {
|
|
@@ -411,8 +411,8 @@ export class Matterbridge extends EventEmitter {
|
|
|
411
411
|
- list: list the registered plugins
|
|
412
412
|
- loginterfaces: log the network interfaces (usefull for finding the name of the interface to use with -mdnsinterface option)
|
|
413
413
|
- logstorage: log the node storage
|
|
414
|
-
- sudo: force the use of sudo to install or update packages
|
|
415
|
-
- nosudo: force not to use sudo to install or update packages
|
|
414
|
+
- sudo: force the use of sudo to install or update packages if the internal logic fails
|
|
415
|
+
- nosudo: force not to use sudo to install or update packages if the internal logic fails
|
|
416
416
|
- ssl: enable SSL for the frontend and WebSockerServer (certificates in .matterbridge/certs directory cert.pem, key.pem and ca.pem (optional))
|
|
417
417
|
- add [plugin path]: register the plugin from the given absolute or relative path
|
|
418
418
|
- add [plugin name]: register the globally installed plugin with the given name
|
|
@@ -600,7 +600,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
600
600
|
plugin.schemaJson = await this.plugins.loadSchema(plugin);
|
|
601
601
|
// Check if the plugin is available
|
|
602
602
|
if (!(await this.plugins.resolve(plugin.path))) {
|
|
603
|
-
this.log.error(`Plugin ${plg}${plugin.name}${er} not found. Disabling it.`);
|
|
603
|
+
this.log.error(`Plugin ${plg}${plugin.name}${er} not found or not validated. Disabling it.`);
|
|
604
604
|
plugin.enabled = false;
|
|
605
605
|
plugin.error = true;
|
|
606
606
|
continue;
|
|
@@ -638,7 +638,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
638
638
|
plugin.schemaJson = await this.plugins.loadSchema(plugin);
|
|
639
639
|
// Check if the plugin is available
|
|
640
640
|
if (!(await this.plugins.resolve(plugin.path))) {
|
|
641
|
-
this.log.error(`Plugin ${plg}${plugin.name}${er} not found. Disabling it.`);
|
|
641
|
+
this.log.error(`Plugin ${plg}${plugin.name}${er} not found or not validated. Disabling it.`);
|
|
642
642
|
plugin.enabled = false;
|
|
643
643
|
plugin.error = true;
|
|
644
644
|
continue;
|
|
@@ -756,7 +756,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
756
756
|
this.log.debug(`- Free Memory: ${this.systemInformation.freeMemory}`);
|
|
757
757
|
this.log.debug(`- System Uptime: ${this.systemInformation.systemUptime}`);
|
|
758
758
|
// Home directory
|
|
759
|
-
this.homeDirectory = os.homedir();
|
|
759
|
+
this.homeDirectory = getParameter('homedir') ?? os.homedir();
|
|
760
760
|
this.matterbridgeInformation.homeDirectory = this.homeDirectory;
|
|
761
761
|
this.log.debug(`Home Directory: ${this.homeDirectory}`);
|
|
762
762
|
// Package root directory
|
|
@@ -1425,7 +1425,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
1425
1425
|
async startBridge() {
|
|
1426
1426
|
// Plugins are loaded and started by loadPlugin on startup and plugin.loaded and plugin.started are set to true
|
|
1427
1427
|
// Plugins are configured by a timer when matter server is started and plugin.configured is set to true
|
|
1428
|
-
this.log.debug('
|
|
1428
|
+
this.log.debug('Starting startMatterInterval in bridge mode');
|
|
1429
1429
|
let failCount = 0;
|
|
1430
1430
|
this.startMatterInterval = setInterval(async () => {
|
|
1431
1431
|
for (const plugin of this.plugins) {
|
|
@@ -1435,16 +1435,16 @@ export class Matterbridge extends EventEmitter {
|
|
|
1435
1435
|
if (plugin.error) {
|
|
1436
1436
|
clearInterval(this.startMatterInterval);
|
|
1437
1437
|
this.startMatterInterval = undefined;
|
|
1438
|
-
this.log.debug('
|
|
1438
|
+
this.log.debug('Cleared startMatterInterval interval for Matterbridge for plugin in error state');
|
|
1439
1439
|
this.log.error(`The plugin ${plg}${plugin.name}${er} is in error state.`);
|
|
1440
1440
|
this.log.error('The bridge will not start until the problem is solved to prevent the controllers from deleting all registered devices.');
|
|
1441
1441
|
this.log.error('If you want to start the bridge disable the plugin in error state and restart.');
|
|
1442
1442
|
return;
|
|
1443
1443
|
}
|
|
1444
1444
|
if (!plugin.loaded || !plugin.started) {
|
|
1445
|
-
this.log.debug(
|
|
1445
|
+
this.log.debug(`Waiting (failSafeCount=${failCount}/60) in startMatterInterval interval for plugin ${plg}${plugin.name}${db} loaded: ${plugin.loaded} started: ${plugin.started}...`);
|
|
1446
1446
|
failCount++;
|
|
1447
|
-
if (failCount >
|
|
1447
|
+
if (failCount > 60) {
|
|
1448
1448
|
this.log.error(`Error waiting for plugin ${plg}${plugin.name}${er} to load and start. Plugin is in error state.`);
|
|
1449
1449
|
plugin.error = true;
|
|
1450
1450
|
}
|
|
@@ -1453,7 +1453,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
1453
1453
|
}
|
|
1454
1454
|
clearInterval(this.startMatterInterval);
|
|
1455
1455
|
this.startMatterInterval = undefined;
|
|
1456
|
-
this.log.debug('
|
|
1456
|
+
this.log.debug('Cleared startMatterInterval interval for Matterbridge');
|
|
1457
1457
|
await this.startMatterServer();
|
|
1458
1458
|
this.log.notice('Matter server started');
|
|
1459
1459
|
// Configure the plugins
|
|
@@ -1491,7 +1491,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
1491
1491
|
// Plugins are loaded and started by loadPlugin on startup and plugin.loaded and plugin.started are set to true
|
|
1492
1492
|
// addDevice and addBridgedDeevice create the commissionig servers and add the devices to the the commissioning server or to the aggregator
|
|
1493
1493
|
// Plugins are configured by a timer when matter server is started and plugin.configured is set to true
|
|
1494
|
-
this.log.debug('
|
|
1494
|
+
this.log.debug('Starting start matter interval in childbridge mode...');
|
|
1495
1495
|
let failCount = 0;
|
|
1496
1496
|
this.startMatterInterval = setInterval(async () => {
|
|
1497
1497
|
let allStarted = true;
|
|
@@ -1502,18 +1502,18 @@ export class Matterbridge extends EventEmitter {
|
|
|
1502
1502
|
if (plugin.error) {
|
|
1503
1503
|
clearInterval(this.startMatterInterval);
|
|
1504
1504
|
this.startMatterInterval = undefined;
|
|
1505
|
-
this.log.debug('
|
|
1505
|
+
this.log.debug('Cleared startMatterInterval interval for Matterbridge for plugin in error state');
|
|
1506
1506
|
this.log.error(`The plugin ${plg}${plugin.name}${er} is in error state.`);
|
|
1507
1507
|
this.log.error('The bridge will not start until the problem is solved to prevent the controllers from deleting all registered devices.');
|
|
1508
1508
|
this.log.error('If you want to start the bridge disable the plugin in error state and restart.');
|
|
1509
1509
|
return;
|
|
1510
1510
|
}
|
|
1511
|
-
this.log.debug(
|
|
1511
|
+
this.log.debug(`Checking plugin ${plg}${plugin.name}${db} to start matter in childbridge mode...`);
|
|
1512
1512
|
if (!plugin.loaded || !plugin.started) {
|
|
1513
1513
|
allStarted = false;
|
|
1514
|
-
this.log.debug(
|
|
1514
|
+
this.log.debug(`Waiting (failSafeCount=${failCount}/60) for plugin ${plg}${plugin.name}${db} to load (${plugin.loaded}) and start (${plugin.started}) ...`);
|
|
1515
1515
|
failCount++;
|
|
1516
|
-
if (failCount >
|
|
1516
|
+
if (failCount > 60) {
|
|
1517
1517
|
this.log.error(`Error waiting for plugin ${plg}${plugin.name}${er} to load and start. Plugin is in error mode.`);
|
|
1518
1518
|
plugin.error = true;
|
|
1519
1519
|
}
|
|
@@ -1523,7 +1523,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
1523
1523
|
return;
|
|
1524
1524
|
clearInterval(this.startMatterInterval);
|
|
1525
1525
|
this.startMatterInterval = undefined;
|
|
1526
|
-
this.log.debug('
|
|
1526
|
+
this.log.debug('Cleared startMatterInterval interval in childbridge mode');
|
|
1527
1527
|
await this.startMatterServer();
|
|
1528
1528
|
this.log.notice('Matter server started');
|
|
1529
1529
|
// Configure the plugins
|
|
@@ -2475,7 +2475,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2475
2475
|
this.wssSendMessage('spawn', this.log.now(), 'Matterbridge:spawn', `child process closed with code ${code} and signal ${signal}`);
|
|
2476
2476
|
if (code === 0) {
|
|
2477
2477
|
if (cmdLine.startsWith('npm install -g'))
|
|
2478
|
-
this.log.notice(
|
|
2478
|
+
this.log.notice(`Package ${cmdLine.replace('npm install -g ', '').replace('--verbose', '')} installed correctly`);
|
|
2479
2479
|
this.log.debug(`Child process "${cmdLine}" closed with code ${code} and signal ${signal}`);
|
|
2480
2480
|
resolve();
|
|
2481
2481
|
}
|
|
@@ -2502,14 +2502,14 @@ export class Matterbridge extends EventEmitter {
|
|
|
2502
2502
|
if (childProcess.stdout) {
|
|
2503
2503
|
childProcess.stdout.on('data', (data) => {
|
|
2504
2504
|
const message = data.toString().trim();
|
|
2505
|
-
this.log.debug(`Spawn stdout: ${message}`);
|
|
2505
|
+
this.log.debug(`Spawn output (stdout): ${message}`);
|
|
2506
2506
|
this.wssSendMessage('spawn', this.log.now(), 'Matterbridge:spawn', message);
|
|
2507
2507
|
});
|
|
2508
2508
|
}
|
|
2509
2509
|
if (childProcess.stderr) {
|
|
2510
2510
|
childProcess.stderr.on('data', (data) => {
|
|
2511
2511
|
const message = data.toString().trim();
|
|
2512
|
-
this.log.debug(`Spawn stderr: ${message}`);
|
|
2512
|
+
this.log.debug(`Spawn verbose (stderr): ${message}`);
|
|
2513
2513
|
this.wssSendMessage('spawn', this.log.now(), 'Matterbridge:spawn', message);
|
|
2514
2514
|
});
|
|
2515
2515
|
}
|
|
@@ -2570,17 +2570,34 @@ export class Matterbridge extends EventEmitter {
|
|
|
2570
2570
|
this.log.debug(`Initializing the frontend ${hasParameter('ssl') ? 'https' : 'http'} server on port ${YELLOW}${port}${db}`);
|
|
2571
2571
|
// Create the express app that serves the frontend
|
|
2572
2572
|
this.expressApp = express();
|
|
2573
|
+
// Log all requests to the server for debugging
|
|
2574
|
+
/*
|
|
2575
|
+
if (hasParameter('homedir')) {
|
|
2576
|
+
this.expressApp.use((req, res, next) => {
|
|
2577
|
+
this.log.debug(`Received request on expressApp: ${req.method} ${req.url}`);
|
|
2578
|
+
next();
|
|
2579
|
+
});
|
|
2580
|
+
}
|
|
2581
|
+
*/
|
|
2582
|
+
// Serve static files from '/static' endpoint
|
|
2573
2583
|
this.expressApp.use(express.static(path.join(this.rootDirectory, 'frontend/build')));
|
|
2574
2584
|
if (!hasParameter('ssl')) {
|
|
2575
2585
|
// Create an HTTP server and attach the express app
|
|
2576
2586
|
this.httpServer = createServer(this.expressApp);
|
|
2577
2587
|
// Listen on the specified port
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
this.log.info(`The frontend http server is listening on ${UNDERLINE}http
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2588
|
+
if (hasParameter('ingress')) {
|
|
2589
|
+
this.httpServer.listen(port, '0.0.0.0', () => {
|
|
2590
|
+
this.log.info(`The frontend http server is listening on ${UNDERLINE}http://0.0.0.0:${port}${UNDERLINEOFF}${rs}`);
|
|
2591
|
+
});
|
|
2592
|
+
}
|
|
2593
|
+
else {
|
|
2594
|
+
this.httpServer.listen(port, () => {
|
|
2595
|
+
if (this.systemInformation.ipv4Address !== '')
|
|
2596
|
+
this.log.info(`The frontend http server is listening on ${UNDERLINE}http://${this.systemInformation.ipv4Address}:${port}${UNDERLINEOFF}${rs}`);
|
|
2597
|
+
if (this.systemInformation.ipv6Address !== '')
|
|
2598
|
+
this.log.info(`The frontend http server is listening on ${UNDERLINE}http://[${this.systemInformation.ipv6Address}]:${port}${UNDERLINEOFF}${rs}`);
|
|
2599
|
+
});
|
|
2600
|
+
}
|
|
2584
2601
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2585
2602
|
this.httpServer.on('error', (error) => {
|
|
2586
2603
|
this.log.error(`Frontend http server error listening on ${port}`);
|
|
@@ -2628,12 +2645,19 @@ export class Matterbridge extends EventEmitter {
|
|
|
2628
2645
|
// Create an HTTPS server with the SSL certificate and private key (ca is optional) and attach the express app
|
|
2629
2646
|
this.httpsServer = https.createServer(serverOptions, this.expressApp);
|
|
2630
2647
|
// Listen on the specified port
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
this.log.info(`The frontend https server is listening on ${UNDERLINE}https
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2648
|
+
if (hasParameter('ingress')) {
|
|
2649
|
+
this.httpsServer.listen(port, '0.0.0.0', () => {
|
|
2650
|
+
this.log.info(`The frontend https server is listening on ${UNDERLINE}https://0.0.0.0:${port}${UNDERLINEOFF}${rs}`);
|
|
2651
|
+
});
|
|
2652
|
+
}
|
|
2653
|
+
else {
|
|
2654
|
+
this.httpsServer.listen(port, () => {
|
|
2655
|
+
if (this.systemInformation.ipv4Address !== '')
|
|
2656
|
+
this.log.info(`The frontend https server is listening on ${UNDERLINE}https://${this.systemInformation.ipv4Address}:${port}${UNDERLINEOFF}${rs}`);
|
|
2657
|
+
if (this.systemInformation.ipv6Address !== '')
|
|
2658
|
+
this.log.info(`The frontend https server is listening on ${UNDERLINE}https://[${this.systemInformation.ipv6Address}]:${port}${UNDERLINEOFF}${rs}`);
|
|
2659
|
+
});
|
|
2660
|
+
}
|
|
2637
2661
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2638
2662
|
this.httpsServer.on('error', (error) => {
|
|
2639
2663
|
this.log.error(`Frontend https server error listening on ${port}`);
|
|
@@ -2658,9 +2682,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
2658
2682
|
this.webSocketServer.on('connection', (ws, request) => {
|
|
2659
2683
|
const clientIp = request.socket.remoteAddress;
|
|
2660
2684
|
AnsiLogger.setGlobalCallback(this.wssSendMessage.bind(this), "debug" /* LogLevel.DEBUG */);
|
|
2661
|
-
this.log.debug('WebSocketServer logger global callback added');
|
|
2662
2685
|
this.log.info(`WebSocketServer client "${clientIp}" connected to Matterbridge`);
|
|
2663
|
-
// this.wssSendMessage('info', this.log.now(), 'Matterbridge', `WebSocketServer client "${clientIp}" connected to Matterbridge`);
|
|
2664
2686
|
ws.on('message', (message) => {
|
|
2665
2687
|
this.log.debug(`WebSocket client message: ${message}`);
|
|
2666
2688
|
});
|