gcb-host 0.7.1 → 0.8.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 +22 -1
- package/bin/gcb.js +3 -3
- package/lib/audit.d.ts +4 -4
- package/lib/audit.d.ts.map +1 -1
- package/lib/audit.js +15 -14
- package/lib/audit.js.map +1 -1
- package/lib/broker.d.ts +12 -13
- package/lib/broker.d.ts.map +1 -1
- package/lib/broker.js +77 -53
- package/lib/broker.js.map +1 -1
- package/lib/commands/authorize.d.ts +43 -13
- package/lib/commands/authorize.d.ts.map +1 -1
- package/lib/commands/authorize.js +146 -53
- package/lib/commands/authorize.js.map +1 -1
- package/lib/commands/compose.d.ts +8 -10
- package/lib/commands/compose.d.ts.map +1 -1
- package/lib/commands/compose.js +33 -44
- package/lib/commands/compose.js.map +1 -1
- package/lib/commands/config.d.ts.map +1 -1
- package/lib/commands/config.js +59 -41
- package/lib/commands/config.js.map +1 -1
- package/lib/commands/deployment.d.ts +11 -11
- package/lib/commands/deployment.d.ts.map +1 -1
- package/lib/commands/deployment.js +19 -18
- package/lib/commands/deployment.js.map +1 -1
- package/lib/commands/diagnose.d.ts.map +1 -1
- package/lib/commands/diagnose.js +51 -33
- package/lib/commands/diagnose.js.map +1 -1
- package/lib/commands/doctor.d.ts +5 -5
- package/lib/commands/doctor.d.ts.map +1 -1
- package/lib/commands/doctor.js +53 -32
- package/lib/commands/doctor.js.map +1 -1
- package/lib/commands/host.d.ts +7 -7
- package/lib/commands/host.d.ts.map +1 -1
- package/lib/commands/host.js +144 -93
- package/lib/commands/host.js.map +1 -1
- package/lib/commands/init.d.ts +33 -33
- package/lib/commands/init.d.ts.map +1 -1
- package/lib/commands/init.js +93 -75
- package/lib/commands/init.js.map +1 -1
- package/lib/commands/stage.d.ts +6 -6
- package/lib/commands/stage.d.ts.map +1 -1
- package/lib/commands/stage.js +21 -15
- package/lib/commands/stage.js.map +1 -1
- package/lib/config.d.ts +29 -28
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +100 -84
- package/lib/config.js.map +1 -1
- package/lib/daemon.d.ts +9 -9
- package/lib/daemon.d.ts.map +1 -1
- package/lib/daemon.js +21 -18
- package/lib/daemon.js.map +1 -1
- package/lib/device-flow.d.ts +23 -22
- package/lib/device-flow.d.ts.map +1 -1
- package/lib/device-flow.js +33 -28
- package/lib/device-flow.js.map +1 -1
- package/lib/gh.d.ts +2 -2
- package/lib/gh.d.ts.map +1 -1
- package/lib/gh.js +74 -46
- package/lib/gh.js.map +1 -1
- package/lib/http.d.ts.map +1 -1
- package/lib/http.js +35 -18
- package/lib/http.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/policy.d.ts +25 -25
- package/lib/policy.d.ts.map +1 -1
- package/lib/policy.js +57 -36
- package/lib/policy.js.map +1 -1
- package/lib/providers/github-app.d.ts +12 -12
- package/lib/providers/github-app.d.ts.map +1 -1
- package/lib/providers/github-app.js +194 -125
- package/lib/providers/github-app.js.map +1 -1
- package/lib/providers/index.d.ts +8 -9
- package/lib/providers/index.d.ts.map +1 -1
- package/lib/providers/index.js +5 -5
- package/lib/providers/index.js.map +1 -1
- package/lib/providers/static.d.ts +3 -3
- package/lib/providers/static.d.ts.map +1 -1
- package/lib/providers/static.js +14 -12
- package/lib/providers/static.js.map +1 -1
- package/lib/proxy.d.ts +10 -10
- package/lib/proxy.d.ts.map +1 -1
- package/lib/proxy.js +18 -16
- package/lib/proxy.js.map +1 -1
- package/lib/public-repo.d.ts +10 -10
- package/lib/public-repo.d.ts.map +1 -1
- package/lib/public-repo.js +17 -14
- package/lib/public-repo.js.map +1 -1
- package/lib/reload.d.ts +4 -4
- package/lib/reload.d.ts.map +1 -1
- package/lib/reload.js +24 -14
- package/lib/reload.js.map +1 -1
- package/package.json +10 -10
package/lib/commands/diagnose.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `diagnose` — explain why the broker could not mint a token.
|
|
3
3
|
*
|
|
4
|
-
* The broker deliberately answers the pushing side with a generic message, because provider
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* The broker deliberately answers the pushing side with a generic message, because provider errors
|
|
5
|
+
* can embed API responses. This asks GitHub directly and prints what the app can actually see,
|
|
6
|
+
* which is what separates the two causes of
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* 422 "There is at least one repository that does not exist or is not accessible to the parent
|
|
9
|
+
* installation"
|
|
10
10
|
*
|
|
11
|
-
* — the repository was never created, or the installation was granted "only select
|
|
12
|
-
*
|
|
11
|
+
* — the repository was never created, or the installation was granted "only select repositories"
|
|
12
|
+
* and this one is not on that list. The message is identical for both.
|
|
13
13
|
*
|
|
14
14
|
* It never prints a key or a token.
|
|
15
15
|
*/
|
|
16
16
|
import { readFileSync } from 'node:fs';
|
|
17
|
+
import { fail, parseArgs, say, warn } from 'gcb-core';
|
|
17
18
|
import { assertKeysReadable, loadConfig, resolveConfigPath } from '../config.js';
|
|
18
|
-
import { nextLink, signAppJwt } from '../providers/github-app.js';
|
|
19
19
|
import { fetcherFor, parseProxy } from '../http.js';
|
|
20
|
-
import {
|
|
20
|
+
import { nextLink, signAppJwt } from '../providers/github-app.js';
|
|
21
21
|
/** Usage text for `diagnose`. */
|
|
22
22
|
export const DIAGNOSE_USAGE = `Usage: gcb diagnose [options]
|
|
23
23
|
|
|
@@ -33,21 +33,25 @@ repositories each installation can reach. Never prints a key or a token.
|
|
|
33
33
|
/**
|
|
34
34
|
* Run the `diagnose` command.
|
|
35
35
|
*
|
|
36
|
-
* @param argv -
|
|
37
|
-
* @returns
|
|
36
|
+
* @param argv - Arguments after the command name.
|
|
37
|
+
* @returns The process exit code: 0 everything reachable, 1 something is not.
|
|
38
38
|
*/
|
|
39
39
|
import { assertProxyEnabled } from '../proxy.js';
|
|
40
40
|
export async function runDiagnose(argv) {
|
|
41
41
|
const args = parseArgs(argv, { booleans: ['help', 'no-proxy'] });
|
|
42
|
-
if (args.has('no-proxy') && args.value('proxy') !== undefined)
|
|
42
|
+
if (args.has('no-proxy') && args.value('proxy') !== undefined) {
|
|
43
43
|
fail('--proxy and --no-proxy are mutually exclusive');
|
|
44
|
-
|
|
44
|
+
}
|
|
45
|
+
if (args.has('proxy') && args.value('proxy') === undefined) {
|
|
45
46
|
fail('--proxy needs a value');
|
|
47
|
+
}
|
|
46
48
|
const proxy = args.has('no-proxy') ? null : args.value('proxy');
|
|
47
|
-
if (proxy !== undefined && parseProxy(proxy) === false)
|
|
49
|
+
if (proxy !== undefined && parseProxy(proxy) === false) {
|
|
48
50
|
fail('--proxy must be an http(s) URL');
|
|
49
|
-
|
|
51
|
+
}
|
|
52
|
+
if (proxy === undefined) {
|
|
50
53
|
assertProxyEnabled();
|
|
54
|
+
}
|
|
51
55
|
if (args.has('help') || args.has('h')) {
|
|
52
56
|
say(DIAGNOSE_USAGE);
|
|
53
57
|
return 0;
|
|
@@ -60,27 +64,33 @@ export async function runDiagnose(argv) {
|
|
|
60
64
|
assertKeysReadable(config);
|
|
61
65
|
const wanted = args.value('host');
|
|
62
66
|
const entry = Object.entries(config.hosts).find(([host, block]) => block.provider === 'github-app' && (wanted ? host === wanted : true));
|
|
63
|
-
if (!entry)
|
|
67
|
+
if (!entry) {
|
|
64
68
|
fail(`no github-app host${wanted ? ` named ${wanted}` : ''} in ${configPath}`);
|
|
69
|
+
}
|
|
65
70
|
const [host, block] = entry;
|
|
66
71
|
if (!block.privateKeyPath) {
|
|
67
72
|
fail('this host uses privateKeyPem; point the command at a config that references a key file');
|
|
68
73
|
}
|
|
69
74
|
const pem = readFileSync(block.privateKeyPath, 'utf8');
|
|
70
75
|
const issuer = block.clientId ?? block.appId;
|
|
71
|
-
if (issuer === undefined)
|
|
76
|
+
if (issuer === undefined) {
|
|
72
77
|
fail('the host block has neither clientId nor appId');
|
|
78
|
+
}
|
|
73
79
|
const api = block.apiBaseUrl ?? 'https://api.github.com';
|
|
74
80
|
const apiVersion = block.apiVersion ?? '2022-11-28';
|
|
75
81
|
const fetcher = fetcherFor(proxy);
|
|
76
82
|
/**
|
|
77
83
|
* Call the API authenticated as the app.
|
|
78
84
|
*
|
|
79
|
-
* @param path -
|
|
80
|
-
* @returns
|
|
85
|
+
* @param path - Path below the API root.
|
|
86
|
+
* @returns The parsed body and the Link header.
|
|
81
87
|
*/
|
|
82
88
|
async function asApp(path) {
|
|
83
|
-
const jwt = signAppJwt({
|
|
89
|
+
const jwt = signAppJwt({
|
|
90
|
+
privateKeyPem: pem,
|
|
91
|
+
iss: issuer,
|
|
92
|
+
nowMs: Date.now(),
|
|
93
|
+
});
|
|
84
94
|
const response = await fetcher(`${api}${path}`, {
|
|
85
95
|
method: 'GET',
|
|
86
96
|
headers: {
|
|
@@ -109,12 +119,16 @@ export async function runDiagnose(argv) {
|
|
|
109
119
|
/**
|
|
110
120
|
* Call the API authenticated as one installation.
|
|
111
121
|
*
|
|
112
|
-
* @param installationId -
|
|
113
|
-
* @param path -
|
|
114
|
-
* @returns
|
|
122
|
+
* @param installationId - The installation to act as.
|
|
123
|
+
* @param path - Path below the API root.
|
|
124
|
+
* @returns The parsed body.
|
|
115
125
|
*/
|
|
116
126
|
async function asInstallation(installationId, path) {
|
|
117
|
-
const jwt = signAppJwt({
|
|
127
|
+
const jwt = signAppJwt({
|
|
128
|
+
privateKeyPem: pem,
|
|
129
|
+
iss: issuer,
|
|
130
|
+
nowMs: Date.now(),
|
|
131
|
+
});
|
|
118
132
|
const minted = await fetcher(`${api}/app/installations/${installationId}/access_tokens`, {
|
|
119
133
|
method: 'POST',
|
|
120
134
|
headers: {
|
|
@@ -129,8 +143,9 @@ export async function runDiagnose(argv) {
|
|
|
129
143
|
throw new Error(`token request for installation ${installationId} -> ${minted.status}: ${mintedText.slice(0, 200)}`);
|
|
130
144
|
}
|
|
131
145
|
const token = JSON.parse(mintedText).token;
|
|
132
|
-
if (!token)
|
|
146
|
+
if (!token) {
|
|
133
147
|
throw new Error(`installation ${installationId} returned no token`);
|
|
148
|
+
}
|
|
134
149
|
const response = await fetcher(`${api}${path}`, {
|
|
135
150
|
method: 'GET',
|
|
136
151
|
headers: {
|
|
@@ -141,8 +156,9 @@ export async function runDiagnose(argv) {
|
|
|
141
156
|
},
|
|
142
157
|
});
|
|
143
158
|
const text = await response.text();
|
|
144
|
-
if (!response.ok)
|
|
159
|
+
if (!response.ok) {
|
|
145
160
|
throw new Error(`${path} -> ${response.status}: ${text.slice(0, 200)}`);
|
|
161
|
+
}
|
|
146
162
|
return JSON.parse(text);
|
|
147
163
|
}
|
|
148
164
|
const app = (await asApp('/app')).json;
|
|
@@ -154,8 +170,9 @@ export async function runDiagnose(argv) {
|
|
|
154
170
|
let page = '/app/installations?per_page=100';
|
|
155
171
|
for (let index = 0; index < 10 && page; index += 1) {
|
|
156
172
|
const result = await asApp(page);
|
|
157
|
-
if (Array.isArray(result.json))
|
|
173
|
+
if (Array.isArray(result.json)) {
|
|
158
174
|
installations.push(...result.json);
|
|
175
|
+
}
|
|
159
176
|
page = nextLink(result.link);
|
|
160
177
|
}
|
|
161
178
|
if (installations.length === 0) {
|
|
@@ -175,7 +192,7 @@ export async function runDiagnose(argv) {
|
|
|
175
192
|
// naming one that does not exist still fails with the same 422, so without this list a
|
|
176
193
|
// repository that was never created looks exactly like one that is merely not selected.
|
|
177
194
|
const listed = (await asInstallation(installation.id, '/installation/repositories?per_page=100'));
|
|
178
|
-
const names = (listed.repositories ?? []).map(
|
|
195
|
+
const names = (listed.repositories ?? []).map(repo => repo.full_name ?? '?');
|
|
179
196
|
reachable.set(installation.id, names);
|
|
180
197
|
const shown = names.slice(0, 20).join(', ');
|
|
181
198
|
say(` repositories (${names.length}${names.length >= 100 ? '+' : ''}): ${shown || '(none)'}${names.length > 20 ? ', …' : ''}`);
|
|
@@ -185,22 +202,23 @@ export async function runDiagnose(argv) {
|
|
|
185
202
|
let problems = 0;
|
|
186
203
|
for (const allowEntry of block.allow) {
|
|
187
204
|
const [owner, repoPattern] = allowEntry.split('/');
|
|
188
|
-
const matching = installations.filter(
|
|
205
|
+
const matching = installations.filter(installation => installation.account?.login?.toLowerCase() === owner?.toLowerCase());
|
|
189
206
|
if (matching.length === 0) {
|
|
190
207
|
say(` ${allowEntry}: no installation on account "${owner}"`);
|
|
191
208
|
problems += 1;
|
|
192
209
|
continue;
|
|
193
210
|
}
|
|
194
|
-
const visible = matching.some(
|
|
211
|
+
const visible = matching.some(installation => {
|
|
195
212
|
const known = reachable.get(installation.id) ?? [];
|
|
196
213
|
if (repoPattern === '*') {
|
|
197
|
-
return known.some(
|
|
214
|
+
return known.some(name => name.toLowerCase().startsWith(`${owner?.toLowerCase()}/`));
|
|
198
215
|
}
|
|
199
|
-
return known.some(
|
|
216
|
+
return known.some(name => name.toLowerCase() === `${owner?.toLowerCase()}/${repoPattern?.toLowerCase()}`);
|
|
200
217
|
});
|
|
201
218
|
say(` ${allowEntry}: ${visible ? 'reachable' : 'NOT in the repositories this installation can see'}`);
|
|
202
|
-
if (!visible)
|
|
219
|
+
if (!visible) {
|
|
203
220
|
problems += 1;
|
|
221
|
+
}
|
|
204
222
|
}
|
|
205
223
|
if (problems > 0) {
|
|
206
224
|
warn('');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnose.js","sourceRoot":"","sources":["../../src/commands/diagnose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"diagnose.js","sourceRoot":"","sources":["../../src/commands/diagnose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAGtC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAErD,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,iBAAiB,EAAE,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CAAC,CAAC,CAAA;YACtF,CAAC;YACD,OAAO,KAAK,CAAC,IAAI,CACf,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,GAAG,KAAK,EAAE,WAAW,EAAE,IAAI,WAAW,EAAE,WAAW,EAAE,EAAE,CACvF,CAAA;QACH,CAAC,CAAC,CAAA;QACF,GAAG,CACD,KAAK,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,mDAAmD,EAAE,CAClG,CAAA;QACD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,QAAQ,IAAI,CAAC,CAAA;QACf,CAAC;IACH,CAAC;IAED,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;QACjB,IAAI,CAAC,EAAE,CAAC,CAAA;QACR,IAAI,CAAC,0FAA0F,CAAC,CAAA;QAChG,IAAI,CAAC,0FAA0F,CAAC,CAAA;QAChG,IAAI,CAAC,wFAAwF,CAAC,CAAA;IAChG,CAAC;IACD,OAAO,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAC7B,CAAC"}
|
package/lib/commands/doctor.d.ts
CHANGED
|
@@ -2,16 +2,16 @@ export declare const DOCTOR_USAGE = "Usage: gcb doctor [options]\n\nReport the c
|
|
|
2
2
|
/**
|
|
3
3
|
* Read one string key from raw YAML when the rest of the file is invalid.
|
|
4
4
|
*
|
|
5
|
-
* @param text -
|
|
6
|
-
* @param key -
|
|
7
|
-
* @returns
|
|
5
|
+
* @param text - The raw configuration text.
|
|
6
|
+
* @param key - The top-level key to read.
|
|
7
|
+
* @returns The value, or null when absent/empty or an unquoted null/~.
|
|
8
8
|
*/
|
|
9
9
|
export declare function rawString(text: string, key: 'auditPath' | 'socketPath'): string | null;
|
|
10
10
|
/**
|
|
11
11
|
* Run the `doctor` command.
|
|
12
12
|
*
|
|
13
|
-
* @param argv -
|
|
14
|
-
* @returns
|
|
13
|
+
* @param argv - Arguments after the command name.
|
|
14
|
+
* @returns The process exit code.
|
|
15
15
|
*/
|
|
16
16
|
export declare function runDoctor(argv: readonly string[], write?: (line: string) => void): Promise<number>;
|
|
17
17
|
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,YAAY,+PAMxB,CAAA;AA4FD;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,YAAY,GAAG,MAAM,GAAG,IAAI,CAyBtF;AA2CD;;;;;GAKG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,KAAK,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAU,GAClC,OAAO,CAAC,MAAM,CAAC,CAwFjB"}
|
package/lib/commands/doctor.js
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* good snapshot.
|
|
7
7
|
*/
|
|
8
8
|
import { createHash } from 'node:crypto';
|
|
9
|
-
import net from 'node:net';
|
|
10
9
|
import { closeSync, constants, fstatSync, lstatSync, openSync, readSync } from 'node:fs';
|
|
10
|
+
import net from 'node:net';
|
|
11
|
+
import { createLineReader, fail, parseArgs, say } from 'gcb-core';
|
|
11
12
|
import { parseDocument } from 'yaml';
|
|
12
13
|
import { loadConfigText, readConfigText, resolveConfigPath } from '../config.js';
|
|
13
|
-
import { createLineReader, fail, parseArgs, say } from 'gcb-core';
|
|
14
14
|
export const DOCTOR_USAGE = `Usage: gcb doctor [options]
|
|
15
15
|
|
|
16
16
|
Report the configuration digest, the audit path, the last reload result and the socket file.
|
|
@@ -21,8 +21,9 @@ Report the configuration digest, the audit path, the last reload result and the
|
|
|
21
21
|
const CHUNK_BYTES = 64 * 1024;
|
|
22
22
|
/** Read the last config reload record, scanning backward a chunk at a time. */
|
|
23
23
|
function lastConfigEvent(path) {
|
|
24
|
-
if (path === null)
|
|
24
|
+
if (path === null) {
|
|
25
25
|
return {};
|
|
26
|
+
}
|
|
26
27
|
let fd;
|
|
27
28
|
try {
|
|
28
29
|
// O_NONBLOCK keeps a FIFO on this path from hanging the command; fstat below rejects it.
|
|
@@ -48,13 +49,17 @@ function lastConfigEvent(path) {
|
|
|
48
49
|
// The first piece is the tail of a record that starts in the previous (earlier) chunk.
|
|
49
50
|
carry = position > 0 ? Buffer.from(pieces.shift() ?? '', 'latin1') : Buffer.alloc(0);
|
|
50
51
|
for (let index = pieces.length - 1; index >= 0; index -= 1) {
|
|
51
|
-
const line = Buffer.from(pieces[index] ?? '', 'latin1')
|
|
52
|
-
|
|
52
|
+
const line = Buffer.from(pieces[index] ?? '', 'latin1')
|
|
53
|
+
.toString('utf8')
|
|
54
|
+
.trim();
|
|
55
|
+
if (!line) {
|
|
53
56
|
continue;
|
|
57
|
+
}
|
|
54
58
|
try {
|
|
55
59
|
const event = JSON.parse(line);
|
|
56
|
-
if (event.event === 'config')
|
|
60
|
+
if (event.event === 'config') {
|
|
57
61
|
return { event };
|
|
62
|
+
}
|
|
58
63
|
}
|
|
59
64
|
catch {
|
|
60
65
|
// A partially written line is expected after a crash; an earlier record still counts.
|
|
@@ -81,8 +86,9 @@ function socketLine(path, expectedMode) {
|
|
|
81
86
|
? `missing: ${path}`
|
|
82
87
|
: `cannot inspect ${path}: ${error.message}`;
|
|
83
88
|
}
|
|
84
|
-
if (stat.isSymbolicLink())
|
|
89
|
+
if (stat.isSymbolicLink()) {
|
|
85
90
|
return `symlink (broker refuses): ${path}`;
|
|
91
|
+
}
|
|
86
92
|
if (!stat.isSocket()) {
|
|
87
93
|
const kind = stat.isFile() ? 'regular file' : stat.isDirectory() ? 'directory' : 'not a socket';
|
|
88
94
|
return `${kind} (broker refuses): ${path}`;
|
|
@@ -94,19 +100,21 @@ function socketLine(path, expectedMode) {
|
|
|
94
100
|
/**
|
|
95
101
|
* Read one string key from raw YAML when the rest of the file is invalid.
|
|
96
102
|
*
|
|
97
|
-
* @param text -
|
|
98
|
-
* @param key -
|
|
99
|
-
* @returns
|
|
103
|
+
* @param text - The raw configuration text.
|
|
104
|
+
* @param key - The top-level key to read.
|
|
105
|
+
* @returns The value, or null when absent/empty or an unquoted null/~.
|
|
100
106
|
*/
|
|
101
107
|
export function rawString(text, key) {
|
|
102
108
|
try {
|
|
103
109
|
const parsed = parseDocument(text).toJS();
|
|
104
110
|
if (parsed !== null && Object.hasOwn(parsed, key)) {
|
|
105
111
|
const value = parsed[key];
|
|
106
|
-
if (typeof value === 'string')
|
|
112
|
+
if (typeof value === 'string') {
|
|
107
113
|
return value.trim() === '' ? null : value;
|
|
108
|
-
|
|
114
|
+
}
|
|
115
|
+
if (value === null || value === undefined) {
|
|
109
116
|
return null;
|
|
117
|
+
}
|
|
110
118
|
}
|
|
111
119
|
}
|
|
112
120
|
catch {
|
|
@@ -124,25 +132,25 @@ export function rawString(text, key) {
|
|
|
124
132
|
const PING_TIMEOUT_MS = 500;
|
|
125
133
|
/** Ask the running daemon which audit path it actually uses: undefined means no answer. */
|
|
126
134
|
function activeAuditPath(socketPath) {
|
|
127
|
-
return new Promise(
|
|
135
|
+
return new Promise(resolve => {
|
|
128
136
|
let settled = false;
|
|
129
|
-
let timer;
|
|
130
137
|
const socket = net.connect(socketPath);
|
|
131
138
|
const finish = (answer) => {
|
|
132
|
-
if (settled)
|
|
139
|
+
if (settled) {
|
|
133
140
|
return;
|
|
141
|
+
}
|
|
134
142
|
settled = true;
|
|
135
|
-
|
|
136
|
-
clearTimeout(timer);
|
|
143
|
+
clearTimeout(timer);
|
|
137
144
|
socket.destroy();
|
|
138
145
|
resolve(answer);
|
|
139
146
|
};
|
|
140
|
-
timer = setTimeout(() => finish(undefined), PING_TIMEOUT_MS);
|
|
147
|
+
const timer = setTimeout(() => finish(undefined), PING_TIMEOUT_MS);
|
|
141
148
|
const reader = createLineReader({
|
|
142
|
-
onLine:
|
|
149
|
+
onLine: line => {
|
|
143
150
|
try {
|
|
144
151
|
const answer = JSON.parse(line);
|
|
145
|
-
if (answer.ok === true &&
|
|
152
|
+
if (answer.ok === true &&
|
|
153
|
+
(answer.auditPath === null || typeof answer.auditPath === 'string')) {
|
|
146
154
|
finish(answer.auditPath === '' ? null : answer.auditPath);
|
|
147
155
|
return;
|
|
148
156
|
}
|
|
@@ -161,8 +169,8 @@ function activeAuditPath(socketPath) {
|
|
|
161
169
|
/**
|
|
162
170
|
* Run the `doctor` command.
|
|
163
171
|
*
|
|
164
|
-
* @param argv -
|
|
165
|
-
* @returns
|
|
172
|
+
* @param argv - Arguments after the command name.
|
|
173
|
+
* @returns The process exit code.
|
|
166
174
|
*/
|
|
167
175
|
export async function runDoctor(argv, write = say) {
|
|
168
176
|
const args = parseArgs(argv, { booleans: ['help'] });
|
|
@@ -170,18 +178,22 @@ export async function runDoctor(argv, write = say) {
|
|
|
170
178
|
write(DOCTOR_USAGE);
|
|
171
179
|
return 0;
|
|
172
180
|
}
|
|
173
|
-
if (args.positionals.length > 0)
|
|
181
|
+
if (args.positionals.length > 0) {
|
|
174
182
|
fail(`unexpected argument ${JSON.stringify(args.positionals[0])}`);
|
|
183
|
+
}
|
|
175
184
|
for (const name of args.names) {
|
|
176
|
-
if (name !== 'config' && name !== 'help' && name !== 'h')
|
|
185
|
+
if (name !== 'config' && name !== 'help' && name !== 'h') {
|
|
177
186
|
fail(`unknown option --${name}`);
|
|
187
|
+
}
|
|
178
188
|
}
|
|
179
189
|
const configValues = args.values('config');
|
|
180
|
-
if (args.has('config') || configValues.length > 1)
|
|
190
|
+
if (args.has('config') || configValues.length > 1) {
|
|
181
191
|
fail('--config may only be given once and needs a value');
|
|
192
|
+
}
|
|
182
193
|
const configArg = configValues[0];
|
|
183
|
-
if (configArg === '')
|
|
194
|
+
if (configArg === '') {
|
|
184
195
|
fail('--config needs a value');
|
|
196
|
+
}
|
|
185
197
|
const path = resolveConfigPath(configArg);
|
|
186
198
|
let config;
|
|
187
199
|
let text;
|
|
@@ -201,14 +213,18 @@ export async function runDoctor(argv, write = say) {
|
|
|
201
213
|
loadError = error;
|
|
202
214
|
}
|
|
203
215
|
const digest = createHash('sha256').update(text).digest('hex');
|
|
204
|
-
const configured = config
|
|
205
|
-
const socketPath = config
|
|
216
|
+
const configured = config === undefined ? rawString(text, 'auditPath') : config.auditPath;
|
|
217
|
+
const socketPath = config === undefined ? rawString(text, 'socketPath') : config.socketPath;
|
|
206
218
|
const activePath = socketPath === null ? undefined : await activeAuditPath(socketPath);
|
|
207
219
|
const auditPath = activePath === undefined ? configured : (activePath ?? configured);
|
|
208
220
|
const lastResult = lastConfigEvent(auditPath);
|
|
209
221
|
const last = lastResult.event;
|
|
210
|
-
const reloadLabel = activePath === null && auditPath
|
|
211
|
-
|
|
222
|
+
const reloadLabel = activePath === null && auditPath
|
|
223
|
+
? 'last reload (historical, from configured audit log)'
|
|
224
|
+
: 'last reload';
|
|
225
|
+
write(loadError === undefined
|
|
226
|
+
? `config: ${path} ok`
|
|
227
|
+
: `config: ${path} invalid: ${loadError.message}`);
|
|
212
228
|
write(`digest: ${digest}`);
|
|
213
229
|
if (!auditPath) {
|
|
214
230
|
write(`${reloadLabel}: (no auditPath configured)`);
|
|
@@ -220,7 +236,11 @@ export async function runDoctor(argv, write = say) {
|
|
|
220
236
|
write(`${reloadLabel}: (no config record in the audit log)`);
|
|
221
237
|
}
|
|
222
238
|
else {
|
|
223
|
-
const matched = typeof last.digest === 'string'
|
|
239
|
+
const matched = typeof last.digest === 'string'
|
|
240
|
+
? last.digest === digest
|
|
241
|
+
? 'digest matches'
|
|
242
|
+
: 'digest differs'
|
|
243
|
+
: 'digest unknown';
|
|
224
244
|
write(`${reloadLabel}: ${String(last.decision ?? 'unknown')} at ${String(last.ts ?? 'unknown')} (${matched})` +
|
|
225
245
|
(typeof last.reason === 'string' ? ` — ${last.reason}` : ''));
|
|
226
246
|
}
|
|
@@ -231,8 +251,9 @@ export async function runDoctor(argv, write = say) {
|
|
|
231
251
|
? `audit: ${auditPath} (configured; the running daemon writes no audit log)`
|
|
232
252
|
: `audit: ${auditPath} (active daemon path)`);
|
|
233
253
|
}
|
|
234
|
-
if (config !== undefined)
|
|
254
|
+
if (config !== undefined) {
|
|
235
255
|
write(`socket: ${socketLine(config.socketPath, config.socketMode)}`);
|
|
256
|
+
}
|
|
236
257
|
return loadError === undefined ? 0 : 1;
|
|
237
258
|
}
|
|
238
259
|
//# sourceMappingURL=doctor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AACxF,OAAO,GAAG,MAAM,UAAU,CAAA;AAE1B,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,CAAA;AAEpC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhF,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;CAM3B,CAAA;AAUD,MAAM,WAAW,GAAG,EAAE,GAAG,IAAI,CAAA;AAO7B,+EAA+E;AAC/E,SAAS,eAAe,CAAC,IAAmB;IAC1C,IAAI,IAA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,CAAC;IACD,IAAI,SAAS,EAAE,CAAC;QACd,KAAK,CACH,UAAU,KAAK,SAAS;YACtB,CAAC,CAAC,UAAU,SAAS,kEAAkE;YACvF,CAAC,CAAC,UAAU,KAAK,IAAI;gBACnB,CAAC,CAAC,UAAU,SAAS,uDAAuD;gBAC5E,CAAC,CAAC,UAAU,SAAS,uBAAuB,CACjD,CAAA;IACH,CAAC;IACD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,KAAK,CAAC,WAAW,UAAU,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAA;IACtE,CAAC;IACD,OAAO,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACxC,CAAC"}
|
package/lib/commands/host.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface BoundedResult {
|
|
|
9
9
|
/**
|
|
10
10
|
* Run an action with streaming output caps.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* ExecFile's maxBuffer kills the child once a fixed buffer fills; a large diff or log would then be
|
|
13
13
|
* reported as a gh failure even though only the excess output is unusable. Read both streams to the
|
|
14
14
|
* end, keep the first bytes of each, and tell the caller where the cut is.
|
|
15
15
|
*/
|
|
@@ -24,11 +24,11 @@ export declare const HOST_BROKER_USAGE = "Usage: gcb host [options]\n\nRun on th
|
|
|
24
24
|
/**
|
|
25
25
|
* Read a pull request's number and URL out of a program's output.
|
|
26
26
|
*
|
|
27
|
-
* `gh pr create` prints the URL, and so does anything that behaves like it. Nothing else is
|
|
28
|
-
* without a URL in the output the host broker reports a failure rather than guessing.
|
|
27
|
+
* `gh pr create` prints the URL, and so does anything that behaves like it. Nothing else is
|
|
28
|
+
* trusted: without a URL in the output the host broker reports a failure rather than guessing.
|
|
29
29
|
*
|
|
30
|
-
* @param output -
|
|
31
|
-
* @returns
|
|
30
|
+
* @param output - The program's standard output.
|
|
31
|
+
* @returns The number and URL, or `undefined`.
|
|
32
32
|
*/
|
|
33
33
|
export declare function pullRequestUrl(output: string): {
|
|
34
34
|
number: number;
|
|
@@ -37,8 +37,8 @@ export declare function pullRequestUrl(output: string): {
|
|
|
37
37
|
/**
|
|
38
38
|
* Run the `host` command.
|
|
39
39
|
*
|
|
40
|
-
* @param argv -
|
|
41
|
-
* @returns
|
|
40
|
+
* @param argv - Arguments after the command name.
|
|
41
|
+
* @returns The process exit code.
|
|
42
42
|
*/
|
|
43
43
|
export declare function runHostBroker(argv: readonly string[]): Promise<number>;
|
|
44
44
|
//# sourceMappingURL=host.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/commands/host.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../src/commands/host.ts"],"names":[],"mappings":"AAgEA,kEAAkE;AAClE,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAiBD,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GACzF,OAAO,CAAC,aAAa,CAAC,CA2GxB;AAED,6BAA6B;AAC7B,eAAO,MAAM,iBAAiB,8oDAwB7B,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAO1F;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA2M5E"}
|