@matterbridge/core 3.7.5 → 3.7.6-dev-20260427-575abf6
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/backendExpress.js +1 -1
- package/dist/backendWsServer.js +1 -1
- package/dist/cli.js +2 -2
- package/dist/frontend.js +3 -3
- package/dist/jestutils/jestMatterTest.js +6 -6
- package/dist/jestutils/jestMatterbridgeTest.js +3 -3
- package/dist/matterbridge.d.ts +1 -0
- package/dist/matterbridge.js +22 -11
- package/dist/mb_mdns.js +32 -32
- package/package.json +6 -6
package/dist/backendExpress.js
CHANGED
|
@@ -121,7 +121,7 @@ export class BackendExpress {
|
|
|
121
121
|
}));
|
|
122
122
|
const { createRequire } = await import('node:module');
|
|
123
123
|
const require = createRequire(import.meta.url);
|
|
124
|
-
const cjsModules = Object.keys(require.cache).
|
|
124
|
+
const cjsModules = Object.keys(require.cache).toSorted();
|
|
125
125
|
const memoryReport = {
|
|
126
126
|
memoryUsage,
|
|
127
127
|
heapStats,
|
package/dist/backendWsServer.js
CHANGED
|
@@ -34,7 +34,7 @@ export class BackendsWsServer {
|
|
|
34
34
|
this.server.off('broadcast_message', this.broadcastMsgHandler.bind(this));
|
|
35
35
|
this.server.close();
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
broadcastMsgHandler(msg) {
|
|
38
38
|
if (this.server.isWorkerRequest(msg)) {
|
|
39
39
|
switch (msg.type) {
|
|
40
40
|
case 'get_log_level':
|
package/dist/cli.js
CHANGED
|
@@ -100,7 +100,7 @@ async function main() {
|
|
|
100
100
|
instance = await Matterbridge.loadInstance(true);
|
|
101
101
|
log.debug(`***Matterbridge.loadInstance(true) exited`);
|
|
102
102
|
if (!instance || instance.shutdown) {
|
|
103
|
-
shutdown();
|
|
103
|
+
await shutdown();
|
|
104
104
|
}
|
|
105
105
|
else {
|
|
106
106
|
registerHandlers();
|
|
@@ -114,7 +114,7 @@ if (hasAnyParameter('version', 'v'))
|
|
|
114
114
|
await version();
|
|
115
115
|
main().catch((error) => {
|
|
116
116
|
inspectError(log, 'Matterbridge.loadInstance() failed with error', error);
|
|
117
|
-
shutdown();
|
|
117
|
+
shutdown().catch(() => process.exit(1));
|
|
118
118
|
});
|
|
119
119
|
async function version() {
|
|
120
120
|
const { default: pkg } = await import('../package.json', { with: { type: 'json' } });
|
package/dist/frontend.js
CHANGED
|
@@ -493,7 +493,7 @@ export class Frontend extends EventEmitter {
|
|
|
493
493
|
}));
|
|
494
494
|
const { createRequire } = await import('node:module');
|
|
495
495
|
const require = createRequire(import.meta.url);
|
|
496
|
-
const cjsModules = Object.keys(require.cache).
|
|
496
|
+
const cjsModules = Object.keys(require.cache).toSorted();
|
|
497
497
|
const memoryReport = {
|
|
498
498
|
memoryUsage,
|
|
499
499
|
heapStats,
|
|
@@ -1639,7 +1639,7 @@ export class Frontend extends EventEmitter {
|
|
|
1639
1639
|
sendResponse({ id: data.id, method: data.method, src: 'Matterbridge', dst: data.src, error: 'Plugin not found in /api/select/devices' });
|
|
1640
1640
|
return;
|
|
1641
1641
|
}
|
|
1642
|
-
const selectDeviceValues = !plugin.platform ? [] : plugin.platform.getSelectDevices().
|
|
1642
|
+
const selectDeviceValues = !plugin.platform ? [] : plugin.platform.getSelectDevices().toSorted((keyA, keyB) => keyA.name.localeCompare(keyB.name));
|
|
1643
1643
|
sendResponse({ id: data.id, method: data.method, src: 'Matterbridge', dst: data.src, success: true, response: selectDeviceValues });
|
|
1644
1644
|
}
|
|
1645
1645
|
else if (data.method === '/api/select/entities') {
|
|
@@ -1652,7 +1652,7 @@ export class Frontend extends EventEmitter {
|
|
|
1652
1652
|
sendResponse({ id: data.id, method: data.method, src: 'Matterbridge', dst: data.src, error: 'Plugin not found in /api/select/entities' });
|
|
1653
1653
|
return;
|
|
1654
1654
|
}
|
|
1655
|
-
const selectEntityValues = !plugin.platform ? [] : plugin.platform.getSelectEntities().
|
|
1655
|
+
const selectEntityValues = !plugin.platform ? [] : plugin.platform.getSelectEntities().toSorted((keyA, keyB) => keyA.name.localeCompare(keyB.name));
|
|
1656
1656
|
sendResponse({ id: data.id, method: data.method, src: 'Matterbridge', dst: data.src, success: true, response: selectEntityValues });
|
|
1657
1657
|
}
|
|
1658
1658
|
else if (data.method === '/api/action') {
|
|
@@ -57,10 +57,10 @@ export function getPlatformMatterbridge() {
|
|
|
57
57
|
matterbridgePluginDirectory: path.join(HOMEDIR, 'Matterbridge'),
|
|
58
58
|
matterbridgeCertDirectory: path.join(HOMEDIR, '.mattercert'),
|
|
59
59
|
globalModulesDirectory: path.join(HOMEDIR, 'node_modules'),
|
|
60
|
-
matterbridgeVersion: '3.7.
|
|
61
|
-
matterbridgeLatestVersion: '3.7.
|
|
62
|
-
matterbridgeDevVersion: '3.7.
|
|
63
|
-
frontendVersion: '3.7.
|
|
60
|
+
matterbridgeVersion: '3.7.6',
|
|
61
|
+
matterbridgeLatestVersion: '3.7.6',
|
|
62
|
+
matterbridgeDevVersion: '3.7.6',
|
|
63
|
+
frontendVersion: '3.7.6',
|
|
64
64
|
bridgeMode: '',
|
|
65
65
|
restartMode: '',
|
|
66
66
|
virtualMode: 'mounted_switch',
|
|
@@ -180,11 +180,11 @@ export async function startServerNode(ticks = 1, microTurns = 1, pause = 10) {
|
|
|
180
180
|
if (!server || !aggregator) {
|
|
181
181
|
throw new Error('Server node and aggregator must be created before starting the server. Call createServerNode() first.');
|
|
182
182
|
}
|
|
183
|
-
await new Promise((resolve) => {
|
|
183
|
+
await new Promise((resolve, reject) => {
|
|
184
184
|
server.lifecycle.online.on(async () => {
|
|
185
185
|
resolve();
|
|
186
186
|
});
|
|
187
|
-
server.start();
|
|
187
|
+
server.start().catch((err) => reject(err));
|
|
188
188
|
});
|
|
189
189
|
expect(server.lifecycle.isReady).toBeTruthy();
|
|
190
190
|
expect(server.lifecycle.isOnline).toBeTruthy();
|
|
@@ -110,7 +110,7 @@ export async function createMatterbridgeEnvironment() {
|
|
|
110
110
|
matterbridge = await Matterbridge.loadInstance(false);
|
|
111
111
|
expect(matterbridge).toBeDefined();
|
|
112
112
|
expect(matterbridge).toBeInstanceOf(Matterbridge);
|
|
113
|
-
matterbridge.matterbridgeVersion = '3.7.
|
|
113
|
+
matterbridge.matterbridgeVersion = '3.7.6';
|
|
114
114
|
matterbridge.bridgeMode = 'bridge';
|
|
115
115
|
matterbridge.rootDirectory = path.join(HOMEDIR);
|
|
116
116
|
matterbridge.homeDirectory = path.join(HOMEDIR);
|
|
@@ -156,11 +156,11 @@ export async function startMatterbridgeEnvironment(port = 5540, createOnly = fal
|
|
|
156
156
|
return [server, aggregator];
|
|
157
157
|
}
|
|
158
158
|
expect(server.lifecycle.isOnline).toBeFalsy();
|
|
159
|
-
await new Promise((resolve) => {
|
|
159
|
+
await new Promise((resolve, reject) => {
|
|
160
160
|
server.lifecycle.online.on(async () => {
|
|
161
161
|
resolve();
|
|
162
162
|
});
|
|
163
|
-
server.start();
|
|
163
|
+
server.start().catch((err) => reject(err));
|
|
164
164
|
});
|
|
165
165
|
expect(server.lifecycle.isReady).toBeTruthy();
|
|
166
166
|
expect(server.lifecycle.isOnline).toBeTruthy();
|
package/dist/matterbridge.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export declare class Matterbridge extends EventEmitter<MatterbridgeEvents> {
|
|
|
35
35
|
private readonly debug;
|
|
36
36
|
private readonly verbose;
|
|
37
37
|
systemInformation: SystemInformation;
|
|
38
|
+
uuid: string;
|
|
38
39
|
homeDirectory: string;
|
|
39
40
|
rootDirectory: string;
|
|
40
41
|
matterbridgeDirectory: string;
|
package/dist/matterbridge.js
CHANGED
|
@@ -16,13 +16,13 @@ import { DeviceTypeId, VendorId } from '@matter/types/datatype';
|
|
|
16
16
|
import { ManualPairingCodeCodec } from '@matter/types/schema';
|
|
17
17
|
import { BroadcastServer } from '@matterbridge/thread/server';
|
|
18
18
|
import { dev, MATTER_LOGGER_FILE, MATTER_STORAGE_DIR, MATTERBRIDGE_LOGGER_FILE, NODE_STORAGE_DIR, plg, typ } from '@matterbridge/types';
|
|
19
|
-
import { wait } from '@matterbridge/utils';
|
|
20
19
|
import { getIntParameter, getParameter, hasAnyParameter, hasParameter } from '@matterbridge/utils/cli';
|
|
21
20
|
import { copyDirectory } from '@matterbridge/utils/copy-dir';
|
|
22
21
|
import { createDirectory } from '@matterbridge/utils/create-dir';
|
|
23
22
|
import { formatBytes, formatPercent, formatUptime } from '@matterbridge/utils/format';
|
|
24
23
|
import { excludedInterfaceNamePattern } from '@matterbridge/utils/network';
|
|
25
24
|
import { isValidNumber, isValidObject, isValidString, parseVersionString } from '@matterbridge/utils/validate';
|
|
25
|
+
import { fireAndForget, wait } from '@matterbridge/utils/wait';
|
|
26
26
|
import { AnsiLogger, BLUE, BRIGHT, CYAN, db, debugStringify, er, GREEN, nf, nt, or, RED, RESET, rs, UNDERLINE, UNDERLINEOFF, wr, zb, } from 'node-ansi-logger';
|
|
27
27
|
import { NodeStorageManager } from 'node-persist-manager';
|
|
28
28
|
import { DeviceManager } from './deviceManager.js';
|
|
@@ -32,7 +32,7 @@ import { bridge } from './matterbridgeDeviceTypes.js';
|
|
|
32
32
|
import { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
|
|
33
33
|
import { PluginManager } from './pluginManager.js';
|
|
34
34
|
export class Matterbridge extends EventEmitter {
|
|
35
|
-
debug = hasParameter('debug');
|
|
35
|
+
debug = hasParameter('debug') || hasParameter('verbose');
|
|
36
36
|
verbose = hasParameter('verbose');
|
|
37
37
|
systemInformation = {
|
|
38
38
|
interfaceName: '',
|
|
@@ -56,6 +56,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
56
56
|
heapTotal: '',
|
|
57
57
|
heapUsed: '',
|
|
58
58
|
};
|
|
59
|
+
uuid = '';
|
|
59
60
|
homeDirectory = '';
|
|
60
61
|
rootDirectory = '';
|
|
61
62
|
matterbridgeDirectory = '';
|
|
@@ -150,6 +151,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
150
151
|
getPlatformMatterbridge() {
|
|
151
152
|
return {
|
|
152
153
|
systemInformation: { ...this.systemInformation },
|
|
154
|
+
uuid: this.uuid,
|
|
153
155
|
rootDirectory: this.rootDirectory,
|
|
154
156
|
homeDirectory: this.homeDirectory,
|
|
155
157
|
matterbridgeDirectory: this.matterbridgeDirectory,
|
|
@@ -172,6 +174,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
172
174
|
getSharedMatterbridge() {
|
|
173
175
|
return {
|
|
174
176
|
systemInformation: { ...this.systemInformation },
|
|
177
|
+
uuid: this.uuid,
|
|
175
178
|
rootDirectory: this.rootDirectory,
|
|
176
179
|
homeDirectory: this.homeDirectory,
|
|
177
180
|
matterbridgeDirectory: this.matterbridgeDirectory,
|
|
@@ -350,11 +353,11 @@ export class Matterbridge extends EventEmitter {
|
|
|
350
353
|
for (const storage of storages) {
|
|
351
354
|
this.log.debug(`Checking storage: ${CYAN}${storage}${db}`);
|
|
352
355
|
const nodeContext = await this.nodeStorage?.createStorage(storage);
|
|
353
|
-
const keys =
|
|
354
|
-
|
|
356
|
+
const keys = await nodeContext.keys();
|
|
357
|
+
for (const key of keys) {
|
|
355
358
|
this.log.debug(`Checking key: ${CYAN}${storage}:${key}${db}`);
|
|
356
359
|
await nodeContext?.get(key);
|
|
357
|
-
}
|
|
360
|
+
}
|
|
358
361
|
}
|
|
359
362
|
this.log.debug('Creating node storage backup...');
|
|
360
363
|
await copyDirectory(path.join(this.matterbridgeDirectory, NODE_STORAGE_DIR), path.join(this.matterbridgeDirectory, NODE_STORAGE_DIR + '.backup'));
|
|
@@ -470,6 +473,13 @@ export class Matterbridge extends EventEmitter {
|
|
|
470
473
|
AnsiLogger.setGlobalLogfile(path.join(this.matterbridgeDirectory, MATTERBRIDGE_LOGGER_FILE), this.log.logLevel, true);
|
|
471
474
|
this.fileLogger = true;
|
|
472
475
|
}
|
|
476
|
+
this.uuid = await this.nodeContext.get('matterbridgeUuid');
|
|
477
|
+
if (!this.uuid) {
|
|
478
|
+
const { randomUUID } = await import('node:crypto');
|
|
479
|
+
this.uuid = randomUUID();
|
|
480
|
+
await this.nodeContext.set('matterbridgeUuid', this.uuid);
|
|
481
|
+
}
|
|
482
|
+
this.log.debug(`Matterbridge UUID: ${CYAN}${this.uuid}${db}`);
|
|
473
483
|
this.log.notice('Matterbridge is starting...');
|
|
474
484
|
this.log.debug(`Matterbridge logLevel: ${this.log.logLevel} fileLoger: ${this.fileLogger}.`);
|
|
475
485
|
if (this.profile !== undefined)
|
|
@@ -845,7 +855,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
845
855
|
if (wait)
|
|
846
856
|
await this.plugins.load(plugin, start, 'Matterbridge is starting');
|
|
847
857
|
else
|
|
848
|
-
this.plugins.load(plugin, start, 'Matterbridge is starting');
|
|
858
|
+
fireAndForget(this.plugins.load(plugin, start, 'Matterbridge is starting'), this.log, 'Load plugin');
|
|
849
859
|
}
|
|
850
860
|
this.frontend.wssSendRefreshRequired('plugins');
|
|
851
861
|
}
|
|
@@ -982,6 +992,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
982
992
|
}
|
|
983
993
|
}
|
|
984
994
|
else {
|
|
995
|
+
this.log.debug(`Global node_modules Directory: ${this.globalModulesDirectory}`);
|
|
985
996
|
this.server.request({ type: 'manager_run', src: 'matterbridge', dst: 'manager', params: { name: 'GlobalPrefix' } });
|
|
986
997
|
}
|
|
987
998
|
this.log.debug(`Reading matterbridge package.json...`);
|
|
@@ -1390,11 +1401,11 @@ export class Matterbridge extends EventEmitter {
|
|
|
1390
1401
|
clearInterval(this.startMatterInterval);
|
|
1391
1402
|
this.startMatterInterval = undefined;
|
|
1392
1403
|
this.log.debug('Cleared startMatterInterval interval in bridge mode');
|
|
1393
|
-
this.startServerNode(this.serverNode);
|
|
1404
|
+
fireAndForget(this.startServerNode(this.serverNode), this.log, 'Start server node');
|
|
1394
1405
|
for (const device of this.devices.array()) {
|
|
1395
1406
|
if (device.mode === 'server' && device.serverNode) {
|
|
1396
1407
|
this.log.debug(`Starting server node for device ${dev}${device.deviceName}${db} in server mode...`);
|
|
1397
|
-
this.startServerNode(device.serverNode);
|
|
1408
|
+
fireAndForget(this.startServerNode(device.serverNode), this.log, `Start server node for device ${device.deviceName}`);
|
|
1398
1409
|
}
|
|
1399
1410
|
}
|
|
1400
1411
|
this.configureTimeout = setTimeout(async () => {
|
|
@@ -1517,7 +1528,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
1517
1528
|
this.log.error(`Node storage context not found for plugin ${plg}${plugin.name}${er}`);
|
|
1518
1529
|
continue;
|
|
1519
1530
|
}
|
|
1520
|
-
this.startServerNode(plugin.serverNode);
|
|
1531
|
+
fireAndForget(this.startServerNode(plugin.serverNode), this.log, `Start server node for plugin ${plugin.name}`);
|
|
1521
1532
|
plugin.reachabilityTimeout = setTimeout(() => {
|
|
1522
1533
|
this.log.info(`Setting reachability to true for ${plg}${plugin.name}${nf}`);
|
|
1523
1534
|
if (plugin.type === 'DynamicPlatform' && plugin.aggregatorNode)
|
|
@@ -1527,7 +1538,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
1527
1538
|
for (const device of this.devices.array()) {
|
|
1528
1539
|
if (device.mode === 'server' && device.serverNode) {
|
|
1529
1540
|
this.log.debug(`Starting server node for device ${dev}${device.deviceName}${db} in server mode...`);
|
|
1530
|
-
this.startServerNode(device.serverNode);
|
|
1541
|
+
fireAndForget(this.startServerNode(device.serverNode), this.log, `Start server node for device ${device.deviceName}`);
|
|
1531
1542
|
}
|
|
1532
1543
|
}
|
|
1533
1544
|
this.emit('childbridge_started');
|
|
@@ -1955,7 +1966,7 @@ export class Matterbridge extends EventEmitter {
|
|
|
1955
1966
|
this.log.notice(`Manual pairing code ${CYAN}${manualPairingCode}${nt} discriminator ${CYAN}${discriminator}${nt} short discriminator ${CYAN}${pairingData.shortDiscriminator}${nt} passcode ${CYAN}${passcode}${nt}`);
|
|
1956
1967
|
}
|
|
1957
1968
|
else {
|
|
1958
|
-
this.log.notice(`Server node for ${storeId} is already commissioned
|
|
1969
|
+
this.log.notice(`Server node for ${storeId} is already commissioned.`);
|
|
1959
1970
|
this.advertisingNodes.delete(storeId);
|
|
1960
1971
|
}
|
|
1961
1972
|
this.frontend.wssSendRefreshRequired('matter', { matter: { ...this.getServerNodeData(serverNode) } });
|
package/dist/mb_mdns.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import os from 'node:os';
|
|
2
|
-
import { Mdns, MDNS_MULTICAST_IPV4_ADDRESS, MDNS_MULTICAST_IPV6_ADDRESS, MDNS_MULTICAST_PORT } from '@matterbridge/dgram';
|
|
2
|
+
import { DnsClass, DnsClassFlag, DnsRecordType, Mdns, MDNS_MULTICAST_IPV4_ADDRESS, MDNS_MULTICAST_IPV6_ADDRESS, MDNS_MULTICAST_PORT } from '@matterbridge/dgram';
|
|
3
3
|
import { getIntParameter, getParameter, getStringArrayParameter, hasParameter } from '@matterbridge/utils/cli';
|
|
4
4
|
import { excludedInterfaceNamePattern } from '@matterbridge/utils/network';
|
|
5
5
|
import pkg from '../package.json' with { type: 'json' };
|
|
@@ -88,27 +88,27 @@ export function sendMdnsQuery(mdns, unicast = false) {
|
|
|
88
88
|
mdns.log.info('Sending mDNS query for common services...');
|
|
89
89
|
try {
|
|
90
90
|
mdns.sendQuery([
|
|
91
|
-
{ name: '_matterc._udp.local', type:
|
|
92
|
-
{ name: '_matter._tcp.local', type:
|
|
93
|
-
{ name: '_matterbridge._tcp.local', type:
|
|
94
|
-
{ name: '_home-assistant._tcp.local', type:
|
|
95
|
-
{ name: '_shelly._tcp.local', type:
|
|
96
|
-
{ name: '_mqtt._tcp.local', type:
|
|
97
|
-
{ name: '_http._tcp.local', type:
|
|
98
|
-
{ name: '_googlecast._tcp.local', type:
|
|
99
|
-
{ name: '_airplay._tcp.local', type:
|
|
100
|
-
{ name: '_amzn-alexa._tcp.local', type:
|
|
101
|
-
{ name: '_companion-link._tcp.local', type:
|
|
102
|
-
{ name: '_hap._tcp.local', type:
|
|
103
|
-
{ name: '_hap._udp.local', type:
|
|
104
|
-
{ name: '_ipp._tcp.local', type:
|
|
105
|
-
{ name: '_ipps._tcp.local', type:
|
|
106
|
-
{ name: '_meshcop._tcp.local', type:
|
|
107
|
-
{ name: '_printer._tcp.local', type:
|
|
108
|
-
{ name: '_raop._tcp.local', type:
|
|
109
|
-
{ name: '_sleep-proxy._tcp.local', type:
|
|
110
|
-
{ name: '_ssh._tcp.local', type:
|
|
111
|
-
{ name: '_services._dns-sd._udp.local', type:
|
|
91
|
+
{ name: '_matterc._udp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
92
|
+
{ name: '_matter._tcp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
93
|
+
{ name: '_matterbridge._tcp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
94
|
+
{ name: '_home-assistant._tcp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
95
|
+
{ name: '_shelly._tcp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
96
|
+
{ name: '_mqtt._tcp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
97
|
+
{ name: '_http._tcp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
98
|
+
{ name: '_googlecast._tcp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
99
|
+
{ name: '_airplay._tcp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
100
|
+
{ name: '_amzn-alexa._tcp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
101
|
+
{ name: '_companion-link._tcp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
102
|
+
{ name: '_hap._tcp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
103
|
+
{ name: '_hap._udp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
104
|
+
{ name: '_ipp._tcp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
105
|
+
{ name: '_ipps._tcp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
106
|
+
{ name: '_meshcop._tcp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
107
|
+
{ name: '_printer._tcp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
108
|
+
{ name: '_raop._tcp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
109
|
+
{ name: '_sleep-proxy._tcp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
110
|
+
{ name: '_ssh._tcp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
111
|
+
{ name: '_services._dns-sd._udp.local', type: DnsRecordType.PTR, class: DnsClass.IN, unicastResponse: unicast },
|
|
112
112
|
]);
|
|
113
113
|
}
|
|
114
114
|
catch (error) {
|
|
@@ -130,14 +130,14 @@ export function advertiseMatterbridgeService(mdns, ttl = 120) {
|
|
|
130
130
|
const srvRdata = mdns.encodeSrvRdata(0, 0, port, hostName);
|
|
131
131
|
const txtRdata = mdns.encodeTxtRdata([`version=${pkg.version}`, 'path=/']);
|
|
132
132
|
const answers = [
|
|
133
|
-
{ name: '_services._dns-sd._udp.local', rtype:
|
|
134
|
-
{ name: httpServiceType, rtype:
|
|
135
|
-
{ name: '_services._dns-sd._udp.local', rtype:
|
|
136
|
-
{ name: matterbridgeServiceType, rtype:
|
|
137
|
-
{ name: httpInstanceName, rtype:
|
|
138
|
-
{ name: matterbridgeInstanceName, rtype:
|
|
139
|
-
{ name: httpInstanceName, rtype:
|
|
140
|
-
{ name: matterbridgeInstanceName, rtype:
|
|
133
|
+
{ name: '_services._dns-sd._udp.local', rtype: DnsRecordType.PTR, rclass: DnsClass.IN, ttl, rdata: ptrHttpServiceTypeRdata },
|
|
134
|
+
{ name: httpServiceType, rtype: DnsRecordType.PTR, rclass: DnsClass.IN, ttl, rdata: ptrHttpInstanceRdata },
|
|
135
|
+
{ name: '_services._dns-sd._udp.local', rtype: DnsRecordType.PTR, rclass: DnsClass.IN, ttl, rdata: ptrMatterbridgeServiceTypeRdata },
|
|
136
|
+
{ name: matterbridgeServiceType, rtype: DnsRecordType.PTR, rclass: DnsClass.IN, ttl, rdata: ptrMatterbridgeInstanceRdata },
|
|
137
|
+
{ name: httpInstanceName, rtype: DnsRecordType.SRV, rclass: DnsClass.IN | DnsClassFlag.FLUSH, ttl, rdata: srvRdata },
|
|
138
|
+
{ name: matterbridgeInstanceName, rtype: DnsRecordType.SRV, rclass: DnsClass.IN | DnsClassFlag.FLUSH, ttl, rdata: srvRdata },
|
|
139
|
+
{ name: httpInstanceName, rtype: DnsRecordType.TXT, rclass: DnsClass.IN | DnsClassFlag.FLUSH, ttl, rdata: txtRdata },
|
|
140
|
+
{ name: matterbridgeInstanceName, rtype: DnsRecordType.TXT, rclass: DnsClass.IN | DnsClassFlag.FLUSH, ttl, rdata: txtRdata },
|
|
141
141
|
];
|
|
142
142
|
const interfaces = os.networkInterfaces();
|
|
143
143
|
let interfaceInfos = mdns.interfaceName ? (interfaces[mdns.interfaceName] ?? []) : [];
|
|
@@ -154,10 +154,10 @@ export function advertiseMatterbridgeService(mdns, ttl = 120) {
|
|
|
154
154
|
}
|
|
155
155
|
for (const info of interfaceInfos) {
|
|
156
156
|
if (info.family === 'IPv4' && !info.internal) {
|
|
157
|
-
answers.push({ name: hostName, rtype:
|
|
157
|
+
answers.push({ name: hostName, rtype: DnsRecordType.A, rclass: DnsClass.IN | DnsClassFlag.FLUSH, ttl, rdata: mdns.encodeA(info.address) });
|
|
158
158
|
}
|
|
159
159
|
else if (info.family === 'IPv6' && !info.internal) {
|
|
160
|
-
answers.push({ name: hostName, rtype:
|
|
160
|
+
answers.push({ name: hostName, rtype: DnsRecordType.AAAA, rclass: DnsClass.IN | DnsClassFlag.FLUSH, ttl, rdata: mdns.encodeAAAA(info.address) });
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matterbridge/core",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.6-dev-20260427-575abf6",
|
|
4
4
|
"description": "Matterbridge core library",
|
|
5
5
|
"author": "https://github.com/Luligu",
|
|
6
6
|
"homepage": "https://matterbridge.io/",
|
|
@@ -130,13 +130,13 @@
|
|
|
130
130
|
],
|
|
131
131
|
"dependencies": {
|
|
132
132
|
"@matter/main": "0.16.11",
|
|
133
|
-
"@matterbridge/dgram": "3.7.
|
|
134
|
-
"@matterbridge/thread": "3.7.
|
|
135
|
-
"@matterbridge/types": "3.7.
|
|
136
|
-
"@matterbridge/utils": "3.7.
|
|
133
|
+
"@matterbridge/dgram": "3.7.6-dev-20260427-575abf6",
|
|
134
|
+
"@matterbridge/thread": "3.7.6-dev-20260427-575abf6",
|
|
135
|
+
"@matterbridge/types": "3.7.6-dev-20260427-575abf6",
|
|
136
|
+
"@matterbridge/utils": "3.7.6-dev-20260427-575abf6",
|
|
137
137
|
"escape-html": "1.0.3",
|
|
138
138
|
"express": "5.2.1",
|
|
139
|
-
"express-rate-limit": "8.
|
|
139
|
+
"express-rate-limit": "8.4.1",
|
|
140
140
|
"multer": "2.1.1",
|
|
141
141
|
"node-ansi-logger": "3.2.1",
|
|
142
142
|
"node-persist-manager": "2.0.2",
|