matterbridge 3.3.7-dev-20251106-de2d9ea → 3.3.7-dev-20251109-a306ab9
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 +2 -2
- package/README-SERVICE-OPT.md +23 -7
- package/dist/pluginManager.js +28 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -28,7 +28,7 @@ Advantages:
|
|
|
28
28
|
- individual plugin isolation in childbridge mode;
|
|
29
29
|
- ability to update the plugin in childbridge mode without restarting matterbridge;
|
|
30
30
|
|
|
31
|
-
## [3.3.7] - 2025-11-
|
|
31
|
+
## [3.3.7] - 2025-11-08
|
|
32
32
|
|
|
33
33
|
### Breaking Changes
|
|
34
34
|
|
|
@@ -37,7 +37,7 @@ Advantages:
|
|
|
37
37
|
### Added
|
|
38
38
|
|
|
39
39
|
- [matterbridge]: Added a first check for plugin existence (docker pull or Hass add-on rebuild) and reinstall it before parsing the plugin. The error messages have been removed.
|
|
40
|
-
- [service]: Added [configuration](README-SERVICE-OPT.md) to run matterbridge as a daemon with systemctl (Linux only)
|
|
40
|
+
- [service]: Added [configuration](README-SERVICE-OPT.md) to run matterbridge as a daemon with systemctl (Linux only), private global node_modules, user/group matterbridge and no sudo required.
|
|
41
41
|
|
|
42
42
|
### Changed
|
|
43
43
|
|
package/README-SERVICE-OPT.md
CHANGED
|
@@ -20,14 +20,16 @@
|
|
|
20
20
|
|
|
21
21
|
The advantage of this setup is that the global node_modules are private for matterbridge and sudo is not required.
|
|
22
22
|
|
|
23
|
-
The service runs with user matterbridge and the system has full protection.
|
|
23
|
+
The service runs with group and user matterbridge and the system has full protection.
|
|
24
24
|
|
|
25
25
|
The storage position is **not compatible** with the traditional setup (~/Matterbridge ~/.matterbridge ~/.mattercert).
|
|
26
26
|
|
|
27
27
|
### 1 - Create the matterbridge user and group
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
|
+
# ✅ Create the matterbridge group
|
|
30
31
|
sudo groupadd --system matterbridge 2>/dev/null || true
|
|
32
|
+
# ✅ Create the matterbridge user
|
|
31
33
|
sudo useradd --system \
|
|
32
34
|
--home-dir /opt/matterbridge \
|
|
33
35
|
--shell /usr/sbin/nologin \
|
|
@@ -42,10 +44,10 @@ This will create the required directories if they don't exist
|
|
|
42
44
|
```bash
|
|
43
45
|
cd ~
|
|
44
46
|
# ✅ Safe precaution if matterbridge was already running with the traditional setup
|
|
45
|
-
sudo systemctl stop matterbridge
|
|
46
|
-
# ✅
|
|
47
|
-
sudo npm uninstall matterbridge -g
|
|
48
|
-
# ✅ Creates all
|
|
47
|
+
sudo systemctl stop matterbridge 2>/dev/null || true
|
|
48
|
+
# ✅ Safe precaution we need to uninstall from the global node_modules
|
|
49
|
+
sudo npm uninstall matterbridge -g 2>/dev/null || true
|
|
50
|
+
# ✅ Creates all required directories
|
|
49
51
|
sudo mkdir -p /opt/matterbridge /opt/matterbridge/Matterbridge /opt/matterbridge/.matterbridge /opt/matterbridge/.mattercert /opt/matterbridge/.npm-global
|
|
50
52
|
# ✅ Ensures ownership
|
|
51
53
|
sudo chown -R matterbridge:matterbridge /opt/matterbridge /opt/matterbridge/Matterbridge /opt/matterbridge/.matterbridge /opt/matterbridge/.mattercert /opt/matterbridge/.npm-global
|
|
@@ -55,7 +57,7 @@ sudo chmod -R 755 /opt/matterbridge /opt/matterbridge/Matterbridge /opt/matterbr
|
|
|
55
57
|
sudo -u matterbridge mkdir -p /opt/matterbridge/.npm-global/bin
|
|
56
58
|
# ✅ Install matterbridge in the private global node_modules
|
|
57
59
|
sudo -u matterbridge NPM_CONFIG_PREFIX=/opt/matterbridge/.npm-global npm install matterbridge --omit=dev --verbose --global
|
|
58
|
-
# ✅ Create a link to matterbridge
|
|
60
|
+
# ✅ Create a link to matterbridge bins
|
|
59
61
|
sudo ln -sf /opt/matterbridge/.npm-global/bin/matterbridge /usr/bin/matterbridge
|
|
60
62
|
sudo ln -sf /opt/matterbridge/.npm-global/bin/mb_mdns /usr/bin/mb_mdns
|
|
61
63
|
sudo ln -sf /opt/matterbridge/.npm-global/bin/mb_coap /usr/bin/mb_coap
|
|
@@ -69,7 +71,21 @@ matterbridge --version
|
|
|
69
71
|
|
|
70
72
|
The storage position is **not compatible** with the traditional setup (~/Matterbridge ~/.matterbridge ~/.mattercert).
|
|
71
73
|
|
|
72
|
-
|
|
74
|
+
If you are migrating from the traditional service setup, before removing the old diretories, you may want to copy the contents of ~/Matterbridge ~/.matterbridge ~/.mattercert to the new directories /opt/matterbridge/Matterbridge /opt/matterbridge/.matterbridge /opt/matterbridge/.mattercert.
|
|
75
|
+
|
|
76
|
+
Copy the old diretories content
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
sudo cp -a ~/Matterbridge/. /opt/matterbridge/Matterbridge/
|
|
80
|
+
sudo cp -a ~/.matterbridge/. /opt/matterbridge/.matterbridge/
|
|
81
|
+
sudo cp -a ~/.mattercert/. /opt/matterbridge/.mattercert/
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Remove the old diretories
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
sudo rm -rf ~/Matterbridge ~/.matterbridge ~/.mattercert ~/.npm-global
|
|
88
|
+
```
|
|
73
89
|
|
|
74
90
|
### 3 - Create a systemctl configuration file for Matterbridge
|
|
75
91
|
|
package/dist/pluginManager.js
CHANGED
|
@@ -125,6 +125,28 @@ export class PluginManager extends EventEmitter {
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
break;
|
|
128
|
+
case 'plugins_start':
|
|
129
|
+
{
|
|
130
|
+
const plugin = await this.start(msg.params.plugin, msg.params.message, msg.params.configure);
|
|
131
|
+
if (plugin) {
|
|
132
|
+
this.server.respond({ ...msg, params: {}, response: { plugin: this.toApiPlugin(plugin) } });
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
this.server.respond({ ...msg, response: { plugin } });
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
break;
|
|
139
|
+
case 'plugins_configure':
|
|
140
|
+
{
|
|
141
|
+
const plugin = await this.configure(msg.params.plugin);
|
|
142
|
+
if (plugin) {
|
|
143
|
+
this.server.respond({ ...msg, params: {}, response: { plugin: this.toApiPlugin(plugin) } });
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
this.server.respond({ ...msg, response: { plugin } });
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
break;
|
|
128
150
|
case 'plugins_shutdown':
|
|
129
151
|
{
|
|
130
152
|
const plugin = await this.shutdown(msg.params.plugin, msg.params.reason, msg.params.removeAllDevices, msg.params.force);
|
|
@@ -346,6 +368,7 @@ export class PluginManager extends EventEmitter {
|
|
|
346
368
|
}
|
|
347
369
|
}
|
|
348
370
|
async install(packageName) {
|
|
371
|
+
this.log.debug(`Installing plugin ${plg}${packageName}${db}...`);
|
|
349
372
|
const { spawnCommand } = await import('./utils/spawn.js');
|
|
350
373
|
try {
|
|
351
374
|
await spawnCommand(this.matterbridge, 'npm', ['install', '-g', packageName, '--omit=dev', '--verbose'], 'install', packageName);
|
|
@@ -364,14 +387,17 @@ export class PluginManager extends EventEmitter {
|
|
|
364
387
|
await this.matterbridge.shutdownProcess();
|
|
365
388
|
}
|
|
366
389
|
}
|
|
390
|
+
this.log.debug(`Installed plugin ${plg}${packageName}${db} successfully`);
|
|
367
391
|
return true;
|
|
368
392
|
}
|
|
369
393
|
catch (error) {
|
|
370
394
|
inspectError(this.log, `Failed to install package ${plg}${packageName}${er}`, error);
|
|
395
|
+
this.log.debug(`Failed to install plugin ${plg}${packageName}${db}`);
|
|
371
396
|
return false;
|
|
372
397
|
}
|
|
373
398
|
}
|
|
374
399
|
async uninstall(packageName) {
|
|
400
|
+
this.log.debug(`Uninstalling plugin ${plg}${packageName}${db}...`);
|
|
375
401
|
const { spawnCommand } = await import('./utils/spawn.js');
|
|
376
402
|
packageName = packageName.replace(/@.*$/, '');
|
|
377
403
|
if (packageName === 'matterbridge')
|
|
@@ -384,10 +410,12 @@ export class PluginManager extends EventEmitter {
|
|
|
384
410
|
await this.remove(packageName);
|
|
385
411
|
}
|
|
386
412
|
await spawnCommand(this.matterbridge, 'npm', ['uninstall', '-g', packageName, '--verbose'], 'uninstall', packageName);
|
|
413
|
+
this.log.debug(`Uninstalled plugin ${plg}${packageName}${db} successfully`);
|
|
387
414
|
return true;
|
|
388
415
|
}
|
|
389
416
|
catch (error) {
|
|
390
417
|
inspectError(this.log, `Failed to uninstall package ${plg}${packageName}${er}`, error);
|
|
418
|
+
this.log.debug(`Failed to uninstall plugin ${plg}${packageName}${db}`);
|
|
391
419
|
return false;
|
|
392
420
|
}
|
|
393
421
|
}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "matterbridge",
|
|
3
|
-
"version": "3.3.7-dev-
|
|
3
|
+
"version": "3.3.7-dev-20251109-a306ab9",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "matterbridge",
|
|
9
|
-
"version": "3.3.7-dev-
|
|
9
|
+
"version": "3.3.7-dev-20251109-a306ab9",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@matter/main": "0.15.6",
|
package/package.json
CHANGED