@nubisco/openbridge 0.32.4 → 0.34.0
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/__tests__/avatar-claim.test.d.ts +2 -0
- package/dist/__tests__/avatar-claim.test.d.ts.map +1 -0
- package/dist/__tests__/avatar-claim.test.js +47 -0
- package/dist/__tests__/avatar-claim.test.js.map +1 -0
- package/dist/__tests__/updater.test.d.ts +2 -0
- package/dist/__tests__/updater.test.d.ts.map +1 -0
- package/dist/__tests__/updater.test.js +67 -0
- package/dist/__tests__/updater.test.js.map +1 -0
- package/dist/auth.d.ts +16 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +41 -2
- package/dist/auth.js.map +1 -1
- package/dist/platform-client.d.ts +5 -0
- package/dist/platform-client.d.ts.map +1 -1
- package/dist/platform-client.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +52 -8
- package/dist/server.js.map +1 -1
- package/dist/updater.d.ts +69 -5
- package/dist/updater.d.ts.map +1 -1
- package/dist/updater.js +207 -5
- package/dist/updater.js.map +1 -1
- package/package.json +5 -5
- package/ui-dist/assets/{index-CdTRF5cq.css → index-BAbIn_Li.css} +2 -2
- package/ui-dist/assets/index-CgvH8KsO.js +106 -0
- package/ui-dist/index.html +2 -2
- package/ui-dist/assets/index-CHDfUhDg.js +0 -106
package/dist/updater.js
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* complete. npm is also the mechanism, so there are no per-architecture release
|
|
8
8
|
* tarballs to build and keep in step with the code that downloads them.
|
|
9
9
|
*/
|
|
10
|
-
import { existsSync, readFileSync } from 'fs';
|
|
11
|
-
import { dirname, join, resolve, sep } from 'path';
|
|
10
|
+
import { accessSync, constants, existsSync, readFileSync } from 'fs';
|
|
11
|
+
import { basename, dirname, join, resolve, sep } from 'path';
|
|
12
12
|
import { spawn } from 'child_process';
|
|
13
13
|
import { fileURLToPath } from 'url';
|
|
14
14
|
import { APP_VOLUME } from './version.js';
|
|
@@ -16,6 +16,88 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
|
16
16
|
export const PACKAGE_NAME = '@nubisco/openbridge';
|
|
17
17
|
/** The installed package root, i.e. the directory holding our package.json. */
|
|
18
18
|
export const PACKAGE_ROOT = resolve(__dirname, '..');
|
|
19
|
+
/** Supervisors that restart a service when it exits. */
|
|
20
|
+
const SUPERVISORS = ['supervise-daemon', 'systemd', 'runsv', 's6-supervise', 'runit', 'launchd'];
|
|
21
|
+
/**
|
|
22
|
+
* The name of the process that started this one.
|
|
23
|
+
*
|
|
24
|
+
* Read from `cmdline` first, because `comm` is truncated to fifteen characters
|
|
25
|
+
* by the kernel and OpenRC's `supervise-daemon` lands at sixteen. Comparing the
|
|
26
|
+
* truncated `supervise-daemo` against the real name never matches, which would
|
|
27
|
+
* classify a supervised daemon as unsupervised: it would then leave a process
|
|
28
|
+
* behind to start its replacement while the supervisor started one too, and the
|
|
29
|
+
* second would die on the port the first already holds.
|
|
30
|
+
*
|
|
31
|
+
* The prefix match on the way out covers `comm` when `cmdline` is unreadable,
|
|
32
|
+
* which happens for a parent owned by another user.
|
|
33
|
+
*/
|
|
34
|
+
function parentProcessName() {
|
|
35
|
+
try {
|
|
36
|
+
const argv0 = readFileSync(`/proc/${process.ppid}/cmdline`, 'utf8').split('\0')[0];
|
|
37
|
+
if (argv0)
|
|
38
|
+
return basename(argv0);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
/* no procfs, or unreadable */
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
return readFileSync(`/proc/${process.ppid}/comm`, 'utf8').trim() || null;
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The npm prefix this package is installed under.
|
|
52
|
+
*
|
|
53
|
+
* Derived from where we are actually running rather than from `npm prefix -g`,
|
|
54
|
+
* which reports npm's configured prefix and can name a different tree entirely
|
|
55
|
+
* when the daemon was installed by another user or with a `--prefix` of its
|
|
56
|
+
* own. Updating a copy nobody is running is a convincing no-op.
|
|
57
|
+
*/
|
|
58
|
+
export function globalPrefix() {
|
|
59
|
+
// <prefix>/lib/node_modules/@nubisco/openbridge on POSIX, and
|
|
60
|
+
// <prefix>/node_modules/@nubisco/openbridge on Windows.
|
|
61
|
+
const marker = `${sep}node_modules${sep}`;
|
|
62
|
+
const at = PACKAGE_ROOT.lastIndexOf(marker);
|
|
63
|
+
if (at === -1)
|
|
64
|
+
return null;
|
|
65
|
+
const modules = PACKAGE_ROOT.slice(0, at);
|
|
66
|
+
return modules.endsWith(`${sep}lib`) ? dirname(modules) : modules;
|
|
67
|
+
}
|
|
68
|
+
/** True when this process could actually write the installed package. */
|
|
69
|
+
function canReplacePackage() {
|
|
70
|
+
try {
|
|
71
|
+
accessSync(PACKAGE_ROOT, constants.W_OK);
|
|
72
|
+
accessSync(dirname(PACKAGE_ROOT), constants.W_OK);
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Who, if anyone, restarts this process when it exits.
|
|
81
|
+
*
|
|
82
|
+
* Read from the environment rather than configured, because the daemon is
|
|
83
|
+
* started by whatever the host happens to use and nobody is going to tell it
|
|
84
|
+
* which. Each check identifies a supervisor by something only that supervisor
|
|
85
|
+
* sets.
|
|
86
|
+
*/
|
|
87
|
+
export function detectRestartStrategy() {
|
|
88
|
+
// systemd stamps every service it starts with this, and nothing else does.
|
|
89
|
+
if (process.env.INVOCATION_ID)
|
|
90
|
+
return 'supervisor';
|
|
91
|
+
// A process supervisor as our direct parent, which respawns us on exit.
|
|
92
|
+
const parent = parentProcessName();
|
|
93
|
+
if (parent && SUPERVISORS.some((name) => name === parent || name.startsWith(parent)))
|
|
94
|
+
return 'supervisor';
|
|
95
|
+
// Docker's restart policy brings the container back, and the compose file
|
|
96
|
+
// sets this marker for the same reason the volume exists.
|
|
97
|
+
if (process.env.OPENBRIDGE_INSTALL === 'docker')
|
|
98
|
+
return 'supervisor';
|
|
99
|
+
return 'spawn';
|
|
100
|
+
}
|
|
19
101
|
/** Where a Docker deployment keeps the app tree, outside the image. */
|
|
20
102
|
export const CURRENT_DIR = join(APP_VOLUME, 'current');
|
|
21
103
|
export const STAGING_DIR = join(APP_VOLUME, 'staging');
|
|
@@ -43,19 +125,44 @@ export function detectInstall() {
|
|
|
43
125
|
? `Update OPENBRIDGE_VERSION_SPEC in docker-compose.yml, then: docker compose up -d --force-recreate`
|
|
44
126
|
: 'docker compose restart openbridge',
|
|
45
127
|
pinnedTo: pin,
|
|
128
|
+
restart: 'supervisor',
|
|
129
|
+
...(pin ? { blockedBy: `pinned to ${pin}` } : {}),
|
|
46
130
|
};
|
|
47
131
|
}
|
|
48
132
|
// Under a node_modules means npm or pnpm put it there. Anywhere else means a
|
|
49
133
|
// source checkout being run straight out of dist/.
|
|
50
134
|
if (PACKAGE_ROOT.includes(`${sep}node_modules${sep}`)) {
|
|
135
|
+
const command = `npm install -g ${PACKAGE_NAME}@latest`;
|
|
136
|
+
const restart = detectRestartStrategy();
|
|
137
|
+
// Each of these is a reason the daemon would end up stopped, or would
|
|
138
|
+
// update a copy nobody runs. Naming which one is what turns "it does not
|
|
139
|
+
// work" into something the user can act on.
|
|
140
|
+
let blockedBy = null;
|
|
141
|
+
if (pin)
|
|
142
|
+
blockedBy = `pinned to ${pin}`;
|
|
143
|
+
else if (!globalPrefix())
|
|
144
|
+
blockedBy = 'the install prefix could not be determined';
|
|
145
|
+
else if (!canReplacePackage())
|
|
146
|
+
blockedBy = `no write access to ${PACKAGE_ROOT}`;
|
|
51
147
|
return {
|
|
52
148
|
method: 'npm',
|
|
53
|
-
canSelfUpdate:
|
|
54
|
-
command
|
|
149
|
+
canSelfUpdate: blockedBy === null,
|
|
150
|
+
command,
|
|
55
151
|
pinnedTo: pin,
|
|
152
|
+
restart,
|
|
153
|
+
...(blockedBy ? { blockedBy } : {}),
|
|
56
154
|
};
|
|
57
155
|
}
|
|
58
|
-
|
|
156
|
+
// A source checkout is somebody's working tree. Replacing it from under them
|
|
157
|
+
// would discard whatever they were doing, which no amount of convenience justifies.
|
|
158
|
+
return {
|
|
159
|
+
method: 'source',
|
|
160
|
+
canSelfUpdate: false,
|
|
161
|
+
command: 'git pull && pnpm install && pnpm build',
|
|
162
|
+
pinnedTo: null,
|
|
163
|
+
restart: null,
|
|
164
|
+
blockedBy: 'running from a source checkout',
|
|
165
|
+
};
|
|
59
166
|
}
|
|
60
167
|
/**
|
|
61
168
|
* The newest published version, straight from the registry.
|
|
@@ -133,6 +240,101 @@ export function npmInstall(prefix, version, onLine) {
|
|
|
133
240
|
: reject(new Error(`npm install exited with ${code}${stderr ? `: ${stderr.trim().split('\n').slice(-3).join(' ')}` : ''}`)));
|
|
134
241
|
});
|
|
135
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* Install a version over the running global install.
|
|
245
|
+
*
|
|
246
|
+
* Safe while the daemon is running, which is the whole reason this is possible:
|
|
247
|
+
* every module it needs is already resolved and in memory, and on POSIX the old
|
|
248
|
+
* inode survives until the process releases it. npm writes the new tree and the
|
|
249
|
+
* running process carries on with the old code until something restarts it.
|
|
250
|
+
*
|
|
251
|
+
* The prefix is passed explicitly rather than left to npm's configuration,
|
|
252
|
+
* which can name a different tree than the one this process is running from.
|
|
253
|
+
*/
|
|
254
|
+
export function npmInstallGlobal(prefix, version, onLine) {
|
|
255
|
+
return runNpm([
|
|
256
|
+
'install',
|
|
257
|
+
'--global',
|
|
258
|
+
'--prefix',
|
|
259
|
+
prefix,
|
|
260
|
+
'--omit=optional',
|
|
261
|
+
'--no-audit',
|
|
262
|
+
'--no-fund',
|
|
263
|
+
`${PACKAGE_NAME}@${version}`,
|
|
264
|
+
], onLine);
|
|
265
|
+
}
|
|
266
|
+
/** The version of the package as it exists on disk right now, not as loaded. */
|
|
267
|
+
export function versionOnDisk() {
|
|
268
|
+
try {
|
|
269
|
+
const raw = readFileSync(join(PACKAGE_ROOT, 'package.json'), 'utf8');
|
|
270
|
+
return JSON.parse(raw).version;
|
|
271
|
+
}
|
|
272
|
+
catch {
|
|
273
|
+
return null;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Get the daemon running again on the new code.
|
|
278
|
+
*
|
|
279
|
+
* Under a supervisor, exiting is the entire restart: it is watching for exactly
|
|
280
|
+
* that. Without one, the process has to leave something behind that outlives
|
|
281
|
+
* it, because a child started now would race the parent for the listening port
|
|
282
|
+
* and lose.
|
|
283
|
+
*
|
|
284
|
+
* So the `spawn` path starts a detached process whose only job is to wait for
|
|
285
|
+
* this pid to disappear and then start the daemon again. Detached and with its
|
|
286
|
+
* streams closed, so it is not killed along with its parent and does not hold
|
|
287
|
+
* the terminal open. It is written inline rather than shipped as a file because
|
|
288
|
+
* the update it is waiting on is, at that moment, replacing every file in the
|
|
289
|
+
* package it would otherwise be loaded from.
|
|
290
|
+
*/
|
|
291
|
+
export function restartDaemon(strategy, log) {
|
|
292
|
+
if (strategy === 'spawn') {
|
|
293
|
+
const bin = process.argv[1];
|
|
294
|
+
const waiter = `
|
|
295
|
+
const { spawn } = require('child_process')
|
|
296
|
+
const pid = ${process.pid}
|
|
297
|
+
let waited = 0
|
|
298
|
+
const tick = setInterval(() => {
|
|
299
|
+
let alive = true
|
|
300
|
+
try { process.kill(pid, 0) } catch { alive = false }
|
|
301
|
+
// 30s, then start anyway: a parent that has not exited by now is stuck,
|
|
302
|
+
// and leaving the house without a bridge is the worse outcome.
|
|
303
|
+
if (alive && (waited += 250) < 30000) return
|
|
304
|
+
clearInterval(tick)
|
|
305
|
+
spawn(process.execPath, [${JSON.stringify(bin)}], {
|
|
306
|
+
detached: true,
|
|
307
|
+
stdio: 'ignore',
|
|
308
|
+
env: process.env,
|
|
309
|
+
}).unref()
|
|
310
|
+
}, 250)
|
|
311
|
+
`;
|
|
312
|
+
log?.('No supervisor found, so a detached process will start the new version once this one exits');
|
|
313
|
+
spawn(process.execPath, ['-e', waiter], { detached: true, stdio: 'ignore' }).unref();
|
|
314
|
+
}
|
|
315
|
+
// A moment for the HTTP response and the progress socket to flush, so the
|
|
316
|
+
// page says why it is about to go quiet.
|
|
317
|
+
setTimeout(() => process.exit(0), 500);
|
|
318
|
+
}
|
|
319
|
+
function runNpm(args, onLine) {
|
|
320
|
+
return new Promise((resolvePromise, reject) => {
|
|
321
|
+
const child = spawn(process.execPath, [npmCliPath(), ...args], {
|
|
322
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
323
|
+
env: { ...process.env, NODE_ENV: 'production' },
|
|
324
|
+
});
|
|
325
|
+
let stderr = '';
|
|
326
|
+
child.stdout?.on('data', (b) => onLine?.(b.toString().trim()));
|
|
327
|
+
child.stderr?.on('data', (b) => {
|
|
328
|
+
const text = b.toString();
|
|
329
|
+
stderr += text;
|
|
330
|
+
onLine?.(text.trim());
|
|
331
|
+
});
|
|
332
|
+
child.on('error', reject);
|
|
333
|
+
child.on('close', (code) => code === 0
|
|
334
|
+
? resolvePromise()
|
|
335
|
+
: reject(new Error(`npm exited with ${code}${stderr ? `: ${stderr.trim().split('\n').slice(-3).join(' ')}` : ''}`)));
|
|
336
|
+
});
|
|
337
|
+
}
|
|
136
338
|
/**
|
|
137
339
|
* The npm CLI that ships with the running Node.
|
|
138
340
|
*
|
package/dist/updater.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updater.js","sourceRoot":"","sources":["../src/updater.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"updater.js","sourceRoot":"","sources":["../src/updater.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAA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J,CAAC;AAED;;;;;GAKG;AACH,SAAS,UAAU;IACjB,MAAM,UAAU,GAAG;QACjB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,CAAC;QACxF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU,CAAC;KAChF,CAAA;IACD,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;IACnD,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAA;IAC7G,OAAO,KAAK,CAAA;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nubisco/openbridge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"description": "Local-first home automation bridge for developers. Plugin-based, TypeScript-first, Homebridge-compatible.",
|
|
5
5
|
"author": "José Silva <jose@nubisco.io>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"hap-nodejs": "^0.14.3",
|
|
54
54
|
"qrcode-terminal": "^0.12.0",
|
|
55
55
|
"systeminformation": "^5.31.5",
|
|
56
|
-
"@nubisco/openbridge-
|
|
57
|
-
"@nubisco/openbridge-
|
|
58
|
-
"@nubisco/openbridge-
|
|
59
|
-
"@nubisco/openbridge-
|
|
56
|
+
"@nubisco/openbridge-compatibility-homebridge": "0.34.0",
|
|
57
|
+
"@nubisco/openbridge-config": "0.34.0",
|
|
58
|
+
"@nubisco/openbridge-core": "0.34.0",
|
|
59
|
+
"@nubisco/openbridge-logger": "0.34.0"
|
|
60
60
|
},
|
|
61
61
|
"optionalDependencies": {
|
|
62
62
|
"node-pty": "^1.1.0"
|