matterbridge 3.4.7-dev-20260103-3152357 → 3.4.7-dev-20260104-6b10cee
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 +3 -0
- package/dist/dgram/dgram.js +4 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/packages/mb-lib-test/dist/jestutils/jestHelpers.d.ts +21 -0
- package/packages/mb-lib-test/dist/module.d.ts +2 -0
- package/packages/mb-lib-test/dist/vitestutils/vitestHelpers.d.ts +21 -0
- package/packages/mb-lib-test/package.json +2 -2
- package/reflector/DockerDesktopSetup.png +0 -0
- package/reflector/Reflector.md +158 -0
- package/reflector/ReflectorClient.png +0 -0
- package/reflector/ReflectorServer.png +0 -0
- package/reflector/docker-compose.yml +32 -0
- package/reflector/mDnsPacket.png +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -35,10 +35,13 @@ Advantages:
|
|
|
35
35
|
- [docker]: Released for test and development the alpine and ubuntu images on Docker Hub. They are for amd64 arm64 and based on node 24. No plugins inside.
|
|
36
36
|
- [docker]: Updated [README-DOCKER.md](README-DOCKER.md) to include alpine and ubuntu images specifications.
|
|
37
37
|
- [package]: Added scripts for workspaces.
|
|
38
|
+
- [reflector]: [Full guide](https://matterbridge.io/docker-reflector/Docker%20reflector.html).
|
|
38
39
|
|
|
39
40
|
### Changed
|
|
40
41
|
|
|
41
42
|
- [package]: Updated dependencies.
|
|
43
|
+
- [dgram]: Bumbed version number to 1.0.2 and excluded Tailscale interfaces in Dgram class.
|
|
44
|
+
- [network]: Bumbed version number to 1.0.2.
|
|
42
45
|
|
|
43
46
|
<a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/bmc-button.svg" alt="Buy me a coffee" width="80"></a>
|
|
44
47
|
|
package/dist/dgram/dgram.js
CHANGED
|
@@ -98,6 +98,8 @@ export class Dgram extends EventEmitter {
|
|
|
98
98
|
}
|
|
99
99
|
if (!networkInterface) {
|
|
100
100
|
for (const [interfaceName, interfaceDetails] of Object.entries(interfaces)) {
|
|
101
|
+
if (interfaceName.toLowerCase().includes('tailscale'))
|
|
102
|
+
continue;
|
|
101
103
|
if (!interfaceDetails)
|
|
102
104
|
continue;
|
|
103
105
|
for (const detail of interfaceDetails) {
|
|
@@ -130,6 +132,8 @@ export class Dgram extends EventEmitter {
|
|
|
130
132
|
}
|
|
131
133
|
if (!networkInterface) {
|
|
132
134
|
for (const [interfaceName, interfaceDetails] of Object.entries(interfaces)) {
|
|
135
|
+
if (interfaceName.toLowerCase().includes('tailscale'))
|
|
136
|
+
continue;
|
|
133
137
|
if (!interfaceDetails)
|
|
134
138
|
continue;
|
|
135
139
|
for (const detail of interfaceDetails) {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge",
|
|
3
|
-
"version": "3.4.7-dev-
|
|
3
|
+
"version": "3.4.7-dev-20260104-6b10cee",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge",
|
|
9
|
-
"version": "3.4.7-dev-
|
|
9
|
+
"version": "3.4.7-dev-20260104-6b10cee",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"workspaces": [
|
|
12
12
|
"packages/*"
|
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { jest } from '@jest/globals';
|
|
2
|
+
import { AnsiLogger } from 'node-ansi-logger';
|
|
3
|
+
export declare const originalProcessArgv: readonly string[];
|
|
4
|
+
export declare const originalProcessEnv: Readonly<Record<string, string | undefined>>;
|
|
5
|
+
export declare let loggerLogSpy: jest.SpiedFunction<typeof AnsiLogger.prototype.log>;
|
|
6
|
+
export declare let loggerDebugSpy: jest.SpiedFunction<typeof AnsiLogger.prototype.debug>;
|
|
7
|
+
export declare let loggerInfoSpy: jest.SpiedFunction<typeof AnsiLogger.prototype.info>;
|
|
8
|
+
export declare let loggerNoticeSpy: jest.SpiedFunction<typeof AnsiLogger.prototype.notice>;
|
|
9
|
+
export declare let loggerWarnSpy: jest.SpiedFunction<typeof AnsiLogger.prototype.warn>;
|
|
10
|
+
export declare let loggerErrorSpy: jest.SpiedFunction<typeof AnsiLogger.prototype.error>;
|
|
11
|
+
export declare let loggerFatalSpy: jest.SpiedFunction<typeof AnsiLogger.prototype.fatal>;
|
|
12
|
+
export declare let consoleLogSpy: jest.SpiedFunction<typeof console.log>;
|
|
13
|
+
export declare let consoleDebugSpy: jest.SpiedFunction<typeof console.log>;
|
|
14
|
+
export declare let consoleInfoSpy: jest.SpiedFunction<typeof console.log>;
|
|
15
|
+
export declare let consoleWarnSpy: jest.SpiedFunction<typeof console.log>;
|
|
16
|
+
export declare let consoleErrorSpy: jest.SpiedFunction<typeof console.log>;
|
|
17
|
+
export declare let NAME: string;
|
|
18
|
+
export declare let HOMEDIR: string;
|
|
19
|
+
export declare let log: AnsiLogger;
|
|
20
|
+
export declare function setupTest(name: string, debug?: boolean): Promise<void>;
|
|
21
|
+
export declare function setDebug(debug: boolean): Promise<void>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { MockInstance } from 'vitest';
|
|
2
|
+
import { AnsiLogger } from 'node-ansi-logger';
|
|
3
|
+
export declare const originalProcessArgv: readonly string[];
|
|
4
|
+
export declare const originalProcessEnv: Readonly<Record<string, string | undefined>>;
|
|
5
|
+
export declare let loggerLogSpy: MockInstance<typeof AnsiLogger.prototype.log>;
|
|
6
|
+
export declare let loggerDebugSpy: MockInstance<typeof AnsiLogger.prototype.debug>;
|
|
7
|
+
export declare let loggerInfoSpy: MockInstance<typeof AnsiLogger.prototype.info>;
|
|
8
|
+
export declare let loggerNoticeSpy: MockInstance<typeof AnsiLogger.prototype.notice>;
|
|
9
|
+
export declare let loggerWarnSpy: MockInstance<typeof AnsiLogger.prototype.warn>;
|
|
10
|
+
export declare let loggerErrorSpy: MockInstance<typeof AnsiLogger.prototype.error>;
|
|
11
|
+
export declare let loggerFatalSpy: MockInstance<typeof AnsiLogger.prototype.fatal>;
|
|
12
|
+
export declare let consoleLogSpy: MockInstance<typeof console.log>;
|
|
13
|
+
export declare let consoleDebugSpy: MockInstance<typeof console.debug>;
|
|
14
|
+
export declare let consoleInfoSpy: MockInstance<typeof console.info>;
|
|
15
|
+
export declare let consoleWarnSpy: MockInstance<typeof console.warn>;
|
|
16
|
+
export declare let consoleErrorSpy: MockInstance<typeof console.error>;
|
|
17
|
+
export declare let NAME: string;
|
|
18
|
+
export declare let HOMEDIR: string;
|
|
19
|
+
export declare let log: AnsiLogger;
|
|
20
|
+
export declare function setupTest(name: string, debug?: boolean): Promise<void>;
|
|
21
|
+
export declare function setDebug(debug: boolean): Promise<void>;
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"git:hardreset:edge": "git fetch origin && git checkout edge && git reset --hard origin/edge",
|
|
61
61
|
"checkDependencies": "npx npm-check-updates",
|
|
62
62
|
"updateDependencies": "npx npm-check-updates -u && npm run reset",
|
|
63
|
-
"automator": "node /
|
|
63
|
+
"automator": "node scripts/runAutomator.mjs --monorepo-package",
|
|
64
64
|
"runMeBeforePublish": "npm run lint && npm run format && npm run test && npm run build",
|
|
65
|
-
"prepublishOnly": "npm run cleanBuildProduction && npm pkg delete devDependencies scripts
|
|
65
|
+
"prepublishOnly": "npm run cleanBuildProduction && npm pkg delete devDependencies scripts && npx shx rm -rf node_modules/* node_modules/.[!.]* node_modules/..?* && npm install --omit=dev && npm shrinkwrap",
|
|
66
66
|
"npmPack": "npx shx cp package.json package.json.backup && npm run prepublishOnly && npm pack && npx shx cp package.json.backup package.json && npx shx rm -f package.json.backup && npm run reset",
|
|
67
67
|
"npmPublishTagDev": "npx shx cp package.json package.json.backup && npm run prepublishOnly && npm publish --tag dev && npx shx cp package.json.backup package.json && npx shx rm -f package.json.backup && npm run reset",
|
|
68
68
|
"npmPublishTagEdge": "npx shx cp package.json package.json.backup && npm run prepublishOnly && npm publish --tag edge && npx shx cp package.json.backup package.json && npx shx rm -f package.json.backup && npm run reset",
|
|
Binary file
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# Matterbridge mDNS reflector
|
|
2
|
+
|
|
3
|
+
This project aims to use Matterbridge in these configurations:
|
|
4
|
+
|
|
5
|
+
| Docker type | Docker network | OS | Ipv4 | Ipv6 | Share (3) | Home Assistant | Matter Server |
|
|
6
|
+
| -------------- | -------------- | ------- | ---- | ---- | --------- | -------------- | ------------- |
|
|
7
|
+
| Docker Desktop | bridge (1) | Windows | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
8
|
+
| Docker Desktop | bridge (1) | macOS | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
9
|
+
| Docker Engine | bridge (2) | Linux | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
10
|
+
|
|
11
|
+
(1) - Network host in this configuration is useless cause Docker runs inside a VM.
|
|
12
|
+
|
|
13
|
+
(2) - Network host in this configuration works already out of the box cause Docker runs on the host.
|
|
14
|
+
|
|
15
|
+
(3) - Share mDNS between separate containers.
|
|
16
|
+
|
|
17
|
+
It can also be used to run Home Assistant and Matter Server inside Docker Desktop on Windows and macOS (with network bridge) without using complex VM. You just copy paste this [docker-compose.yml](https://matterbridge.io/reflector/docker-compose.yml).
|
|
18
|
+
|
|
19
|
+
Since the mDNS are shared between reflector clients, you can pair Matterbridge running with Docker Desktop to Home Assistant running with Docker Desktop. Even on the same machine.
|
|
20
|
+
|
|
21
|
+
<a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/bmc-button.svg" alt="Buy me a coffee" width="120"></a>
|
|
22
|
+
|
|
23
|
+
# Prerequisites
|
|
24
|
+
|
|
25
|
+
- Docker Desktop
|
|
26
|
+
|
|
27
|
+
## Docker Desktop requirements for Windows and macOS
|
|
28
|
+
|
|
29
|
+
See Docker Desktop docs.
|
|
30
|
+
|
|
31
|
+
## Dual Stack IPv4/IPv6 mDNS enabled and No filtering
|
|
32
|
+
|
|
33
|
+

|
|
34
|
+
|
|
35
|
+
# Run Matterbridge in a Docker Desktop container
|
|
36
|
+
|
|
37
|
+
We use named volumes for storage, plugins and mattercert.
|
|
38
|
+
|
|
39
|
+
We publish the default matterbridge frontend port 8283.
|
|
40
|
+
|
|
41
|
+
We publish the matter port range 5550-5559 to allow childbridge mode and server node devices (RVCs).
|
|
42
|
+
|
|
43
|
+
macOS
|
|
44
|
+
|
|
45
|
+
```zsh
|
|
46
|
+
docker stop matterbridge-test
|
|
47
|
+
docker rm matterbridge-test
|
|
48
|
+
docker pull luligu/matterbridge:dev
|
|
49
|
+
docker run -dit --restart unless-stopped --name matterbridge-test \
|
|
50
|
+
-p 8283:8283 -p 5550-5559:5550-5559/udp \
|
|
51
|
+
-v storage:/root/.matterbridge -v plugins:/root/Matterbridge -v mattercert:/root/.mattercert \
|
|
52
|
+
luligu/matterbridge:dev matterbridge --docker --frontend 8283 --port 5550
|
|
53
|
+
docker logs --tail 1000 -f matterbridge-test
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
powerShell
|
|
57
|
+
|
|
58
|
+
```powershell
|
|
59
|
+
docker stop matterbridge-test
|
|
60
|
+
docker rm matterbridge-test
|
|
61
|
+
docker pull luligu/matterbridge:dev
|
|
62
|
+
docker run -dit --restart unless-stopped --name matterbridge-test `
|
|
63
|
+
-p 8283:8283 -p 5550-5559:5550-5559/udp `
|
|
64
|
+
-v storage:/root/.matterbridge -v plugins:/root/Matterbridge -v mattercert:/root/.mattercert `
|
|
65
|
+
luligu/matterbridge:dev matterbridge --docker --frontend 8283 --port 5550
|
|
66
|
+
docker logs --tail 1000 -f matterbridge-test
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
You will see that the frontend inside the container is listening on the conainer address
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
[09:02:10.140] [Frontend] The frontend http server is listening on http://172.17.0.2:8283
|
|
73
|
+
[09:02:10.140] [Frontend] The frontend http server is listening on http://[fd3d:8954:ffe5::2]:8283
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
But since we mapped the port 8283:
|
|
77
|
+
|
|
78
|
+
- the frontend is available on the host with localhost:8283, <your_host_ip>:8283 or <your_hostname>:8283.
|
|
79
|
+
|
|
80
|
+
- the frontend is available on the lan with <your_host_ip>:8283 or <your_hostname>:8283.
|
|
81
|
+
|
|
82
|
+
In the same way the Matter port range 5550-5559 is mapped outside the container to allow the controllers on the lan to discover and connect Matterbridge.
|
|
83
|
+
|
|
84
|
+
## Optional: if you want to see the mDNS inside the Docker Desktop container
|
|
85
|
+
|
|
86
|
+
From another terminal run mb_mdns inside the container we created and run before
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
docker exec -it matterbridge-test mb_mdns --no-timeout
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
In a while you will see what mDNS packets are advertised inside the container
|
|
93
|
+
|
|
94
|
+

|
|
95
|
+
|
|
96
|
+
## Optional: if you want to see ip and routing table inside the Docker Desktop container
|
|
97
|
+
|
|
98
|
+
From another terminal run ip a and ip r inside the container we created and run before
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
docker exec -it matterbridge-test apt-get update
|
|
102
|
+
docker exec -it matterbridge-test apt-get install -y --no-install-recommends iproute2 iputils-ping net-tools dnsutils tcpdump netcat-openbsd
|
|
103
|
+
docker exec -it matterbridge-test ip a
|
|
104
|
+
docker exec -it matterbridge-test ip r
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Issues we have there
|
|
108
|
+
|
|
109
|
+
1. The advertised mDNS packets cannot reach the host and the lan cause mDNS are not routed inside Docker Desktop
|
|
110
|
+
|
|
111
|
+
2. The advertised mDNS packets contain wrong A and AAAA records:
|
|
112
|
+
|
|
113
|
+
- the advertised address are relative to the container
|
|
114
|
+
- those address are not reachable from the host and from the lan
|
|
115
|
+
|
|
116
|
+
## Run the Madderbridge reflector server directly on the host (you need node.js installed on Windows or macOS)
|
|
117
|
+
|
|
118
|
+
```shell
|
|
119
|
+
npm install -g matterbridge@dev
|
|
120
|
+
mb_mdns --reflector-server --log-reflector-messages --localhost --share-with-clients
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
In a while you will see
|
|
124
|
+
|
|
125
|
+

|
|
126
|
+
|
|
127
|
+
## Run the Madderbridge reflector client in container
|
|
128
|
+
|
|
129
|
+
```shell
|
|
130
|
+
docker stop matterbridge-reflector
|
|
131
|
+
docker rm matterbridge-reflector
|
|
132
|
+
docker pull luligu/reflector-client:latest
|
|
133
|
+
docker run -dit --restart unless-stopped --name matterbridge-reflector luligu/reflector-client:latest
|
|
134
|
+
docker logs --tail 1000 -f matterbridge-reflector
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
In a while you will see
|
|
138
|
+
|
|
139
|
+

|
|
140
|
+
|
|
141
|
+
# Run Home Assistant and Matter Server in Docker compose with Docker Desktop
|
|
142
|
+
|
|
143
|
+
## Prerequisites
|
|
144
|
+
|
|
145
|
+
You need the Matterbridge reflector server running on the host from the tutorial above.
|
|
146
|
+
|
|
147
|
+
## Run Home Assitant and Matter Server in Docker Compose with Docker Desktop
|
|
148
|
+
|
|
149
|
+
To test the sharing feature (it shares mDNS between all reflector clients),
|
|
150
|
+
use this [docker-compose.yml](https://matterbridge.io/reflector/docker-compose.yml).
|
|
151
|
+
|
|
152
|
+
With this configuration Home Assistant (with Matter Server) works inside a Docker Desktop container without network host. When asked by Home Assistant, connect to Matter Server with **ws://matterserver:5580/ws**
|
|
153
|
+
|
|
154
|
+
```shell
|
|
155
|
+
docker compose down
|
|
156
|
+
docker compose pull
|
|
157
|
+
docker compose up -d --force-recreate
|
|
158
|
+
```
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
services:
|
|
2
|
+
homeassistant:
|
|
3
|
+
container_name: homeassistant
|
|
4
|
+
image: ghcr.io/home-assistant/home-assistant:stable
|
|
5
|
+
restart: unless-stopped
|
|
6
|
+
depends_on:
|
|
7
|
+
- matterserver
|
|
8
|
+
ports:
|
|
9
|
+
- "8123:8123"
|
|
10
|
+
volumes:
|
|
11
|
+
- ./DockerVolumes/homeassistant:/config
|
|
12
|
+
environment:
|
|
13
|
+
- TZ=Europe/Paris
|
|
14
|
+
|
|
15
|
+
matterserver:
|
|
16
|
+
container_name: matterserver
|
|
17
|
+
image: ghcr.io/home-assistant-libs/python-matter-server:stable
|
|
18
|
+
restart: unless-stopped
|
|
19
|
+
ports:
|
|
20
|
+
- "5580:5580"
|
|
21
|
+
- "5540:5540/udp"
|
|
22
|
+
volumes:
|
|
23
|
+
- ./DockerVolumes/matterserver:/data
|
|
24
|
+
environment:
|
|
25
|
+
- TZ=Europe/Paris
|
|
26
|
+
|
|
27
|
+
reflector:
|
|
28
|
+
container_name: reflector
|
|
29
|
+
image: luligu/reflector-client:latest
|
|
30
|
+
restart: unless-stopped
|
|
31
|
+
environment:
|
|
32
|
+
- TZ=Europe/Paris
|
|
Binary file
|