rechrome 1.9.1 → 1.9.2
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/package.json +1 -1
- package/rech.js +9 -4
- package/rech.ts +9 -4
package/package.json
CHANGED
package/rech.js
CHANGED
|
@@ -362,7 +362,7 @@ async function callServe(
|
|
|
362
362
|
process.exit(1);
|
|
363
363
|
});
|
|
364
364
|
if (res.status === 401) {
|
|
365
|
-
console.error(`[rech] rech-client -> rech-server[ok]\n -x: token rejected -> playwright[unknown]`);
|
|
365
|
+
console.error(`[rech] rech-client -> rech-server[ok]\n -x: token rejected (used: ${key.slice(0, 6)}...) -> playwright[unknown]`);
|
|
366
366
|
process.exit(1);
|
|
367
367
|
}
|
|
368
368
|
return res.json();
|
|
@@ -549,13 +549,18 @@ async function setup(opts: { profile?: string } = {}): Promise<void> {
|
|
|
549
549
|
const { host, port, protocol } = parseUrl(url);
|
|
550
550
|
|
|
551
551
|
const { key: serveKey } = parseUrl(url);
|
|
552
|
-
|
|
552
|
+
// First check if server is up at all (unauthenticated root), then verify our key matches
|
|
553
|
+
const anonPing = await fetch(`${protocol}://${host}:${port}/`, { signal: AbortSignal.timeout(2000) }).catch(() => null);
|
|
554
|
+
const authPing = anonPing ? await fetch(`${protocol}://${host}:${port}/ping`, {
|
|
553
555
|
headers: { Authorization: `Bearer ${serveKey}` },
|
|
554
556
|
signal: AbortSignal.timeout(2000),
|
|
555
|
-
}).catch(() => null);
|
|
556
|
-
if (authPing?.ok) {
|
|
557
|
+
}).catch(() => null) : null;
|
|
558
|
+
if (anonPing && authPing?.ok) {
|
|
557
559
|
console.log(` Already running at ${protocol}://${host}:${port} — skipping reinstall`);
|
|
558
560
|
await runOxmgr(["service", "install"]);
|
|
561
|
+
} else if (anonPing && !authPing?.ok) {
|
|
562
|
+
console.log(` Server running but key mismatch — reinstalling with new key`);
|
|
563
|
+
await daemonInstall(url);
|
|
559
564
|
} else {
|
|
560
565
|
await daemonInstall(url);
|
|
561
566
|
console.log(` Registered daemon: ${OXMGR_PROCESS_NAME}`);
|
package/rech.ts
CHANGED
|
@@ -362,7 +362,7 @@ async function callServe(
|
|
|
362
362
|
process.exit(1);
|
|
363
363
|
});
|
|
364
364
|
if (res.status === 401) {
|
|
365
|
-
console.error(`[rech] rech-client -> rech-server[ok]\n -x: token rejected -> playwright[unknown]`);
|
|
365
|
+
console.error(`[rech] rech-client -> rech-server[ok]\n -x: token rejected (used: ${key.slice(0, 6)}...) -> playwright[unknown]`);
|
|
366
366
|
process.exit(1);
|
|
367
367
|
}
|
|
368
368
|
return res.json();
|
|
@@ -549,13 +549,18 @@ async function setup(opts: { profile?: string } = {}): Promise<void> {
|
|
|
549
549
|
const { host, port, protocol } = parseUrl(url);
|
|
550
550
|
|
|
551
551
|
const { key: serveKey } = parseUrl(url);
|
|
552
|
-
|
|
552
|
+
// First check if server is up at all (unauthenticated root), then verify our key matches
|
|
553
|
+
const anonPing = await fetch(`${protocol}://${host}:${port}/`, { signal: AbortSignal.timeout(2000) }).catch(() => null);
|
|
554
|
+
const authPing = anonPing ? await fetch(`${protocol}://${host}:${port}/ping`, {
|
|
553
555
|
headers: { Authorization: `Bearer ${serveKey}` },
|
|
554
556
|
signal: AbortSignal.timeout(2000),
|
|
555
|
-
}).catch(() => null);
|
|
556
|
-
if (authPing?.ok) {
|
|
557
|
+
}).catch(() => null) : null;
|
|
558
|
+
if (anonPing && authPing?.ok) {
|
|
557
559
|
console.log(` Already running at ${protocol}://${host}:${port} — skipping reinstall`);
|
|
558
560
|
await runOxmgr(["service", "install"]);
|
|
561
|
+
} else if (anonPing && !authPing?.ok) {
|
|
562
|
+
console.log(` Server running but key mismatch — reinstalling with new key`);
|
|
563
|
+
await daemonInstall(url);
|
|
559
564
|
} else {
|
|
560
565
|
await daemonInstall(url);
|
|
561
566
|
console.log(` Registered daemon: ${OXMGR_PROCESS_NAME}`);
|