mb-service-linux 2.0.1-dev-20260701-117d561 → 2.0.1

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 CHANGED
@@ -24,12 +24,13 @@ If you like this project and find it useful, please consider giving it a star on
24
24
 
25
25
  <a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="120"></a>
26
26
 
27
- ## [2.0.1] - Dev branch
27
+ ## [2.0.1] - 2026-07-01
28
28
 
29
29
  ### Added
30
30
 
31
31
  - [service]: Add path of service file.
32
32
  - [service]: Add Environment PATH to the service file.
33
+ - [service]: Add network-online.target to the service file.
33
34
 
34
35
  <a href="https://www.buymeacoffee.com/luligugithub"><img src="https://matterbridge.io/assets/bmc-button.svg" alt="Buy me a coffee" width="80"></a>
35
36
 
package/README.md CHANGED
@@ -83,10 +83,10 @@ mb-service enable
83
83
  mb-service start
84
84
  ```
85
85
 
86
- When using Bun, create and manage the user-owned service without sudo:
86
+ When using Bun, create and manage the user-owned service without sudo (--bun is mandatory if you have also Node.js installed):
87
87
 
88
88
  ```bash
89
- bunx mb-service create
90
- bunx mb-service enable
91
- bunx mb-service start
89
+ bunx --bun mb-service create
90
+ bunx --bun mb-service enable
91
+ bunx --bun mb-service start
92
92
  ```
package/dist/module.js CHANGED
@@ -1,7 +1,13 @@
1
1
  import { execFileSync, spawnSync } from 'node:child_process';
2
- import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
2
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
3
3
  const HAS_BUN_GLOBAL = typeof Bun !== 'undefined';
4
- const MB_SERVICE_VERSION = '2.0.0';
4
+ const MB_SERVICE_VERSION = getPackageVersion(JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')));
5
+ function getPackageVersion(packageJson) {
6
+ if (typeof packageJson !== 'object' || packageJson === null || !('version' in packageJson) || typeof packageJson.version !== 'string') {
7
+ throw new Error('Could not determine mb-service version from package.json.');
8
+ }
9
+ return packageJson.version;
10
+ }
5
11
  export function isBun() {
6
12
  return HAS_BUN_GLOBAL || typeof process?.versions?.bun === 'string';
7
13
  }
@@ -186,8 +192,8 @@ function createServiceConfig(root) {
186
192
  const user = process.env.SUDO_USER || process.env.USER;
187
193
  const rootConfig = `[Unit]\n` +
188
194
  `Description=matterbridge\n` +
189
- `After=network.target\n` +
190
- `Wants=network.target\n` +
195
+ `After=network-online.target\n` +
196
+ `Wants=network-online.target\n` +
191
197
  `StartLimitIntervalSec=60\n` +
192
198
  `StartLimitBurst=5\n` +
193
199
  `\n` +
@@ -210,8 +216,8 @@ function createServiceConfig(root) {
210
216
  `WantedBy=multi-user.target\n`;
211
217
  const userConfig = `[Unit]\n` +
212
218
  `Description=matterbridge\n` +
213
- `After=network.target\n` +
214
- `Wants=network.target\n` +
219
+ `After=network-online.target\n` +
220
+ `Wants=network-online.target\n` +
215
221
  `StartLimitIntervalSec=60\n` +
216
222
  `StartLimitBurst=5\n` +
217
223
  `\n` +
@@ -222,7 +228,7 @@ function createServiceConfig(root) {
222
228
  `# Absolute paths — systemd has no shell PATH. %h = the user's home.\n` +
223
229
  `# --bun forces the Bun runtime even though the matterbridge bin has a node shebang,\n` +
224
230
  `# and shims any \`node\` the process spawns to Bun as well.\n` +
225
- (isBun() ? `ExecStart=%h/.bun/bin/bun --bun run %h/.bun/bin/matterbridge --service\n` : `ExecStart=matterbridge --service\n`) +
231
+ (isBun() ? `ExecStart=%h/.bun/bin/bun --bun %h/.bun/bin/matterbridge --service\n` : `ExecStart=matterbridge --service\n`) +
226
232
  `WorkingDirectory=%h\n` +
227
233
  `# Logs go to the journal (should be persistent). Read with: journalctl --user -u matterbridge -n 1000 -f --output cat\n` +
228
234
  `StandardOutput=inherit\n` +
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "mb-service-linux",
3
- "version": "2.0.1-dev-20260701-117d561",
3
+ "version": "2.0.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "mb-service-linux",
9
- "version": "2.0.1-dev-20260701-117d561",
9
+ "version": "2.0.1",
10
10
  "license": "Apache-2.0",
11
11
  "bin": {
12
12
  "mb-service": "bin/mb-service"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mb-service-linux",
3
- "version": "2.0.1-dev-20260701-117d561",
3
+ "version": "2.0.1",
4
4
  "description": "Matterbridge service command line interface",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",