matterbridge 1.3.5 → 1.3.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 +17 -0
- package/README.md +3 -1
- package/dist/cluster/ElectricalEnergyMeasurementCluster.js +1 -1
- package/dist/cluster/ElectricalEnergyMeasurementCluster.js.map +1 -1
- package/dist/cluster/ElectricalPowerMeasurementCluster.js +10 -10
- package/dist/cluster/ElectricalPowerMeasurementCluster.js.map +1 -1
- package/dist/logger/export.d.ts.map +1 -0
- package/dist/logger/export.js.map +1 -0
- package/dist/matterbridge.d.ts +2 -1
- package/dist/matterbridge.d.ts.map +1 -1
- package/dist/matterbridge.js +157 -95
- package/dist/matterbridge.js.map +1 -1
- package/dist/matterbridgeDevice.js +4 -4
- package/package.json +24 -2
- package/dist/cluster/export.d.ts +0 -25
- package/dist/cluster/export.d.ts.map +0 -1
- package/dist/cluster/export.js +0 -25
- package/dist/cluster/export.js.map +0 -1
- package/dist/log/export.d.ts.map +0 -1
- package/dist/log/export.js.map +0 -1
- package/dist/utils/export.d.ts +0 -3
- package/dist/utils/export.d.ts.map +0 -1
- package/dist/utils/export.js +0 -3
- package/dist/utils/export.js.map +0 -1
- /package/dist/{log → logger}/export.d.ts +0 -0
- /package/dist/{log → logger}/export.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,23 @@ 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
|
+
## [1.3.6] - 2024-06-28
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- [matterbridge]: Unified the http server port for the frontend and the WebSockerServer.
|
|
12
|
+
- [matterbridge]: Unified the https server port for the frontend and the WebSockerServer.
|
|
13
|
+
- [certificates]: The certificates for https connections are imported from the directory ~/.matterbridge/certs with these names: cert.pem, key.pem and ca.pem (optional). Use the -ssl command line parameter to activate https for both frontend and WebSocketServer.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- [matterbridge]: Fixed exports
|
|
18
|
+
- [matterbridgeDevice]: Fixed ElectricalEnergyMeasurement and ElectricalPowerMeasurement
|
|
19
|
+
|
|
20
|
+
<a href="https://www.buymeacoffee.com/luligugithub">
|
|
21
|
+
<img src="./yellow-button.png" alt="Buy me a coffee" width="120">
|
|
22
|
+
</a>
|
|
23
|
+
|
|
7
24
|
## [1.3.5] - 2024-06-26
|
|
8
25
|
|
|
9
26
|
### Added
|
package/README.md
CHANGED
|
@@ -566,7 +566,9 @@ HA also support electrical measurements from EveHistoryCluster (used in Matterbr
|
|
|
566
566
|
|
|
567
567
|
## Google Home
|
|
568
568
|
|
|
569
|
-
|
|
569
|
+
If you face a problem pairing to Google Home from Ios app the solution is there https://github.com/Luligu/matterbridge/issues/61.
|
|
570
|
+
|
|
571
|
+
No other issues reported so far.
|
|
570
572
|
|
|
571
573
|
## Alexa
|
|
572
574
|
|
|
@@ -36,7 +36,7 @@ export var ElectricalEnergyMeasurement;
|
|
|
36
36
|
*
|
|
37
37
|
* @see {@link MatterSpecification.v13.Cluster} § 2.12.5.1.1
|
|
38
38
|
*/
|
|
39
|
-
energy: TlvField(0, TlvInt64.bound({ min: 0, max:
|
|
39
|
+
energy: TlvField(0, TlvInt64.bound({ min: 0, max: 2 ** 62 })),
|
|
40
40
|
/**
|
|
41
41
|
* This field shall indicate the timestamp in UTC of the beginning of the period during which the value of the
|
|
42
42
|
* Energy field was measured.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElectricalEnergyMeasurementCluster.js","sourceRoot":"","sources":["../../src/cluster/ElectricalEnergyMeasurementCluster.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,sCAA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AAE,CAAC;YAC9J,qBAAqB,EAAE,cAAc,CAAC,aAAa,CAAC,4BAAA,yBAAyB,CAAC,UAAU,CAAC,qBAAqB,EAAE,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;SACxI;QAED,MAAM,EAAE;YACN,wBAAwB,EAAE,cAAc,CAAC,aAAa,CAAC,4BAAA,yBAAyB,CAAC,MAAM,CAAC,wBAAwB,EAAE,EAAE,WAAW,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1I,sBAAsB,EAAE,cAAc,CAAC,aAAa,CAAC,4BAAA,uBAAuB,CAAC,MAAM,CAAC,sBAAsB,EAAE,EAAE,WAAW,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;SACrI;KACF,CAAC,CAAC;IAUU,oCAAQ,GAAa,4BAAA,gBAAgB,CAAC;AACrD,CAAC,EAjlBgB,2BAA2B,KAA3B,2BAA2B,QAilB3C;AAGD,MAAM,CAAC,MAAM,kCAAkC,GAAG,2BAA2B,CAAC,OAAO,CAAC;AACtF,eAAe,CAAC,QAAQ,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -38,7 +38,7 @@ export var ElectricalPowerMeasurement;
|
|
|
38
38
|
*
|
|
39
39
|
* @see {@link MatterSpecification.v13.Cluster} § 2.13.5.3.2
|
|
40
40
|
*/
|
|
41
|
-
measurement: TlvField(1, TlvNullable(TlvInt64.bound({ min: -
|
|
41
|
+
measurement: TlvField(1, TlvNullable(TlvInt64.bound({ min: -(2 ** 62), max: 2 ** 62 }))),
|
|
42
42
|
});
|
|
43
43
|
/**
|
|
44
44
|
* @see {@link MatterSpecification.v13.Cluster} § 2.13.5.1
|
|
@@ -82,14 +82,14 @@ export var ElectricalPowerMeasurement;
|
|
|
82
82
|
*
|
|
83
83
|
* @see {@link MatterSpecification.v13.Cluster} § 2.13.5.2.2
|
|
84
84
|
*/
|
|
85
|
-
min: TlvField(1, TlvInt64.bound({ min: -
|
|
85
|
+
min: TlvField(1, TlvInt64.bound({ min: -(2 ** 62), max: 2 ** 62 })),
|
|
86
86
|
/**
|
|
87
87
|
* This field shall be the largest measured value for the associated measurement over the period between either
|
|
88
88
|
* StartTimestamp and EndTimestamp or the period between StartSystime and EndSystime, or both.
|
|
89
89
|
*
|
|
90
90
|
* @see {@link MatterSpecification.v13.Cluster} § 2.13.5.2.3
|
|
91
91
|
*/
|
|
92
|
-
max: TlvField(2, TlvInt64.bound({ min: -
|
|
92
|
+
max: TlvField(2, TlvInt64.bound({ min: -(2 ** 62), max: 2 ** 62 })),
|
|
93
93
|
/**
|
|
94
94
|
* This field shall be the timestamp in UTC of the beginning of the measurement period.
|
|
95
95
|
*
|
|
@@ -199,7 +199,7 @@ export var ElectricalPowerMeasurement;
|
|
|
199
199
|
*
|
|
200
200
|
* @see {@link MatterSpecification.v13.Cluster} § 2.13.6.7
|
|
201
201
|
*/
|
|
202
|
-
reactiveCurrent: OptionalAttribute(0x6, TlvNullable(TlvInt64.bound({ min: -
|
|
202
|
+
reactiveCurrent: OptionalAttribute(0x6, TlvNullable(TlvInt64.bound({ min: -(2 ** 62), max: 2 ** 62 })), { default: null }),
|
|
203
203
|
/**
|
|
204
204
|
* This shall indicate the most recent ApparentCurrent (square root sum of the squares of active and
|
|
205
205
|
* reactive currents) reading in milliamps (mA).
|
|
@@ -217,7 +217,7 @@ export var ElectricalPowerMeasurement;
|
|
|
217
217
|
*
|
|
218
218
|
* @see {@link MatterSpecification.v13.Cluster} § 2.13.6.8
|
|
219
219
|
*/
|
|
220
|
-
apparentCurrent: OptionalAttribute(0x7, TlvNullable(TlvInt64.bound({ min: 0, max:
|
|
220
|
+
apparentCurrent: OptionalAttribute(0x7, TlvNullable(TlvInt64.bound({ min: 0, max: 2 ** 62 })), { default: null }),
|
|
221
221
|
/**
|
|
222
222
|
* This shall indicate the most recent ReactivePower reading in millivolt-amps reactive (mVAR). A positive
|
|
223
223
|
* value represents power imported, while a negative value represents power exported.
|
|
@@ -238,7 +238,7 @@ export var ElectricalPowerMeasurement;
|
|
|
238
238
|
*
|
|
239
239
|
* @see {@link MatterSpecification.v13.Cluster} § 2.13.6.10
|
|
240
240
|
*/
|
|
241
|
-
reactivePower: OptionalAttribute(0x9, TlvNullable(TlvInt64.bound({ min: -
|
|
241
|
+
reactivePower: OptionalAttribute(0x9, TlvNullable(TlvInt64.bound({ min: -(2 ** 62), max: 2 ** 62 })), { default: null }),
|
|
242
242
|
/**
|
|
243
243
|
* This shall indicate the most recent ApparentPower reading in millivolt-amps (mVA).
|
|
244
244
|
*
|
|
@@ -257,7 +257,7 @@ export var ElectricalPowerMeasurement;
|
|
|
257
257
|
*
|
|
258
258
|
* @see {@link MatterSpecification.v13.Cluster} § 2.13.6.11
|
|
259
259
|
*/
|
|
260
|
-
apparentPower: OptionalAttribute(0xa, TlvNullable(TlvInt64.bound({ min: -
|
|
260
|
+
apparentPower: OptionalAttribute(0xa, TlvNullable(TlvInt64.bound({ min: -(2 ** 62), max: 2 ** 62 })), { default: null }),
|
|
261
261
|
/**
|
|
262
262
|
* This shall indicate the most recent RMSVoltage reading in millivolts (mV).
|
|
263
263
|
*
|
|
@@ -274,7 +274,7 @@ export var ElectricalPowerMeasurement;
|
|
|
274
274
|
*
|
|
275
275
|
* @see {@link MatterSpecification.v13.Cluster} § 2.13.6.12
|
|
276
276
|
*/
|
|
277
|
-
rmsVoltage: OptionalAttribute(0xb, TlvNullable(TlvInt64.bound({ min: -
|
|
277
|
+
rmsVoltage: OptionalAttribute(0xb, TlvNullable(TlvInt64.bound({ min: -(2 ** 62), max: 2 ** 62 })), { default: null }),
|
|
278
278
|
/**
|
|
279
279
|
* This shall indicate the most recent RMSCurrent reading in milliamps (mA).
|
|
280
280
|
*
|
|
@@ -294,7 +294,7 @@ export var ElectricalPowerMeasurement;
|
|
|
294
294
|
*
|
|
295
295
|
* @see {@link MatterSpecification.v13.Cluster} § 2.13.6.13
|
|
296
296
|
*/
|
|
297
|
-
rmsCurrent: OptionalAttribute(0xc, TlvNullable(TlvInt64.bound({ min: -
|
|
297
|
+
rmsCurrent: OptionalAttribute(0xc, TlvNullable(TlvInt64.bound({ min: -(2 ** 62), max: 2 ** 62 })), { default: null }),
|
|
298
298
|
/**
|
|
299
299
|
* This shall indicate the most recent RMSPower reading in milliwatts (mW).
|
|
300
300
|
*
|
|
@@ -313,7 +313,7 @@ export var ElectricalPowerMeasurement;
|
|
|
313
313
|
*
|
|
314
314
|
* @see {@link MatterSpecification.v13.Cluster} § 2.13.6.14
|
|
315
315
|
*/
|
|
316
|
-
rmsPower: OptionalAttribute(0xd, TlvNullable(TlvInt64.bound({ min: -
|
|
316
|
+
rmsPower: OptionalAttribute(0xd, TlvNullable(TlvInt64.bound({ min: -(2 ** 62), max: 2 ** 62 })), { default: null }),
|
|
317
317
|
/**
|
|
318
318
|
* This shall indicate the most recent Frequency reading in millihertz (mHz).
|
|
319
319
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElectricalPowerMeasurementCluster.js","sourceRoot":"","sources":["../../src/cluster/ElectricalPowerMeasurementCluster.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACxI,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,qCAAqC,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAkB,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAEtL,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,MAAM,KAAW,0BAA0B,CA8vB1C;AA9vBD,WAAiB,0BAA0B;IACzC;;OAEG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AAE,cAAc,CAAC,aAAa,CAAC,2BAAA,2BAA2B,CAAC,UAAU,CAAC,WAAW,EAAE,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YACrH,cAAc,EAAE,cAAc,CAAC,aAAa,CAAC,2BAAA,uBAAuB,CAAC,UAAU,CAAC,cAAc,EAAE,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;SACxH;QAED,MAAM,EAAE,2BAAA,IAAI,CAAC,MAAM;KACpB,CAAC,CAAC;IAUU,mCAAQ,GAAa,2BAAA,gBAAgB,CAAC;AACrD,CAAC,EA9vBgB,0BAA0B,KAA1B,0BAA0B,QA8vB1C;AAGD,MAAM,CAAC,MAAM,iCAAiC,GAAG,0BAA0B,CAAC,OAAO,CAAC;AACpF,eAAe,CAAC,QAAQ,CAAC,0BAA0B,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/logger/export.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../src/logger/export.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
package/dist/matterbridge.d.ts
CHANGED
|
@@ -122,6 +122,8 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
122
122
|
private nodeContext;
|
|
123
123
|
private expressApp;
|
|
124
124
|
private expressServer;
|
|
125
|
+
private httpServer;
|
|
126
|
+
private httpsServer;
|
|
125
127
|
private webSocketServer;
|
|
126
128
|
private storageManager;
|
|
127
129
|
private matterbridgeContext;
|
|
@@ -509,7 +511,6 @@ export declare class Matterbridge extends EventEmitter {
|
|
|
509
511
|
* @param port The port number to run the frontend server on. Default is 3000.
|
|
510
512
|
*/
|
|
511
513
|
initializeFrontend(port?: number): Promise<void>;
|
|
512
|
-
initializeHttpsFrontend(port?: number): Promise<void>;
|
|
513
514
|
/**
|
|
514
515
|
* Retrieves the cluster text from a given device.
|
|
515
516
|
* @param device - The MatterbridgeDevice object.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matterbridge.d.ts","sourceRoot":"","sources":["../src/matterbridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAsB,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"matterbridge.d.ts","sourceRoot":"","sources":["../src/matterbridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAsB,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAQvE,OAAO,YAAY,MAAM,QAAQ,CAAC;AAOlC,OAAO,EAAE,kBAAkB,EAAgC,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAMjG,OAAO,EAA2B,mBAAmB,EAA0C,MAAM,8BAA8B,CAAC;AAGpI,OAAO,EAAE,UAAU,EAA+C,MAAM,qCAAqC,CAAC;AAG9G,OAAO,EAA8C,cAAc,EAAkB,MAAM,sCAAsC,CAAC;AAIlI,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAG/E,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;IAC5D,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CACjC;AAGD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,E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;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IAmBhC;;;;;OAKG;YACW,YAAY;IA0E1B;;;;;;OAMG;IACH,OAAO,CAAC,cAAc;IActB;;;;OAIG;IACG,kBAAkB,CAAC,IAAI,SAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAkjBpD;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;CAkCjC"}
|
package/dist/matterbridge.js
CHANGED
|
@@ -25,6 +25,7 @@ import { AnsiLogger, BRIGHT, RESET, UNDERLINE, UNDERLINEOFF, YELLOW, db, debugSt
|
|
|
25
25
|
import { fileURLToPath, pathToFileURL } from 'url';
|
|
26
26
|
import { promises as fs } from 'fs';
|
|
27
27
|
import { exec, spawn } from 'child_process';
|
|
28
|
+
import { createServer } from 'http';
|
|
28
29
|
import https from 'https';
|
|
29
30
|
import EventEmitter from 'events';
|
|
30
31
|
import express from 'express';
|
|
@@ -110,6 +111,8 @@ export class Matterbridge extends EventEmitter {
|
|
|
110
111
|
nodeContext;
|
|
111
112
|
expressApp;
|
|
112
113
|
expressServer;
|
|
114
|
+
httpServer;
|
|
115
|
+
httpsServer;
|
|
113
116
|
webSocketServer;
|
|
114
117
|
storageManager;
|
|
115
118
|
matterbridgeContext;
|
|
@@ -265,6 +268,9 @@ export class Matterbridge extends EventEmitter {
|
|
|
265
268
|
- reset: remove the commissioning for Matterbridge (bridge mode). Shutdown Matterbridge before using it!
|
|
266
269
|
- factoryreset: remove all commissioning information and reset all internal storages. Shutdown Matterbridge before using it!
|
|
267
270
|
- list: list the registered plugins
|
|
271
|
+
- loginterfaces: log the network interfaces
|
|
272
|
+
- logstorage: log the node storage
|
|
273
|
+
- ssl: enable SSL for the frontend and WebSockerServer (certificates in .matterbridge/certs directory cert.pem, key.pem and ca.pem (optional))
|
|
268
274
|
- add [plugin path]: register the plugin from the given absolute or relative path
|
|
269
275
|
- add [plugin name]: register the globally installed plugin with the given name
|
|
270
276
|
- remove [plugin path]: remove the plugin from the given absolute or relative path
|
|
@@ -794,7 +800,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
794
800
|
this.log.debug('All listeners removed');
|
|
795
801
|
this.checkUpdateInterval && clearInterval(this.checkUpdateInterval);
|
|
796
802
|
this.checkUpdateInterval = undefined;
|
|
797
|
-
// Calling the shutdown
|
|
803
|
+
// Calling the shutdown method of each plugin
|
|
798
804
|
for (const plugin of this.registeredPlugins) {
|
|
799
805
|
if (!plugin.enabled || plugin.error)
|
|
800
806
|
continue;
|
|
@@ -853,14 +859,29 @@ export class Matterbridge extends EventEmitter {
|
|
|
853
859
|
// Close the express server
|
|
854
860
|
if (this.expressServer) {
|
|
855
861
|
this.expressServer.close();
|
|
862
|
+
this.expressServer.removeAllListeners();
|
|
856
863
|
this.expressServer = undefined;
|
|
857
864
|
this.log.debug('Express server closed successfully');
|
|
858
865
|
}
|
|
859
|
-
//
|
|
866
|
+
// Close the http server
|
|
867
|
+
if (this.httpServer) {
|
|
868
|
+
this.httpServer.close();
|
|
869
|
+
this.httpServer.removeAllListeners();
|
|
870
|
+
this.httpServer = undefined;
|
|
871
|
+
this.log.debug('Frontend http server closed successfully');
|
|
872
|
+
}
|
|
873
|
+
// Close the https server
|
|
874
|
+
if (this.httpsServer) {
|
|
875
|
+
this.httpsServer.close();
|
|
876
|
+
this.httpsServer.removeAllListeners();
|
|
877
|
+
this.httpsServer = undefined;
|
|
878
|
+
this.log.debug('Frontend https server closed successfully');
|
|
879
|
+
}
|
|
880
|
+
// Remove listeners from the express app
|
|
860
881
|
if (this.expressApp) {
|
|
861
882
|
this.expressApp.removeAllListeners();
|
|
862
883
|
this.expressApp = undefined;
|
|
863
|
-
this.log.debug('Frontend closed successfully');
|
|
884
|
+
this.log.debug('Frontend app closed successfully');
|
|
864
885
|
}
|
|
865
886
|
// Close the WebSocket server
|
|
866
887
|
if (this.webSocketServer) {
|
|
@@ -2269,26 +2290,29 @@ export class Matterbridge extends EventEmitter {
|
|
|
2269
2290
|
async logNodeAndSystemInfo() {
|
|
2270
2291
|
// IP address information
|
|
2271
2292
|
const networkInterfaces = os.networkInterfaces();
|
|
2272
|
-
this.systemInformation.ipv4Address = '
|
|
2273
|
-
this.systemInformation.ipv6Address = '
|
|
2293
|
+
this.systemInformation.ipv4Address = '';
|
|
2294
|
+
this.systemInformation.ipv6Address = '';
|
|
2274
2295
|
for (const [interfaceName, interfaceDetails] of Object.entries(networkInterfaces)) {
|
|
2275
2296
|
if (!interfaceDetails) {
|
|
2276
2297
|
break;
|
|
2277
2298
|
}
|
|
2278
2299
|
for (const detail of interfaceDetails) {
|
|
2279
|
-
if (detail.family === 'IPv4' && !detail.internal && this.systemInformation.ipv4Address === '
|
|
2300
|
+
if (detail.family === 'IPv4' && !detail.internal && this.systemInformation.ipv4Address === '') {
|
|
2280
2301
|
this.systemInformation.interfaceName = interfaceName;
|
|
2281
2302
|
this.systemInformation.ipv4Address = detail.address;
|
|
2282
2303
|
this.systemInformation.macAddress = detail.mac;
|
|
2283
2304
|
}
|
|
2284
|
-
else if (detail.family === 'IPv6' && !detail.internal && this.systemInformation.ipv6Address === '
|
|
2305
|
+
else if (detail.family === 'IPv6' && !detail.internal && this.systemInformation.ipv6Address === '') {
|
|
2285
2306
|
this.systemInformation.interfaceName = interfaceName;
|
|
2286
2307
|
this.systemInformation.ipv6Address = detail.address;
|
|
2287
2308
|
this.systemInformation.macAddress = detail.mac;
|
|
2288
2309
|
}
|
|
2289
2310
|
}
|
|
2290
|
-
|
|
2291
|
-
|
|
2311
|
+
if (this.systemInformation.ipv4Address !== '' /* && this.systemInformation.ipv6Address !== ''*/) {
|
|
2312
|
+
this.log.debug(`Using interface: '${this.systemInformation.interfaceName}'`);
|
|
2313
|
+
this.log.debug(`- with MAC address: '${this.systemInformation.macAddress}'`);
|
|
2314
|
+
this.log.debug(`- with IPv4 address: '${this.systemInformation.ipv4Address}'`);
|
|
2315
|
+
this.log.debug(`- with IPv6 address: '${this.systemInformation.ipv6Address}'`);
|
|
2292
2316
|
break;
|
|
2293
2317
|
}
|
|
2294
2318
|
}
|
|
@@ -2627,64 +2651,156 @@ export class Matterbridge extends EventEmitter {
|
|
|
2627
2651
|
* @param port The port number to run the frontend server on. Default is 3000.
|
|
2628
2652
|
*/
|
|
2629
2653
|
async initializeFrontend(port = 8283) {
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2654
|
+
this.log.debug(`Initializing the frontend ${hasParameter('ssl') ? 'https' : 'http'} server on port ${YELLOW}${port}${db}`);
|
|
2655
|
+
// Create the express app that serves the frontend
|
|
2656
|
+
this.expressApp = express();
|
|
2657
|
+
this.expressApp.use(express.static(path.join(this.rootDirectory, 'frontend/build')));
|
|
2658
|
+
if (!hasParameter('ssl')) {
|
|
2659
|
+
// Create an HTTP server and attach the express app
|
|
2660
|
+
this.httpServer = createServer(this.expressApp);
|
|
2661
|
+
// Listen on the specified port
|
|
2662
|
+
this.httpServer.listen(port, () => {
|
|
2663
|
+
if (this.systemInformation.ipv4Address !== '')
|
|
2664
|
+
this.log.info(`The frontend http server is listening on ${UNDERLINE}http://${this.systemInformation.ipv4Address}:${port}${UNDERLINEOFF}${rs}`);
|
|
2665
|
+
if (this.systemInformation.ipv6Address !== '')
|
|
2666
|
+
this.log.debug(`The frontend http server is listening on ${UNDERLINE}http://[${this.systemInformation.ipv6Address}]:${port}${UNDERLINEOFF}${rs}`);
|
|
2667
|
+
});
|
|
2668
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2669
|
+
this.httpServer.on('error', (error) => {
|
|
2670
|
+
this.log.error(`Frontend http server error listening on ${port}`);
|
|
2671
|
+
switch (error.code) {
|
|
2672
|
+
case 'EACCES':
|
|
2673
|
+
this.log.error(`Port ${port} requires elevated privileges`);
|
|
2674
|
+
break;
|
|
2675
|
+
case 'EADDRINUSE':
|
|
2676
|
+
this.log.error(`Port ${port} is already in use`);
|
|
2677
|
+
break;
|
|
2678
|
+
}
|
|
2679
|
+
process.exit(1);
|
|
2680
|
+
});
|
|
2633
2681
|
}
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2682
|
+
else {
|
|
2683
|
+
// Load the SSL certificate, the private key and optionally the CA certificate
|
|
2684
|
+
let cert;
|
|
2685
|
+
try {
|
|
2686
|
+
cert = await fs.readFile(path.join(this.matterbridgeDirectory, 'certs/cert.pem'), 'utf8');
|
|
2687
|
+
this.log.info(`Loaded certificate file ${path.join(this.matterbridgeDirectory, 'certs/cert.pem')}`);
|
|
2688
|
+
}
|
|
2689
|
+
catch (error) {
|
|
2690
|
+
this.log.error(`Error reading certificate file: ${error}`);
|
|
2691
|
+
process.exit(1);
|
|
2692
|
+
}
|
|
2693
|
+
let key;
|
|
2694
|
+
try {
|
|
2695
|
+
key = await fs.readFile(path.join(this.matterbridgeDirectory, 'certs/key.pem'), 'utf8');
|
|
2696
|
+
this.log.info(`Loaded key file ${path.join(this.matterbridgeDirectory, 'certs/key.pem')}`);
|
|
2697
|
+
}
|
|
2698
|
+
catch (error) {
|
|
2699
|
+
this.log.error(`Error reading key file: ${error}`);
|
|
2700
|
+
process.exit(1);
|
|
2701
|
+
}
|
|
2702
|
+
let ca;
|
|
2703
|
+
try {
|
|
2704
|
+
ca = await fs.readFile(path.join(this.matterbridgeDirectory, 'certs/ca.pem'), 'utf8');
|
|
2705
|
+
this.log.info(`Loaded CA certificate file ${path.join(this.matterbridgeDirectory, 'certs/ca.pem')}`);
|
|
2706
|
+
}
|
|
2707
|
+
catch (error) {
|
|
2708
|
+
this.log.info(`CA certificate file ${path.join(this.matterbridgeDirectory, 'certs/ca.pem')} not loaded: ${error}`);
|
|
2709
|
+
}
|
|
2710
|
+
const serverOptions = { cert, key, ca };
|
|
2711
|
+
// Create an HTTPS server with the SSL certificate and private key (ca is optional) and attach the express app
|
|
2712
|
+
this.httpsServer = https.createServer(serverOptions, this.expressApp);
|
|
2713
|
+
// Listen on the specified port
|
|
2714
|
+
this.httpsServer.listen(port, () => {
|
|
2715
|
+
if (this.systemInformation.ipv4Address !== '')
|
|
2716
|
+
this.log.info(`The frontend https server is listening on ${UNDERLINE}https://${this.systemInformation.ipv4Address}:${port}${UNDERLINEOFF}${rs}`);
|
|
2717
|
+
if (this.systemInformation.ipv6Address !== '')
|
|
2718
|
+
this.log.debug(`The frontend https server is listening on ${UNDERLINE}https://[${this.systemInformation.ipv6Address}]:${port}${UNDERLINEOFF}${rs}`);
|
|
2719
|
+
});
|
|
2720
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2721
|
+
this.httpsServer.on('error', (error) => {
|
|
2722
|
+
this.log.error(`Frontend https server error listening on ${port}`);
|
|
2723
|
+
switch (error.code) {
|
|
2724
|
+
case 'EACCES':
|
|
2725
|
+
this.log.error(`Port ${port} requires elevated privileges`);
|
|
2726
|
+
break;
|
|
2727
|
+
case 'EADDRINUSE':
|
|
2728
|
+
this.log.error(`Port ${port} is already in use`);
|
|
2729
|
+
break;
|
|
2730
|
+
}
|
|
2731
|
+
process.exit(1);
|
|
2732
|
+
});
|
|
2733
|
+
}
|
|
2734
|
+
// Createe a WebSocket server and attach it to the http server
|
|
2735
|
+
const wssPort = port;
|
|
2736
|
+
const wssHost = hasParameter('ssl') ? `wss://${this.systemInformation.ipv4Address}:${wssPort}` : `ws://${this.systemInformation.ipv4Address}:${wssPort}`;
|
|
2737
|
+
this.webSocketServer = new WebSocketServer(hasParameter('ssl') ? { server: this.httpsServer } : { server: this.httpServer });
|
|
2738
|
+
this.webSocketServer.on('connection', (ws, request) => {
|
|
2739
|
+
const clientIp = request.socket.remoteAddress;
|
|
2740
|
+
this.log.info(`WebSocketServer client ${clientIp} connected`);
|
|
2642
2741
|
this.log.setGlobalCallback(this.wssSendMessage.bind(this));
|
|
2643
2742
|
this.log.debug('WebSocketServer logger callback added');
|
|
2644
2743
|
this.wssSendMessage('Matterbridge', 'info', 'WebSocketServer client connected to Matterbridge');
|
|
2645
2744
|
ws.on('message', (message) => {
|
|
2646
|
-
this.log.
|
|
2745
|
+
this.log.debug(`WebSocket client message: ${message}`);
|
|
2647
2746
|
});
|
|
2648
2747
|
ws.on('close', () => {
|
|
2649
2748
|
this.log.info('WebSocket client disconnected');
|
|
2650
2749
|
if (this.webSocketServer?.clients.size === 0) {
|
|
2651
2750
|
this.log.setGlobalCallback(undefined);
|
|
2652
|
-
this.log.debug('All WebSocket
|
|
2751
|
+
this.log.debug('All WebSocket clients disconnected. WebSocketServer logger callback removed');
|
|
2653
2752
|
}
|
|
2654
2753
|
});
|
|
2655
2754
|
ws.on('error', (error) => {
|
|
2656
2755
|
this.log.error(`WebSocket client error: ${error}`);
|
|
2657
2756
|
});
|
|
2658
2757
|
});
|
|
2758
|
+
this.webSocketServer.on('close', () => {
|
|
2759
|
+
this.log.debug(`WebSocketServer closed`);
|
|
2760
|
+
});
|
|
2761
|
+
this.webSocketServer.on('listening', () => {
|
|
2762
|
+
this.log.info(`The WebSocketServer is listening on ${UNDERLINE}${wssHost}${UNDERLINEOFF}${rs}`);
|
|
2763
|
+
});
|
|
2659
2764
|
this.webSocketServer.on('error', (ws, error) => {
|
|
2660
2765
|
this.log.error(`WebSocketServer error: ${error}`);
|
|
2661
|
-
return;
|
|
2662
2766
|
});
|
|
2767
|
+
/*
|
|
2768
|
+
// Create a WebSocket server
|
|
2769
|
+
const wssPort = 8284;
|
|
2770
|
+
const wssHost = `ws://${this.systemInformation.ipv4Address}:${wssPort}`;
|
|
2771
|
+
this.webSocketServer = new WebSocketServer({ port: wssPort, host: this.systemInformation.ipv4Address });
|
|
2772
|
+
this.log.debug(`WebSocket server created on ${UNDERLINE}${wssHost}${UNDERLINEOFF}${rs}`);
|
|
2773
|
+
|
|
2663
2774
|
this.webSocketServer.on('listening', () => {
|
|
2664
|
-
|
|
2665
|
-
|
|
2775
|
+
this.log.info(`WebSocketServer is listening on ${UNDERLINE}${wssHost}${UNDERLINEOFF}${rs}`);
|
|
2776
|
+
return;
|
|
2666
2777
|
});
|
|
2778
|
+
*/
|
|
2779
|
+
/*
|
|
2667
2780
|
// Serve React build directory
|
|
2668
2781
|
this.expressApp = express();
|
|
2669
2782
|
this.expressApp.use(express.static(path.join(this.rootDirectory, 'frontend/build')));
|
|
2783
|
+
|
|
2670
2784
|
// Listen on HTTP
|
|
2671
2785
|
this.expressServer = this.expressApp.listen(port, () => {
|
|
2672
|
-
|
|
2673
|
-
|
|
2786
|
+
this.log.info(`The frontend is listening on ${UNDERLINE}http://${this.systemInformation.ipv4Address}:${port}${UNDERLINEOFF}${rs}`);
|
|
2787
|
+
this.log.debug(`The frontend is listening on ${UNDERLINE}http://[${this.systemInformation.ipv6Address}]:${port}${UNDERLINEOFF}${rs}`);
|
|
2674
2788
|
});
|
|
2789
|
+
|
|
2675
2790
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2676
|
-
this.expressServer.on('error', (error) => {
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2791
|
+
this.expressServer.on('error', (error: any) => {
|
|
2792
|
+
this.log.error(`Frontend error listening on ${UNDERLINE}http://${this.systemInformation.ipv4Address}:${port}${UNDERLINEOFF}${rs}`);
|
|
2793
|
+
switch (error.code) {
|
|
2794
|
+
case 'EACCES':
|
|
2795
|
+
this.log.error(`Port ${port} requires elevated privileges`);
|
|
2796
|
+
break;
|
|
2797
|
+
case 'EADDRINUSE':
|
|
2798
|
+
this.log.error(`Port ${port} is already in use`);
|
|
2799
|
+
break;
|
|
2800
|
+
}
|
|
2801
|
+
process.exit(1);
|
|
2687
2802
|
});
|
|
2803
|
+
*/
|
|
2688
2804
|
// Endpoint to validate login code
|
|
2689
2805
|
this.expressApp.post('/api/login', express.json(), async (req, res) => {
|
|
2690
2806
|
const { password } = req.body;
|
|
@@ -3094,68 +3210,14 @@ export class Matterbridge extends EventEmitter {
|
|
|
3094
3210
|
}
|
|
3095
3211
|
res.json({ message: 'Command received' });
|
|
3096
3212
|
});
|
|
3097
|
-
// Fallback for routing (must be the last route)
|
|
3213
|
+
// Fallback for routing (must be the last route but it should not be used because the frontend is static)
|
|
3098
3214
|
this.expressApp.get('*', (req, res) => {
|
|
3099
|
-
this.log.
|
|
3100
|
-
this.log.
|
|
3215
|
+
this.log.warn('The frontend sent:', req.url);
|
|
3216
|
+
this.log.warn('Response send file:', path.join(this.rootDirectory, 'frontend/build/index.html'));
|
|
3101
3217
|
res.sendFile(path.join(this.rootDirectory, 'frontend/build/index.html'));
|
|
3102
3218
|
});
|
|
3103
3219
|
this.log.debug(`Frontend initialized on port ${YELLOW}${port}${db} static ${UNDERLINE}${path.join(this.rootDirectory, 'frontend/build')}${UNDERLINEOFF}${rs}`);
|
|
3104
3220
|
}
|
|
3105
|
-
// Just for testing purposes. Use with matterbridge -test_https so no bridge is loaded
|
|
3106
|
-
async initializeHttpsFrontend(port = 8443) {
|
|
3107
|
-
this.log.debug(`Initializing the https frontend on port ${YELLOW}${port}${db} static ${UNDERLINE}${path.join(this.rootDirectory, 'frontend/build')}${UNDERLINEOFF}${rs}`);
|
|
3108
|
-
// Create the express app that serves the frontend
|
|
3109
|
-
this.expressApp = express();
|
|
3110
|
-
// Load the SSL certificate and private key
|
|
3111
|
-
// If we need also the CA certificate, we can add it to the serverOptions object
|
|
3112
|
-
// I created dev certificates with openssl using the following commands:
|
|
3113
|
-
// openssl genrsa -out key.pem 2048
|
|
3114
|
-
// openssl req -new -key key.pem -out csr.pem
|
|
3115
|
-
// openssl x509 -req -days 365 -in csr.pem -signkey key.pem -out cert.pem
|
|
3116
|
-
const serverOptions = {
|
|
3117
|
-
cert: await fs.readFile(path.join(this.matterbridgeDirectory, 'certs/cert.pem'), 'utf8'),
|
|
3118
|
-
key: await fs.readFile(path.join(this.matterbridgeDirectory, 'certs/key.pem'), 'utf8'),
|
|
3119
|
-
// ca: await fs.readFile(path.join(this.matterbridgeDirectory, 'certs/ca.pem'), 'utf8'),
|
|
3120
|
-
};
|
|
3121
|
-
// Create an HTTPS server with the SSL certificate and private key and attach the express app
|
|
3122
|
-
const httpsServer = https.createServer(serverOptions, this.expressApp);
|
|
3123
|
-
// Fallback for routing
|
|
3124
|
-
this.expressApp.get('/', (req, res) => {
|
|
3125
|
-
this.log.debug('The frontend sent:', req.url);
|
|
3126
|
-
res.send('Hello, HTTPS!');
|
|
3127
|
-
});
|
|
3128
|
-
// Listen on a specific port
|
|
3129
|
-
// Connect to the frontend with 'https://localhost:8443'
|
|
3130
|
-
httpsServer.listen(port, () => {
|
|
3131
|
-
this.log.info(`HTTPS server listening on ${UNDERLINE}'https://localhost:${port}${UNDERLINEOFF}${rs}`);
|
|
3132
|
-
});
|
|
3133
|
-
// Attach WebSocket server to HTTPS server
|
|
3134
|
-
this.webSocketServer = new WebSocketServer({ server: httpsServer });
|
|
3135
|
-
this.log.info(`WebSocketServer runnig on ${UNDERLINE}wss://localhost:${port}${UNDERLINEOFF}${rs}`);
|
|
3136
|
-
// Handle connections to the WebSocketServer
|
|
3137
|
-
// Connect to the WebSocket server using wss from the react frontend this way: const ws = new WebSocket('wss://localhost:8443');
|
|
3138
|
-
this.webSocketServer.on('connection', (ws) => {
|
|
3139
|
-
this.log.info('WebSocketServer: WebSocket client connected');
|
|
3140
|
-
ws.on('message', (message) => {
|
|
3141
|
-
this.log.info(`WebSocket client sent message => ${message}`);
|
|
3142
|
-
});
|
|
3143
|
-
ws.on('close', () => {
|
|
3144
|
-
this.log.info('WebSocket client disconnected');
|
|
3145
|
-
if (this.webSocketServer?.clients.size === 0) {
|
|
3146
|
-
this.log.info('All WebSocket clients disconnected');
|
|
3147
|
-
}
|
|
3148
|
-
});
|
|
3149
|
-
ws.on('error', (error) => {
|
|
3150
|
-
this.log.error(`WebSocket client error: ${error}`);
|
|
3151
|
-
});
|
|
3152
|
-
});
|
|
3153
|
-
// Handle error from the WebSocketServer
|
|
3154
|
-
this.webSocketServer.on('error', (ws, error) => {
|
|
3155
|
-
this.log.error(`WebSocketServer error: ${error}`);
|
|
3156
|
-
return;
|
|
3157
|
-
});
|
|
3158
|
-
}
|
|
3159
3221
|
/**
|
|
3160
3222
|
* Retrieves the cluster text from a given device.
|
|
3161
3223
|
* @param device - The MatterbridgeDevice object.
|