rechrome 1.40.0 → 1.42.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/README.md +19 -0
- package/fill-secret.js +108 -0
- package/fill-secret.ts +97 -1
- package/listeners.js +6 -2
- package/listeners.ts +6 -3
- package/package.json +5 -2
- package/rechrome.js +52 -14
- package/rechrome.ts +52 -14
- package/redact.js +236 -0
- package/redact.ts +242 -0
- package/scoped-upload.js +4 -3
- package/scoped-upload.ts +6 -3
- package/secret-rules/gitleaks.LICENSE +21 -0
- package/secret-rules/gitleaks.toml +3209 -0
- package/serve.js +18 -1
- package/serve.ts +18 -1
package/README.md
CHANGED
|
@@ -97,6 +97,25 @@ browser writes it, not before (downloads wait for the scrub). The check reads th
|
|
|
97
97
|
the snapshot, so a page script that clears or replaces a neutrally-labelled password field in
|
|
98
98
|
between can slip past; closing that needs redaction inside playwright's snapshot code. Not yet supported on a Windows daemon.
|
|
99
99
|
|
|
100
|
+
#### Copying a secret out of a page: `read-secret`
|
|
101
|
+
|
|
102
|
+
The reverse of `fill-secret`, for moving a secret that a page shows (an app's signing
|
|
103
|
+
secret, an API key) into a vault without it appearing anywhere:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
rech read-secret e12 --allow-domain api.example.com | vault-put my-app/signing-secret
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
- `--allow-domain` is required. The field's own page host must match it.
|
|
110
|
+
- The value goes back in its own response field. It is never in a log line, a file or
|
|
111
|
+
another command's output, and is masked in every later output.
|
|
112
|
+
- stdout must be a pipe: a terminal or a file redirect is refused before the host is asked.
|
|
113
|
+
- A label ref means its input, as with `fill`. A non-field element gives its text.
|
|
114
|
+
- On a shared (scoped) listener it is off until the host runs
|
|
115
|
+
`rech listener set <listener> --read-secrets`. Each read is logged without the value.
|
|
116
|
+
Turn it on only for links you trust with every account in their profiles: the caller picks
|
|
117
|
+
`--allow-domain`, so the link can read any field it can reach, saved passwords included.
|
|
118
|
+
|
|
100
119
|
### 3. Where things are kept
|
|
101
120
|
|
|
102
121
|
| Where | What |
|
package/fill-secret.js
CHANGED
|
@@ -332,6 +332,108 @@ async function runCodeOnSession(opts) {
|
|
|
332
332
|
function fillSecretOnSession(opts) {
|
|
333
333
|
return runCodeOnSession({ ...opts, code: buildFillCode(opts.ref, opts.value, opts.allowDomains, opts.submit) });
|
|
334
334
|
}
|
|
335
|
+
var READ_SECRET_USAGE = `Usage: rech read-secret <ref|selector> --allow-domain <glob> [--allow-domain <glob>]... | <vault command>
|
|
336
|
+
Writes the field's current value, raw and without a newline, to stdout, which must be a pipe
|
|
337
|
+
into the program that stores it (never a terminal or a file). The value is never logged and
|
|
338
|
+
is masked in later outputs.
|
|
339
|
+
--allow-domain GLOB required: refuse unless the field's page host matches, e.g. app.slack.com`;
|
|
340
|
+
function parseReadSecretArgs(args) {
|
|
341
|
+
const [cmd, ...rest] = args;
|
|
342
|
+
if (cmd !== "read-secret")
|
|
343
|
+
throw new Error("Expected read-secret");
|
|
344
|
+
let ref;
|
|
345
|
+
const allowDomains = [];
|
|
346
|
+
for (let i = 0;i < rest.length; i++) {
|
|
347
|
+
const a = rest[i];
|
|
348
|
+
if (a === "--allow-domain" || a.startsWith("--allow-domain=")) {
|
|
349
|
+
const v = a === "--allow-domain" ? rest[++i] : a.slice("--allow-domain=".length);
|
|
350
|
+
if (!v)
|
|
351
|
+
throw new Error("--allow-domain got an empty host");
|
|
352
|
+
for (const d of v.split(",")) {
|
|
353
|
+
domainGlobToRegExp(d.trim());
|
|
354
|
+
allowDomains.push(d.trim());
|
|
355
|
+
}
|
|
356
|
+
} else if (a.startsWith("-"))
|
|
357
|
+
throw new Error(`read-secret: unknown option ${a}`);
|
|
358
|
+
else if (ref === undefined)
|
|
359
|
+
ref = a;
|
|
360
|
+
else
|
|
361
|
+
throw new Error("read-secret takes one target");
|
|
362
|
+
}
|
|
363
|
+
if (!ref)
|
|
364
|
+
throw new Error("read-secret needs a target ref (from rech snapshot) or a selector");
|
|
365
|
+
if (!allowDomains.length)
|
|
366
|
+
throw new Error("read-secret needs --allow-domain: name the site the secret must come from");
|
|
367
|
+
return { ref, allowDomains };
|
|
368
|
+
}
|
|
369
|
+
function readSecretWireArgs(req) {
|
|
370
|
+
return ["read-secret", req.ref, ...req.allowDomains.map((d) => `--allow-domain=${d}`)];
|
|
371
|
+
}
|
|
372
|
+
function parseReadSecretWire(args) {
|
|
373
|
+
const [cmd, ref, ...rest] = args;
|
|
374
|
+
if (cmd !== "read-secret" || !ref || ref.startsWith("-"))
|
|
375
|
+
throw new Error("read-secret needs a target ref");
|
|
376
|
+
const allowDomains = [];
|
|
377
|
+
for (const a of rest) {
|
|
378
|
+
if (!a.startsWith("--allow-domain="))
|
|
379
|
+
throw new Error(`read-secret: unexpected argument ${a.startsWith("-") ? a : "(positional)"}`);
|
|
380
|
+
const d = a.slice("--allow-domain=".length);
|
|
381
|
+
domainGlobToRegExp(d);
|
|
382
|
+
allowDomains.push(d);
|
|
383
|
+
}
|
|
384
|
+
if (!allowDomains.length)
|
|
385
|
+
throw new Error("read-secret needs --allow-domain");
|
|
386
|
+
return { ref, allowDomains };
|
|
387
|
+
}
|
|
388
|
+
function buildReadCode(ref, allowDomains) {
|
|
389
|
+
const patterns = allowDomains.map((d) => domainGlobToRegExp(d).source);
|
|
390
|
+
const locator = /^(f\d+)?e\d+$/.test(ref) ? `page.locator(${JSON.stringify(`aria-ref=${ref}`)})` : `page.locator(${JSON.stringify(ref)})`;
|
|
391
|
+
return `async page => {
|
|
392
|
+
const el = await ${locator}.elementHandle({ timeout: 10000 });
|
|
393
|
+
try {
|
|
394
|
+
const host = String(await el.evaluate(e => e.ownerDocument.location.hostname)).toLowerCase();
|
|
395
|
+
const allowed = ${JSON.stringify(patterns)};
|
|
396
|
+
if (!allowed.some(p => new RegExp(p, "i").test(host)))
|
|
397
|
+
throw new Error("read-secret refused: the field's page host " + JSON.stringify(host) + " is not allowed by --allow-domain");
|
|
398
|
+
// Like fill: a label ref means its control. A field reads as its value; anything else (a
|
|
399
|
+
// secret shown as text after "Show") as its text.
|
|
400
|
+
// A page getter can throw an error that quotes the value: report a fixed message instead.
|
|
401
|
+
let value;
|
|
402
|
+
try {
|
|
403
|
+
value = await el.evaluate(e => {
|
|
404
|
+
const t = e.tagName === "LABEL" && e.control ? e.control : e;
|
|
405
|
+
return t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.tagName === "SELECT" ? String(t.value) : String(t.textContent ?? "").trim();
|
|
406
|
+
});
|
|
407
|
+
} catch { throw new Error("read-secret: could not read the field"); }
|
|
408
|
+
return JSON.stringify({ host, value });
|
|
409
|
+
} finally {
|
|
410
|
+
await el.dispose().catch(() => {});
|
|
411
|
+
}
|
|
412
|
+
}`;
|
|
413
|
+
}
|
|
414
|
+
async function readSecretOnSession(opts) {
|
|
415
|
+
const { isError, text } = await runCodeOnSession({ ...opts, code: buildReadCode(opts.ref, opts.allowDomains), json: true });
|
|
416
|
+
if (isError)
|
|
417
|
+
throw new Error(text.match(/read-secret refused: [^\n]*/)?.[0] ?? (/no browser is open|could not reach/.test(text) ? text.trim().split(`
|
|
418
|
+
`)[0] : "read-secret: could not read the field (is the ref from a fresh rech snapshot?)"));
|
|
419
|
+
let raw;
|
|
420
|
+
try {
|
|
421
|
+
raw = JSON.parse(text).result;
|
|
422
|
+
} catch {
|
|
423
|
+
raw = text.match(/### Result\n([^\n]*)/)?.[1];
|
|
424
|
+
}
|
|
425
|
+
let out = raw;
|
|
426
|
+
for (let i = 0;i < 2 && typeof out === "string"; i++) {
|
|
427
|
+
try {
|
|
428
|
+
out = JSON.parse(out);
|
|
429
|
+
} catch {
|
|
430
|
+
out = undefined;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
if (!out || typeof out.host !== "string" || typeof out.value !== "string")
|
|
434
|
+
throw new Error("read-secret: the page returned no value");
|
|
435
|
+
return out;
|
|
436
|
+
}
|
|
335
437
|
var PASSWORD_FIELDS = 'input[type=password], input[autocomplete~="current-password" i], input[autocomplete~="new-password" i], input[name*="pass" i], input[id*="pass" i]';
|
|
336
438
|
var PASSWORD_VALUES_CODE = `async page => {
|
|
337
439
|
const values = [];
|
|
@@ -381,11 +483,13 @@ function maskPasswordLines(text) {
|
|
|
381
483
|
export {
|
|
382
484
|
FILL_SECRET_USAGE,
|
|
383
485
|
MIN_MASK_LENGTH,
|
|
486
|
+
READ_SECRET_USAGE,
|
|
384
487
|
SECRET_MASK,
|
|
385
488
|
SECRET_MASK_TTL_MS,
|
|
386
489
|
SecretMasker,
|
|
387
490
|
base32Decode,
|
|
388
491
|
buildFillCode,
|
|
492
|
+
buildReadCode,
|
|
389
493
|
daemonSessionSockets,
|
|
390
494
|
domainGlobToRegExp,
|
|
391
495
|
fillSecretOnSession,
|
|
@@ -397,9 +501,13 @@ export {
|
|
|
397
501
|
parseDotenv,
|
|
398
502
|
parseFillSecretArgs,
|
|
399
503
|
parseFillSecretWire,
|
|
504
|
+
parseReadSecretArgs,
|
|
505
|
+
parseReadSecretWire,
|
|
400
506
|
parseScanResult,
|
|
401
507
|
passwordValuesOnSession,
|
|
508
|
+
readSecretOnSession,
|
|
402
509
|
readSecretSource,
|
|
510
|
+
readSecretWireArgs,
|
|
403
511
|
runCodeOnSession,
|
|
404
512
|
sessionSocketCandidates,
|
|
405
513
|
socketRequest,
|
package/fill-secret.ts
CHANGED
|
@@ -21,7 +21,8 @@ export const SECRET_MASK = "***";
|
|
|
21
21
|
export const SECRET_MASK_TTL_MS = 15 * 60_000;
|
|
22
22
|
/** Shorter values are never masked: masking "1" everywhere would turn every 1 in every output
|
|
23
23
|
* into ***, corrupting ids and refs for the daemon's lifetime. A TOTP code (6 digits) still is.
|
|
24
|
-
*
|
|
24
|
+
* A short value is kept out of fill-secret's own reply by dropping the echoed code that holds it,
|
|
25
|
+
* and out of its error message by an exact replace; anything the page itself shows is not masked. */
|
|
25
26
|
export const MIN_MASK_LENGTH = 6;
|
|
26
27
|
export const maskable = (value: string | undefined | null): value is string => !!value && value.length >= MIN_MASK_LENGTH;
|
|
27
28
|
|
|
@@ -347,6 +348,101 @@ export function fillSecretOnSession(opts: { socketRoot: string; session: string;
|
|
|
347
348
|
return runCodeOnSession({ ...opts, code: buildFillCode(opts.ref, opts.value, opts.allowDomains, opts.submit) });
|
|
348
349
|
}
|
|
349
350
|
|
|
351
|
+
// ---------- read-secret: a field's value to a pipe ----------
|
|
352
|
+
//
|
|
353
|
+
// The reverse of fill-secret, for moving a secret a page shows (an API signing secret in a
|
|
354
|
+
// password-type field) into a vault without it appearing anywhere. The page host must match a
|
|
355
|
+
// required --allow-domain; the value travels only in the response's `secretOut` field, is never
|
|
356
|
+
// logged, is masked in every later output, and the client writes it raw to a pipe only, never
|
|
357
|
+
// to a terminal. On a profile-scoped listener it is refused unless the host turned it on.
|
|
358
|
+
|
|
359
|
+
export const READ_SECRET_USAGE = `Usage: rech read-secret <ref|selector> --allow-domain <glob> [--allow-domain <glob>]... | <vault command>
|
|
360
|
+
Writes the field's current value, raw and without a newline, to stdout, which must be a pipe
|
|
361
|
+
into the program that stores it (never a terminal or a file). The value is never logged and
|
|
362
|
+
is masked in later outputs.
|
|
363
|
+
--allow-domain GLOB required: refuse unless the field's page host matches, e.g. app.slack.com`;
|
|
364
|
+
|
|
365
|
+
/** Client args → the wire args (same shape); --allow-domain is required. */
|
|
366
|
+
export function parseReadSecretArgs(args: string[]): { ref: string; allowDomains: string[] } {
|
|
367
|
+
const [cmd, ...rest] = args;
|
|
368
|
+
if (cmd !== "read-secret") throw new Error("Expected read-secret");
|
|
369
|
+
let ref: string | undefined;
|
|
370
|
+
const allowDomains: string[] = [];
|
|
371
|
+
for (let i = 0; i < rest.length; i++) {
|
|
372
|
+
const a = rest[i]!;
|
|
373
|
+
if (a === "--allow-domain" || a.startsWith("--allow-domain=")) {
|
|
374
|
+
const v = a === "--allow-domain" ? rest[++i] : a.slice("--allow-domain=".length);
|
|
375
|
+
if (!v) throw new Error("--allow-domain got an empty host");
|
|
376
|
+
for (const d of v.split(",")) { domainGlobToRegExp(d.trim()); allowDomains.push(d.trim()); }
|
|
377
|
+
} else if (a.startsWith("-")) throw new Error(`read-secret: unknown option ${a}`);
|
|
378
|
+
else if (ref === undefined) ref = a;
|
|
379
|
+
else throw new Error("read-secret takes one target");
|
|
380
|
+
}
|
|
381
|
+
if (!ref) throw new Error("read-secret needs a target ref (from rech snapshot) or a selector");
|
|
382
|
+
if (!allowDomains.length) throw new Error("read-secret needs --allow-domain: name the site the secret must come from");
|
|
383
|
+
return { ref, allowDomains };
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
export function readSecretWireArgs(req: { ref: string; allowDomains: string[] }): string[] {
|
|
387
|
+
return ["read-secret", req.ref, ...req.allowDomains.map(d => `--allow-domain=${d}`)];
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/** Parse what the daemon received; exactly the shape readSecretWireArgs sends. */
|
|
391
|
+
export function parseReadSecretWire(args: string[]): { ref: string; allowDomains: string[] } {
|
|
392
|
+
const [cmd, ref, ...rest] = args;
|
|
393
|
+
if (cmd !== "read-secret" || !ref || ref.startsWith("-")) throw new Error("read-secret needs a target ref");
|
|
394
|
+
const allowDomains: string[] = [];
|
|
395
|
+
for (const a of rest) {
|
|
396
|
+
if (!a.startsWith("--allow-domain=")) throw new Error(`read-secret: unexpected argument ${a.startsWith("-") ? a : "(positional)"}`);
|
|
397
|
+
const d = a.slice("--allow-domain=".length);
|
|
398
|
+
domainGlobToRegExp(d);
|
|
399
|
+
allowDomains.push(d);
|
|
400
|
+
}
|
|
401
|
+
if (!allowDomains.length) throw new Error("read-secret needs --allow-domain");
|
|
402
|
+
return { ref, allowDomains };
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/** run-code that checks the field's own document host, then returns {host, value} as JSON. */
|
|
406
|
+
export function buildReadCode(ref: string, allowDomains: string[]): string {
|
|
407
|
+
const patterns = allowDomains.map(d => domainGlobToRegExp(d).source);
|
|
408
|
+
const locator = /^(f\d+)?e\d+$/.test(ref) ? `page.locator(${JSON.stringify(`aria-ref=${ref}`)})` : `page.locator(${JSON.stringify(ref)})`;
|
|
409
|
+
return `async page => {
|
|
410
|
+
const el = await ${locator}.elementHandle({ timeout: 10000 });
|
|
411
|
+
try {
|
|
412
|
+
const host = String(await el.evaluate(e => e.ownerDocument.location.hostname)).toLowerCase();
|
|
413
|
+
const allowed = ${JSON.stringify(patterns)};
|
|
414
|
+
if (!allowed.some(p => new RegExp(p, "i").test(host)))
|
|
415
|
+
throw new Error("read-secret refused: the field's page host " + JSON.stringify(host) + " is not allowed by --allow-domain");
|
|
416
|
+
// Like fill: a label ref means its control. A field reads as its value; anything else (a
|
|
417
|
+
// secret shown as text after "Show") as its text.
|
|
418
|
+
// A page getter can throw an error that quotes the value: report a fixed message instead.
|
|
419
|
+
let value;
|
|
420
|
+
try {
|
|
421
|
+
value = await el.evaluate(e => {
|
|
422
|
+
const t = e.tagName === "LABEL" && e.control ? e.control : e;
|
|
423
|
+
return t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.tagName === "SELECT" ? String(t.value) : String(t.textContent ?? "").trim();
|
|
424
|
+
});
|
|
425
|
+
} catch { throw new Error("read-secret: could not read the field"); }
|
|
426
|
+
return JSON.stringify({ host, value });
|
|
427
|
+
} finally {
|
|
428
|
+
await el.dispose().catch(() => {});
|
|
429
|
+
}
|
|
430
|
+
}`;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/** Read the field on the session's live browser. The returned value must never be logged. */
|
|
434
|
+
export async function readSecretOnSession(opts: { socketRoot: string; session: string; cwd: string; ref: string; allowDomains: string[] }): Promise<{ host: string; value: string }> {
|
|
435
|
+
const { isError, text } = await runCodeOnSession({ ...opts, code: buildReadCode(opts.ref, opts.allowDomains), json: true });
|
|
436
|
+
// Pass on only the messages this code writes itself (they hold the host, never the value).
|
|
437
|
+
if (isError) throw new Error(text.match(/read-secret refused: [^\n]*/)?.[0] ?? (/no browser is open|could not reach/.test(text) ? text.trim().split("\n")[0]! : "read-secret: could not read the field (is the ref from a fresh rech snapshot?)"));
|
|
438
|
+
let raw: unknown;
|
|
439
|
+
try { raw = JSON.parse(text).result; } catch { raw = text.match(/### Result\n([^\n]*)/)?.[1]; }
|
|
440
|
+
let out: any = raw;
|
|
441
|
+
for (let i = 0; i < 2 && typeof out === "string"; i++) { try { out = JSON.parse(out); } catch { out = undefined; } }
|
|
442
|
+
if (!out || typeof out.host !== "string" || typeof out.value !== "string") throw new Error("read-secret: the page returned no value");
|
|
443
|
+
return out;
|
|
444
|
+
}
|
|
445
|
+
|
|
350
446
|
// ---------- password fields in snapshots ----------
|
|
351
447
|
//
|
|
352
448
|
// Snapshots print every input's value, and that includes password fields Chrome autofilled
|
package/listeners.js
CHANGED
|
@@ -76,6 +76,8 @@ function validateListeners(value) {
|
|
|
76
76
|
}
|
|
77
77
|
if (l.uploads !== undefined && l.uploads !== false)
|
|
78
78
|
validateUploadPolicy(l.uploads);
|
|
79
|
+
if (l.readSecrets !== undefined && typeof l.readSecrets !== "boolean")
|
|
80
|
+
throw new Error("readSecrets must be true or false");
|
|
79
81
|
const address = listenerAddress(l);
|
|
80
82
|
if (names.has(l.name) || addresses.has(address) || keys.has(l.key))
|
|
81
83
|
throw new Error("Listener names, addresses, and credentials must be unique");
|
|
@@ -130,9 +132,11 @@ function authorizeProfileRequest(listener, body) {
|
|
|
130
132
|
const args = body.args.filter((a) => /^-s=[a-zA-Z0-9_-]{1,64}$/.test(a) === false);
|
|
131
133
|
if (args[0] === "upload" && listener.uploads === false)
|
|
132
134
|
throw new Error(`Uploads are off on listener "${listener.name}". The host can turn them on: rech listener set ${listener.name} --uploads`);
|
|
133
|
-
if (args[0]
|
|
135
|
+
if (args[0] === "read-secret" && listener.readSecrets !== true)
|
|
136
|
+
throw new Error(`read-secret is off on listener "${listener.name}". The host can turn it on: rech listener set ${listener.name} --read-secrets`);
|
|
137
|
+
if (args[0] !== "upload" && args[0] !== "read-secret" && !SCOPED_COMMANDS.has(args[0]))
|
|
134
138
|
throw new Error("Command is unavailable on profile-scoped listeners; use the local management listener for arbitrary code or host access");
|
|
135
|
-
if (body.args.filter((a) => a.startsWith("-s=")).length > 1 || args.slice(1).some((a) => a.startsWith("-") && !(args[0] === "screenshot" && a === "--full-page") && !(args[0] === "console" && a === "--clear") && !(args[0] === "fill-secret" && (a === "--submit" || a === "--totp" || a.startsWith("--allow-domain=")))))
|
|
139
|
+
if (body.args.filter((a) => a.startsWith("-s=")).length > 1 || args.slice(1).some((a) => a.startsWith("-") && !(args[0] === "screenshot" && a === "--full-page") && !(args[0] === "console" && a === "--clear") && !(args[0] === "fill-secret" && (a === "--submit" || a === "--totp" || a.startsWith("--allow-domain="))) && !(args[0] === "read-secret" && a.startsWith("--allow-domain="))))
|
|
136
140
|
throw new Error("CLI option overrides are unavailable on profile-scoped listeners");
|
|
137
141
|
if (["open", "goto", "tab-new"].includes(args[0]) && args[1] && !/^https?:\/\//i.test(args[1]) && args[1] !== "about:blank")
|
|
138
142
|
throw new Error("Scoped navigation accepts only HTTP(S) or about:blank");
|
package/listeners.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { join } from "path";
|
|
|
6
6
|
import { mkdir, readFile, rename, writeFile } from "fs/promises";
|
|
7
7
|
|
|
8
8
|
// publicUrl: where a reverse proxy (Tailscale Serve, Caddy, nginx, ...) exposes this listener.
|
|
9
|
-
export type Listener = { name: string; host: string; port: number; key: string; profiles: string[] | "*"; prefix?: string; publicUrl?: string; uploads?: UploadPolicy | false };
|
|
9
|
+
export type Listener = { name: string; host: string; port: number; key: string; profiles: string[] | "*"; prefix?: string; publicUrl?: string; uploads?: UploadPolicy | false; readSecrets?: boolean };
|
|
10
10
|
// retiredPorts: ports of removed listeners, newest last. New listeners skip them so a link
|
|
11
11
|
// saved for a removed listener gets "connection refused", not some other listener's answer.
|
|
12
12
|
export type ListenerConfig = { version: 1; listeners: Listener[]; retiredPorts?: number[] };
|
|
@@ -61,6 +61,7 @@ export function validateListeners(value: unknown): ListenerConfig {
|
|
|
61
61
|
// Uploads are on unless set to false: the client sends file bytes it already has, and the
|
|
62
62
|
// host never reads a path for them.
|
|
63
63
|
if (l.uploads !== undefined && l.uploads !== false) validateUploadPolicy(l.uploads);
|
|
64
|
+
if (l.readSecrets !== undefined && typeof l.readSecrets !== "boolean") throw new Error("readSecrets must be true or false");
|
|
64
65
|
const address = listenerAddress(l);
|
|
65
66
|
if (names.has(l.name) || addresses.has(address) || keys.has(l.key)) throw new Error("Listener names, addresses, and credentials must be unique");
|
|
66
67
|
names.add(l.name); addresses.add(address); keys.add(l.key);
|
|
@@ -107,8 +108,10 @@ export function authorizeProfileRequest(listener: Listener, body: any): string {
|
|
|
107
108
|
const args = body.args.filter((a: string) => /^-s=[a-zA-Z0-9_-]{1,64}$/.test(a) === false);
|
|
108
109
|
if (args[0] === "upload" && listener.uploads === false)
|
|
109
110
|
throw new Error(`Uploads are off on listener "${listener.name}". The host can turn them on: rech listener set ${listener.name} --uploads`);
|
|
110
|
-
if (args[0]
|
|
111
|
-
|
|
111
|
+
if (args[0] === "read-secret" && listener.readSecrets !== true)
|
|
112
|
+
throw new Error(`read-secret is off on listener "${listener.name}". The host can turn it on: rech listener set ${listener.name} --read-secrets`);
|
|
113
|
+
if (args[0] !== "upload" && args[0] !== "read-secret" && !SCOPED_COMMANDS.has(args[0])) throw new Error("Command is unavailable on profile-scoped listeners; use the local management listener for arbitrary code or host access");
|
|
114
|
+
if (body.args.filter((a: string) => a.startsWith("-s=")).length > 1 || args.slice(1).some((a: string) => a.startsWith("-") && !(args[0] === "screenshot" && a === "--full-page") && !(args[0] === "console" && a === "--clear") && !(args[0] === "fill-secret" && (a === "--submit" || a === "--totp" || a.startsWith("--allow-domain="))) && !(args[0] === "read-secret" && a.startsWith("--allow-domain=")))) throw new Error("CLI option overrides are unavailable on profile-scoped listeners");
|
|
112
115
|
if (["open", "goto", "tab-new"].includes(args[0]) && args[1] && !/^https?:\/\//i.test(args[1]) && args[1] !== "about:blank") throw new Error("Scoped navigation accepts only HTTP(S) or about:blank");
|
|
113
116
|
// Upload is handled by the byte-only receiver; the caller cannot supply host paths.
|
|
114
117
|
if (args[0] === "upload" && (args.length !== 1 || !body.upload)) throw new Error("Upload requires stdin bytes; host paths are unavailable");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rechrome",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.42.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/snomiao/rechrome.git"
|
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
"listeners.js",
|
|
24
24
|
"fill-secret.ts",
|
|
25
25
|
"fill-secret.js",
|
|
26
|
+
"redact.ts",
|
|
27
|
+
"redact.js",
|
|
28
|
+
"secret-rules",
|
|
26
29
|
"extension",
|
|
27
30
|
"rechrome.js",
|
|
28
31
|
"rechrome.ts",
|
|
@@ -50,7 +53,7 @@
|
|
|
50
53
|
"vendor-cli": "bash scripts/vendor-cli.sh",
|
|
51
54
|
"prepare": "bash scripts/vendor-cli.sh --prepare",
|
|
52
55
|
"check-pack": "bash scripts/check-pack.sh",
|
|
53
|
-
"prepublishOnly": "bash scripts/vendor-cli.sh && sed 's/\\.ts/\\.js/g' rechrome.ts > rechrome.js && sed 's/\\.ts/\\.js/g' serve.ts > serve.js && bun build extension-token.ts --target=bun --outfile=extension-token.js && bun build daemon-manager.ts --target=bun --outfile=daemon-manager.js && bun build listeners.ts --target=bun --outfile=listeners.js && bun build fill-secret.ts --target=bun --outfile=fill-secret.js && bun build scoped-upload.ts --target=bun --outfile=scoped-upload.js && bun build secret.ts --target=bun --external node-datachannel --outfile=secret.js && bun build shares.ts --target=bun --external node-datachannel --outfile=shares.js && bun build e2e.ts --target=bun --external node-datachannel --outfile=e2e.js && bun build webrtc.ts --target=bun --external node-datachannel --outfile=webrtc.js && bun build signal-relay.ts --target=bun --external node-datachannel --outfile=signal-relay.js && bash scripts/check-pack.sh"
|
|
56
|
+
"prepublishOnly": "bash scripts/vendor-cli.sh && sed 's/\\.ts/\\.js/g' rechrome.ts > rechrome.js && sed 's/\\.ts/\\.js/g' serve.ts > serve.js && bun build extension-token.ts --target=bun --outfile=extension-token.js && bun build daemon-manager.ts --target=bun --outfile=daemon-manager.js && bun build listeners.ts --target=bun --outfile=listeners.js && bun build fill-secret.ts --target=bun --outfile=fill-secret.js && bun build scoped-upload.ts --target=bun --outfile=scoped-upload.js && bun build secret.ts --target=bun --external node-datachannel --outfile=secret.js && bun build shares.ts --target=bun --external node-datachannel --outfile=shares.js && bun build e2e.ts --target=bun --external node-datachannel --outfile=e2e.js && bun build webrtc.ts --target=bun --external node-datachannel --outfile=webrtc.js && bun build signal-relay.ts --target=bun --external node-datachannel --outfile=signal-relay.js && bun build redact.ts --target=bun --outfile=redact.js && bash scripts/check-pack.sh"
|
|
54
57
|
},
|
|
55
58
|
"devDependencies": {
|
|
56
59
|
"@types/bun": "latest",
|
package/rechrome.js
CHANGED
|
@@ -5,9 +5,10 @@ import { readListeners, writeListeners as writeListenersFile, listenerAddress, i
|
|
|
5
5
|
import { file } from "bun";
|
|
6
6
|
import yargs from "yargs";
|
|
7
7
|
import { readExtensionTokenFromProfile } from "./extension-token.js";
|
|
8
|
-
import {
|
|
8
|
+
import { redact } from "./redact.js";
|
|
9
|
+
import { READ_SECRET_USAGE, parseReadSecretArgs, readSecretWireArgs, FILL_SECRET_USAGE, SECRET_MASK, parseFillSecretArgs, fillSecretWireArgs, readSecretSource, totpCode, totpWaitMs } from "./fill-secret.js";
|
|
9
10
|
import { createHash, randomBytes } from "crypto";
|
|
10
|
-
import { mkdirSync, appendFileSync, existsSync, realpathSync, accessSync, cpSync, unlinkSync, readFileSync, readdirSync, renameSync, readlinkSync, rmdirSync, constants as fsConstants } from "fs";
|
|
11
|
+
import { mkdirSync, fstatSync, appendFileSync, existsSync, realpathSync, accessSync, cpSync, unlinkSync, readFileSync, readdirSync, renameSync, readlinkSync, rmdirSync, constants as fsConstants } from "fs";
|
|
11
12
|
import { hostname, homedir, networkInterfaces } from "os";
|
|
12
13
|
import { isIPv4 } from "net";
|
|
13
14
|
import { join, basename, dirname, resolve } from "path";
|
|
@@ -642,7 +643,7 @@ export async function getOrCreateUrl(persist = true): Promise<string> {
|
|
|
642
643
|
const envRaw = await file(globalEnvFile).text().catch(() => "");
|
|
643
644
|
const lines = envRaw.trimEnd().split("\n").filter(l => !l.startsWith(`${ENV_KEY}=`));
|
|
644
645
|
const content = [...lines, newLine, ""].join("\n");
|
|
645
|
-
await
|
|
646
|
+
await writeAtomic(globalEnvFile, content, 0o600); // holds the management key
|
|
646
647
|
}
|
|
647
648
|
process.env[ENV_KEY] = url;
|
|
648
649
|
return url;
|
|
@@ -1779,7 +1780,7 @@ async function printProfileUri(selector?: string, listener?: string, opts: { loc
|
|
|
1779
1780
|
if (!picked.startsWith(SETUP)) return picked;
|
|
1780
1781
|
const dir = picked.slice(SETUP.length);
|
|
1781
1782
|
console.error(`[rech] ${dir} isn't set up yet; running rech setup --profile ${JSON.stringify(dir)} first.`);
|
|
1782
|
-
await setup({ profile: dir });
|
|
1783
|
+
await setup({ profile: dir, skipShare: true });
|
|
1783
1784
|
const after = await readTokenRegistry();
|
|
1784
1785
|
const key = unregisteredChromeProfiles(after, { [dir]: {} }).length ? undefined : canonicalProfileKeys(after).find(k => after[k].profileDir === dir);
|
|
1785
1786
|
if (process.exitCode || !key) throw new Error(`Setup didn't register ${dir}; nothing shared. Retry with: rech setup --profile ${JSON.stringify(dir)}`);
|
|
@@ -1931,7 +1932,7 @@ async function callServe(
|
|
|
1931
1932
|
throwOnFailure = false,
|
|
1932
1933
|
upload?: UploadPayload,
|
|
1933
1934
|
secret?: string,
|
|
1934
|
-
): Promise<{ status: number; stdout: string; stderr: string; files?: string[]; existingSession?: boolean }> {
|
|
1935
|
+
): Promise<{ status: number; stdout: string; stderr: string; files?: string[]; existingSession?: boolean; secretOut?: string }> {
|
|
1935
1936
|
const { key, host, port, protocol, extensionId, extensionToken, profileDirectory, userDataDir, loadExtension } = parseUrl(url);
|
|
1936
1937
|
// Reuse the caller's identity when provided — computing it shells out to `git` several times,
|
|
1937
1938
|
// and run() has already done so for its log line. Recomputing here would double those git
|
|
@@ -2168,6 +2169,29 @@ async function run(url: string, args: string[], overrideEnv?: Record<string, str
|
|
|
2168
2169
|
let secret: string | undefined;
|
|
2169
2170
|
let upload: UploadPayload | undefined;
|
|
2170
2171
|
const cmdIdx = args.findIndex(a => !a.startsWith("-s="));
|
|
2172
|
+
if (args[cmdIdx] === "read-secret") {
|
|
2173
|
+
if (args.some(a => a === "--help" || a === "-h")) { console.log(READ_SECRET_USAGE); process.exit(0); }
|
|
2174
|
+
let wire: string[];
|
|
2175
|
+
try {
|
|
2176
|
+
// Only a pipe: a terminal would show the secret, and a file would keep it. Checked before
|
|
2177
|
+
// asking the host for it.
|
|
2178
|
+
const out = fstatSync(1);
|
|
2179
|
+
if (!out.isFIFO() && !out.isSocket()) throw new Error("read-secret writes the secret to stdout, which must be a pipe into the program that stores it (not a terminal or a file)");
|
|
2180
|
+
wire = readSecretWireArgs(parseReadSecretArgs(args.slice(cmdIdx)));
|
|
2181
|
+
} catch (err) {
|
|
2182
|
+
console.error(`[rech] ${err instanceof Error ? err.message : String(err)}\n${READ_SECRET_USAGE}`);
|
|
2183
|
+
process.exit(2);
|
|
2184
|
+
}
|
|
2185
|
+
const res = await callServe(url, [...args.filter(a => a.startsWith("-s=")), ...wire], overrideEnv, identity);
|
|
2186
|
+
if (res.status !== 0 || typeof res.secretOut !== "string") {
|
|
2187
|
+
process.stderr.write(res.stderr || (res.status === 0 ? "[rech] read-secret: this daemon is older than the client (no value returned)\n" : ""));
|
|
2188
|
+
process.exit(res.status || 1);
|
|
2189
|
+
}
|
|
2190
|
+
// Wait until the pipe has taken all of it before exiting.
|
|
2191
|
+
await new Promise<void>((done, fail) => process.stdout.write(res.secretOut!, e => e ? fail(e) : done()));
|
|
2192
|
+
console.error(`[rech] read-secret: wrote ${res.secretOut.length} characters to stdout`);
|
|
2193
|
+
process.exit(0);
|
|
2194
|
+
}
|
|
2171
2195
|
if (args[cmdIdx] === "fill-secret") {
|
|
2172
2196
|
if (args.some(a => a === "--help" || a === "-h")) { console.log(FILL_SECRET_USAGE); process.exit(0); }
|
|
2173
2197
|
try {
|
|
@@ -2188,7 +2212,13 @@ async function run(url: string, args: string[], overrideEnv?: Record<string, str
|
|
|
2188
2212
|
}
|
|
2189
2213
|
const served = await callServe(url, args, overrideEnv, identity, false, upload, secret);
|
|
2190
2214
|
// The daemon already masks the value; this is a second line of defence for an older daemon.
|
|
2191
|
-
|
|
2215
|
+
// Then any secret-shaped string (API keys, tokens) in page text, unless RECH_REDACT=0.
|
|
2216
|
+
const scrub = (s: string) => {
|
|
2217
|
+
if (!s) return s;
|
|
2218
|
+
if (secret) s = s.replaceAll(secret, SECRET_MASK);
|
|
2219
|
+
if (process.env.RECH_REDACT === "0") return s;
|
|
2220
|
+
try { return redact(s).text; } catch { return s; } // missing rules must not swallow output
|
|
2221
|
+
};
|
|
2192
2222
|
const { files, existingSession } = served;
|
|
2193
2223
|
const status = served.status, stdout = scrub(served.stdout), stderr = scrub(served.stderr);
|
|
2194
2224
|
if (!opts.bridgeRetried && isBridgeTimeout(args, { status, stderr })) {
|
|
@@ -2730,7 +2760,7 @@ export async function daemonInstall(serveUrl: string): Promise<void> {
|
|
|
2730
2760
|
const envRaw = await file(globalEnvFile).text().catch(() => "");
|
|
2731
2761
|
const lines = envRaw.trimEnd().split("\n");
|
|
2732
2762
|
const filtered = lines.filter(l => !l.startsWith(`${ENV_KEY}=`));
|
|
2733
|
-
await
|
|
2763
|
+
await writeAtomic(globalEnvFile, [...filtered, envAssignment(ENV_KEY, keepProfileParam(serveUrl, lines.find(l => l.startsWith(`${ENV_KEY}=`))?.slice(ENV_KEY.length + 1))), ""].join("\n"), 0o600);
|
|
2734
2764
|
|
|
2735
2765
|
const home = HOME;
|
|
2736
2766
|
const bunBin = Bun.which("bun") ?? process.execPath;
|
|
@@ -3338,7 +3368,7 @@ async function rotateKey(name: string): Promise<void> {
|
|
|
3338
3368
|
console.log(`New key for ${name}; URLs carrying the old key stop working now. Print new ones with: rech share <profile> --listener ${name}`);
|
|
3339
3369
|
}
|
|
3340
3370
|
|
|
3341
|
-
async function setListener(name: string, opts: { publicUrl?: string; clearPublicUrl?: boolean; uploads?: boolean; hostUploadDirs?: string[]; noHostUploads?: boolean }): Promise<void> {
|
|
3371
|
+
async function setListener(name: string, opts: { publicUrl?: string; clearPublicUrl?: boolean; uploads?: boolean; hostUploadDirs?: string[]; noHostUploads?: boolean; readSecrets?: boolean }): Promise<void> {
|
|
3342
3372
|
const config = await requireListeners();
|
|
3343
3373
|
let listener = config.listeners.find(l => l.name === name);
|
|
3344
3374
|
if (!listener) throw new Error(`Unknown listener "${name}". See rech listener ls.`);
|
|
@@ -3356,7 +3386,12 @@ async function setListener(name: string, opts: { publicUrl?: string; clearPublic
|
|
|
3356
3386
|
else policy.hostDirs = [...new Set([...(policy.hostDirs ?? []), ...opts.hostUploadDirs!.map(d => realpathSync(resolve(d)))])];
|
|
3357
3387
|
listener.uploads = policy;
|
|
3358
3388
|
}
|
|
3389
|
+
if (opts.readSecrets !== undefined) {
|
|
3390
|
+
if (listener.profiles === "*") throw new Error(`"${name}" is the local management listener: read-secret is always available there.`);
|
|
3391
|
+
if (opts.readSecrets) listener.readSecrets = true; else delete listener.readSecrets;
|
|
3392
|
+
}
|
|
3359
3393
|
await writeListeners(config);
|
|
3394
|
+
if (opts.readSecrets !== undefined) console.log(opts.readSecrets ? `${name}: read-secret on. Anyone with this link can copy the value of any field (saved passwords included) on any site its profiles have open; --allow-domain only checks the site the caller names. Each read is logged without the value` : `${name}: read-secret off`);
|
|
3360
3395
|
if (opts.publicUrl !== undefined || opts.clearPublicUrl) console.log(listener.publicUrl ? `${name} is reachable at ${listener.publicUrl}` : `${name}: public URL cleared`);
|
|
3361
3396
|
if (opts.hostUploadDirs?.length || opts.noHostUploads) {
|
|
3362
3397
|
const dirs = (listener.uploads || {}).hostDirs;
|
|
@@ -3427,7 +3462,6 @@ async function saveGlobalUrl(url: string): Promise<string> {
|
|
|
3427
3462
|
return writeEnvUrl(GLOBAL_ENV_FILE, url);
|
|
3428
3463
|
}
|
|
3429
3464
|
|
|
3430
|
-
/** Replace RECHROME_URL in an env file, keeping its other lines; owner-only, since the URL holds a key. */
|
|
3431
3465
|
/** Write a file whole or not at all: a temp file beside it, then rename (atomic on one filesystem). */
|
|
3432
3466
|
export async function writeAtomic(path: string, data: string, mode?: number): Promise<void> {
|
|
3433
3467
|
// A symlinked .env.local stays a link: write the file it points to.
|
|
@@ -3464,6 +3498,7 @@ export async function ensureProjectDir(dir: string): Promise<void> {
|
|
|
3464
3498
|
if (!existsSync(readme)) await writeAtomic(readme, PROJECT_DIR_README);
|
|
3465
3499
|
}
|
|
3466
3500
|
|
|
3501
|
+
/** Replace RECHROME_URL in an env file, keeping its other lines; owner-only, since the URL holds a key. */
|
|
3467
3502
|
async function writeEnvUrl(envPath: string, url: string): Promise<string> {
|
|
3468
3503
|
const lines = (await file(envPath).text().catch(() => "")).split("\n").filter(l => l.trim() && !l.startsWith(`${ENV_KEY}=`));
|
|
3469
3504
|
await writeAtomic(envPath, [...lines, envAssignment(ENV_KEY, url), ""].join("\n"), 0o600);
|
|
@@ -3974,7 +4009,7 @@ async function setup(opts: SetupOptions = {}): Promise<void> {
|
|
|
3974
4009
|
guide?.close();
|
|
3975
4010
|
console.log(` Saved token for ${extraDisplay}`);
|
|
3976
4011
|
}
|
|
3977
|
-
if (bridgeVerified && isTTY && !opts.listen) await setupShareStep(ask, profileEmail);
|
|
4012
|
+
if (bridgeVerified && isTTY && !opts.listen && !opts.skipShare) await setupShareStep(ask, profileEmail);
|
|
3978
4013
|
rl?.close();
|
|
3979
4014
|
envWatcher?.close();
|
|
3980
4015
|
if (bridgeVerified)
|
|
@@ -4423,7 +4458,7 @@ async function status(): Promise<void> {
|
|
|
4423
4458
|
}
|
|
4424
4459
|
|
|
4425
4460
|
|
|
4426
|
-
export type SetupOptions = { profile?: string; token?: string; listen?: string; prefix?: string; port?: number; yes?: boolean };
|
|
4461
|
+
export type SetupOptions = { profile?: string; token?: string; listen?: string; prefix?: string; port?: number; yes?: boolean; /** Called from `rech share`, which shares the profile itself. */ skipShare?: boolean };
|
|
4427
4462
|
export type RechHandlers = {
|
|
4428
4463
|
serve(): Promise<void> | void;
|
|
4429
4464
|
status(): Promise<void>;
|
|
@@ -4440,7 +4475,7 @@ export type RechHandlers = {
|
|
|
4440
4475
|
allowListener(name: string, profiles: string[]): Promise<void>;
|
|
4441
4476
|
denyListener(name: string, profiles: string[]): Promise<void>;
|
|
4442
4477
|
rotateKey(name: string): Promise<void>;
|
|
4443
|
-
setListener(name: string, opts: { publicUrl?: string; clearPublicUrl?: boolean; uploads?: boolean; hostUploadDirs?: string[]; noHostUploads?: boolean }): Promise<void>;
|
|
4478
|
+
setListener(name: string, opts: { publicUrl?: string; clearPublicUrl?: boolean; uploads?: boolean; hostUploadDirs?: string[]; noHostUploads?: boolean; readSecrets?: boolean }): Promise<void>;
|
|
4444
4479
|
setup(opts: SetupOptions): Promise<void>;
|
|
4445
4480
|
tray(action?: string): Promise<void>;
|
|
4446
4481
|
provisionProfile(name: string, opts: { headed: boolean; experimental: boolean }): Promise<void>;
|
|
@@ -4473,6 +4508,8 @@ const HELP_EPILOGUE = `Browser commands (sent to this project's Chrome session):
|
|
|
4473
4508
|
--isolate in a throwaway session, e.g. for a login flow
|
|
4474
4509
|
rech fill-secret <ref> --from-env VAR | --totp-from-env VAR [--env-file f] [--allow-domain '*.example.com']
|
|
4475
4510
|
type a password / TOTP code without it reaching argv, logs or output
|
|
4511
|
+
rech read-secret <ref> --allow-domain <host> | <vault command>
|
|
4512
|
+
copy a field's value (e.g. an API secret) into a pipe, never shown or logged
|
|
4476
4513
|
rech pw <args> forward verbatim to playwright-cli, e.g. \`rech pw --version\`
|
|
4477
4514
|
rech --version rechrome's version
|
|
4478
4515
|
|
|
@@ -4588,9 +4625,10 @@ export function rechCli(argv: string[], handlers: RechHandlers) {
|
|
|
4588
4625
|
.option("clear-public-url", { type: "boolean", conflicts: "public-url" })
|
|
4589
4626
|
.option("uploads", { type: "boolean", describe: "Uploads of images the link holder sends (rech upload) are on by default; --no-uploads turns them off" })
|
|
4590
4627
|
.option("host-upload-dir", { type: "string", array: true, requiresArg: true, describe: "Off by default. Also let links upload files already on this host, from inside this directory (rech upload --host <path>); repeatable" })
|
|
4628
|
+
.option("read-secrets", { type: "boolean", describe: "Off by default. Let this listener's links copy any field's value (saved passwords too) into a pipe (rech read-secret): only for links you trust with those accounts. --no-read-secrets turns it off" })
|
|
4591
4629
|
.option("host-uploads", { type: "boolean", describe: "--no-host-uploads turns host-path uploads off again" })
|
|
4592
|
-
.check(a => a.publicUrl !== undefined || a.clearPublicUrl || a.uploads !== undefined || a.hostUploadDir?.length || a.hostUploads === false ? true : "Pass --public-url <url>, --clear-public-url, --uploads/--no-uploads, or --host-upload-dir/--no-host-uploads"),
|
|
4593
|
-
a => handlers.setListener(a.name, { publicUrl: a.publicUrl, clearPublicUrl: a.clearPublicUrl, ...(a.uploads !== undefined ? { uploads: a.uploads } : {}), ...(a.hostUploadDir?.length ? { hostUploadDirs: a.hostUploadDir as string[] } : {}), ...(a.hostUploads === false ? { noHostUploads: true } : {}) }))
|
|
4630
|
+
.check(a => a.publicUrl !== undefined || a.clearPublicUrl || a.uploads !== undefined || a.hostUploadDir?.length || a.hostUploads === false || a.readSecrets !== undefined ? true : "Pass --public-url <url>, --clear-public-url, --uploads/--no-uploads, or --host-upload-dir/--no-host-uploads"),
|
|
4631
|
+
a => handlers.setListener(a.name, { publicUrl: a.publicUrl, clearPublicUrl: a.clearPublicUrl, ...(a.uploads !== undefined ? { uploads: a.uploads } : {}), ...(a.hostUploadDir?.length ? { hostUploadDirs: a.hostUploadDir as string[] } : {}), ...(a.hostUploads === false ? { noHostUploads: true } : {}), ...(a.readSecrets !== undefined ? { readSecrets: a.readSecrets } : {}) }))
|
|
4594
4632
|
.command("port [name]", "Print a listener's port (for a proxy command)", y => y.positional("name", { type: "string" }),
|
|
4595
4633
|
a => handlers.listenerPort(a.name))
|
|
4596
4634
|
.command("rotate-key <name>", "Give a listener a new key (old URLs stop working)", y => y.positional("name", { type: "string", demandOption: true }),
|