@parhelia/capture 0.0.0-stage → 0.4.12894
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 +83 -2
- package/dist/browserHost.d.ts +19 -0
- package/dist/browserHost.d.ts.map +1 -0
- package/dist/browserHost.js +247 -0
- package/dist/browserHostLink.d.ts +50 -0
- package/dist/browserHostLink.d.ts.map +1 -0
- package/dist/browserHostLink.js +193 -0
- package/dist/browserHostProtocol.d.ts +61 -0
- package/dist/browserHostProtocol.d.ts.map +1 -0
- package/dist/browserHostProtocol.js +29 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +239 -0
- package/dist/cmsJob.d.ts +38 -0
- package/dist/cmsJob.d.ts.map +1 -0
- package/dist/cmsJob.js +218 -0
- package/dist/egressProxy.d.ts +59 -0
- package/dist/egressProxy.d.ts.map +1 -0
- package/dist/egressProxy.js +205 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/install/doctor.d.ts +31 -0
- package/dist/install/doctor.d.ts.map +1 -0
- package/dist/install/doctor.js +189 -0
- package/dist/install/install.d.ts +72 -0
- package/dist/install/install.d.ts.map +1 -0
- package/dist/install/install.js +267 -0
- package/dist/install/layout.d.ts +81 -0
- package/dist/install/layout.d.ts.map +1 -0
- package/dist/install/layout.js +77 -0
- package/dist/install/services.d.ts +16 -0
- package/dist/install/services.d.ts.map +1 -0
- package/dist/install/services.js +94 -0
- package/dist/install/sys.d.ts +91 -0
- package/dist/install/sys.d.ts.map +1 -0
- package/dist/install/sys.js +260 -0
- package/dist/install/units.d.ts +57 -0
- package/dist/install/units.d.ts.map +1 -0
- package/dist/install/units.js +244 -0
- package/dist/install/updater.d.ts +66 -0
- package/dist/install/updater.d.ts.map +1 -0
- package/dist/install/updater.js +111 -0
- package/dist/install/versions.d.ts +61 -0
- package/dist/install/versions.d.ts.map +1 -0
- package/dist/install/versions.js +204 -0
- package/dist/isolation.d.ts +76 -0
- package/dist/isolation.d.ts.map +1 -0
- package/dist/isolation.js +163 -0
- package/dist/parheliaClient.d.ts +97 -0
- package/dist/parheliaClient.d.ts.map +1 -0
- package/dist/parheliaClient.js +111 -0
- package/dist/version.d.ts +13 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +36 -0
- package/dist/webIsolation.d.ts +24 -0
- package/dist/webIsolation.d.ts.map +1 -0
- package/dist/webIsolation.js +112 -0
- package/dist/webJob.d.ts +56 -0
- package/dist/webJob.d.ts.map +1 -0
- package/dist/webJob.js +177 -0
- package/dist/worker.d.ts +53 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +213 -0
- package/package.json +28 -4
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Capture sidecar CS4 (plan CS-D5, §8): the egress proxy every page the capture browser opens goes through. For every
|
|
3
|
+
* connection (each redirect hop is a new request; HTTPS and WebSockets arrive as CONNECT) it resolves the name itself,
|
|
4
|
+
* checks every resolved address, and connects only to the address it checked, so a redirect into private space and DNS
|
|
5
|
+
* rebinding are stopped at the point of connection. A job's allowlist (host:port: the Parhelia origin, the head, the
|
|
6
|
+
* media origins) passes without the address check; everything else must resolve to a public address.
|
|
7
|
+
*/
|
|
8
|
+
import dns from "node:dns/promises";
|
|
9
|
+
import http from "node:http";
|
|
10
|
+
import net from "node:net";
|
|
11
|
+
import { rmSync } from "node:fs";
|
|
12
|
+
/**
|
|
13
|
+
* The sidecar's own floor: private, loopback, link-local (metadata), shared, benchmark, documentation, multicast and reserved
|
|
14
|
+
* space, and NAT64. A job's `blockedRanges` (the host's one table, `SafeUrlPolicy.BlockedRanges`) add to it; nothing a job
|
|
15
|
+
* says takes a range out of it.
|
|
16
|
+
*/
|
|
17
|
+
export const BASELINE_BLOCKED_RANGES = [
|
|
18
|
+
"0.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.2.0/24",
|
|
19
|
+
"192.168.0.0/16", "198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "224.0.0.0/4", "240.0.0.0/4",
|
|
20
|
+
"::/128", "::1/128", "fe80::/10", "fec0::/10", "fc00::/7", "ff00::/8", "64:ff9b::/96", "64:ff9b:1::/48", "2001:db8::/32",
|
|
21
|
+
];
|
|
22
|
+
/** A block list of CIDR ranges (IPv4-mapped IPv6 addresses are checked as their IPv4 address). Malformed entries throw. */
|
|
23
|
+
export function blockListOf(ranges) {
|
|
24
|
+
const list = new net.BlockList();
|
|
25
|
+
for (const range of ranges) {
|
|
26
|
+
const [base, bits, extra] = range.trim().split("/");
|
|
27
|
+
const family = net.isIPv4(base ?? "") ? "ipv4" : net.isIPv6(base ?? "") ? "ipv6" : undefined;
|
|
28
|
+
const prefix = Number(bits);
|
|
29
|
+
if (!family || extra !== undefined || !Number.isInteger(prefix) || prefix < 0 || prefix > (family === "ipv4" ? 32 : 128))
|
|
30
|
+
throw new Error(`Not a CIDR range: '${range}'.`);
|
|
31
|
+
list.addSubnet(base, prefix, family);
|
|
32
|
+
}
|
|
33
|
+
return list;
|
|
34
|
+
}
|
|
35
|
+
const baseline = blockListOf(BASELINE_BLOCKED_RANGES);
|
|
36
|
+
function inList(list, ip) {
|
|
37
|
+
const mapped = ip.toLowerCase().match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/);
|
|
38
|
+
if (mapped)
|
|
39
|
+
return list.check(mapped[1], "ipv4");
|
|
40
|
+
return net.isIPv4(ip) ? list.check(ip, "ipv4") : list.check(ip, "ipv6");
|
|
41
|
+
}
|
|
42
|
+
/** Whether an address lies in the baseline's blocked space (or `extra`); anything that is not an IP address is blocked. */
|
|
43
|
+
export function isBlockedAddress(ip, extra) {
|
|
44
|
+
if (!net.isIP(ip))
|
|
45
|
+
return true;
|
|
46
|
+
return inList(baseline, ip) || (extra !== undefined && inList(extra, ip));
|
|
47
|
+
}
|
|
48
|
+
/** The one decision for a connection to `host:port`. */
|
|
49
|
+
export async function decideEgress(host, port, options) {
|
|
50
|
+
const bare = host.replace(/^\[|\]$/g, "");
|
|
51
|
+
const key = `${bare.toLowerCase()}:${port}`;
|
|
52
|
+
let addresses;
|
|
53
|
+
if (net.isIP(bare))
|
|
54
|
+
addresses = [bare];
|
|
55
|
+
else
|
|
56
|
+
addresses = await (options.resolve ?? defaultResolve)(bare).catch(() => []);
|
|
57
|
+
if (addresses.length === 0)
|
|
58
|
+
return { ok: false, reason: "unresolvable" };
|
|
59
|
+
if (options.allow.some((entry) => entry.toLowerCase() === key))
|
|
60
|
+
return { ok: true, address: addresses[0], reason: "allowlisted" };
|
|
61
|
+
const denied = new Set((options.denyAddresses ?? []).map(normalizeAddress));
|
|
62
|
+
if (addresses.some((address) => denied.has(normalizeAddress(address))))
|
|
63
|
+
return { ok: false, reason: "denied address" };
|
|
64
|
+
const extra = options.blockedRanges?.length ? blockListOf(options.blockedRanges) : undefined;
|
|
65
|
+
if (addresses.some((address) => isBlockedAddress(address, extra)))
|
|
66
|
+
return { ok: false, reason: "blocked address" };
|
|
67
|
+
return { ok: true, address: addresses[0], reason: "public" };
|
|
68
|
+
}
|
|
69
|
+
function normalizeAddress(ip) {
|
|
70
|
+
const lower = ip.toLowerCase().replace(/^\[|\]$/g, "");
|
|
71
|
+
const mapped = lower.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/);
|
|
72
|
+
if (mapped)
|
|
73
|
+
return mapped[1];
|
|
74
|
+
if (net.isIPv6(lower)) {
|
|
75
|
+
// One spelling per address: let the URL parser compress it.
|
|
76
|
+
try {
|
|
77
|
+
return new URL(`http://[${lower}]/`).hostname.replace(/^\[|\]$/g, "");
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return lower;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return lower;
|
|
84
|
+
}
|
|
85
|
+
async function defaultResolve(host) {
|
|
86
|
+
return (await dns.lookup(host, { all: true })).map((entry) => entry.address);
|
|
87
|
+
}
|
|
88
|
+
/** Starts a proxy for one job: on an ephemeral loopback port, or on the job's Unix socket. */
|
|
89
|
+
export async function startEgressProxy(options) {
|
|
90
|
+
const log = options.log ?? (() => undefined);
|
|
91
|
+
// A malformed range from the host refuses the job before any connection, not on the first one.
|
|
92
|
+
if (options.blockedRanges?.length)
|
|
93
|
+
blockListOf(options.blockedRanges);
|
|
94
|
+
const physical = (address, port) => options.connectTo?.(address, port) ?? { host: address, port };
|
|
95
|
+
const sockets = new Set();
|
|
96
|
+
const server = http.createServer(async (request, response) => {
|
|
97
|
+
let target;
|
|
98
|
+
try {
|
|
99
|
+
target = new URL(request.url ?? "");
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
response.writeHead(400);
|
|
103
|
+
response.end();
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const port = Number(target.port || (target.protocol === "https:" ? 443 : 80));
|
|
107
|
+
const decision = await decideEgress(target.hostname, port, options);
|
|
108
|
+
log({ kind: "http", host: target.hostname, port, ...decision });
|
|
109
|
+
if (!decision.ok) {
|
|
110
|
+
response.writeHead(403, { "x-capture-egress": decision.reason });
|
|
111
|
+
response.end("Refused by the capture egress policy.");
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const to = physical(decision.address, port);
|
|
115
|
+
const upstream = http.request({ host: to.host, port: to.port, method: request.method, path: target.pathname + target.search,
|
|
116
|
+
headers: { ...request.headers, host: target.host }, setHost: false }, (answer) => {
|
|
117
|
+
response.writeHead(answer.statusCode ?? 502, answer.headers);
|
|
118
|
+
answer.pipe(response);
|
|
119
|
+
});
|
|
120
|
+
upstream.on("error", () => {
|
|
121
|
+
if (!response.headersSent)
|
|
122
|
+
response.writeHead(502);
|
|
123
|
+
response.end();
|
|
124
|
+
});
|
|
125
|
+
request.pipe(upstream);
|
|
126
|
+
});
|
|
127
|
+
server.on("connection", (socket) => {
|
|
128
|
+
sockets.add(socket);
|
|
129
|
+
socket.on("close", () => sockets.delete(socket));
|
|
130
|
+
});
|
|
131
|
+
server.on("connect", async (request, socket, head) => {
|
|
132
|
+
const match = (request.url ?? "").match(/^(.*):(\d+)$/);
|
|
133
|
+
if (!match) {
|
|
134
|
+
socket.end("HTTP/1.1 400 Bad Request\r\n\r\n");
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const host = match[1];
|
|
138
|
+
const port = Number(match[2]);
|
|
139
|
+
const decision = await decideEgress(host, port, options);
|
|
140
|
+
log({ kind: "connect", host, port, ...decision });
|
|
141
|
+
if (!decision.ok) {
|
|
142
|
+
socket.end(`HTTP/1.1 403 Forbidden\r\nx-capture-egress: ${decision.reason}\r\n\r\n`);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const to = physical(decision.address, port);
|
|
146
|
+
const upstream = net.connect(to.port, to.host, () => {
|
|
147
|
+
socket.write("HTTP/1.1 200 Connection Established\r\n\r\n");
|
|
148
|
+
if (head.length)
|
|
149
|
+
upstream.write(head);
|
|
150
|
+
upstream.pipe(socket);
|
|
151
|
+
socket.pipe(upstream);
|
|
152
|
+
});
|
|
153
|
+
upstream.on("error", () => socket.destroy());
|
|
154
|
+
socket.on("error", () => upstream.destroy());
|
|
155
|
+
});
|
|
156
|
+
let url;
|
|
157
|
+
if (options.socketPath) {
|
|
158
|
+
const pipe = options.socketPath.startsWith("\\\\.\\pipe\\");
|
|
159
|
+
if (!pipe)
|
|
160
|
+
rmSync(options.socketPath, { force: true });
|
|
161
|
+
// Created with its final mode from the first moment (no window in which the socket has the umask's mode).
|
|
162
|
+
const previous = process.umask(options.socketGroupAccess ? 0o117 : 0o177);
|
|
163
|
+
try {
|
|
164
|
+
await listen(server, options.socketPath);
|
|
165
|
+
}
|
|
166
|
+
finally {
|
|
167
|
+
process.umask(previous);
|
|
168
|
+
}
|
|
169
|
+
url = options.socketPath;
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve));
|
|
173
|
+
url = `http://127.0.0.1:${server.address().port}`;
|
|
174
|
+
}
|
|
175
|
+
return {
|
|
176
|
+
url,
|
|
177
|
+
close: () => new Promise((resolve) => {
|
|
178
|
+
for (const socket of sockets)
|
|
179
|
+
socket.destroy();
|
|
180
|
+
server.close(() => {
|
|
181
|
+
if (options.socketPath && !options.socketPath.startsWith("\\\\.\\pipe\\"))
|
|
182
|
+
rmSync(options.socketPath, { force: true });
|
|
183
|
+
resolve();
|
|
184
|
+
});
|
|
185
|
+
}),
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function listen(server, path) {
|
|
189
|
+
return new Promise((resolve, reject) => {
|
|
190
|
+
server.once("error", reject);
|
|
191
|
+
server.listen(path, () => {
|
|
192
|
+
server.off("error", reject);
|
|
193
|
+
resolve();
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
/** Chromium's flags that send every connection, loopback included, through the proxy (CS0: proven by the spike). */
|
|
198
|
+
export function proxyLaunchArgs(proxyUrl) {
|
|
199
|
+
return [
|
|
200
|
+
`--proxy-server=${proxyUrl}`,
|
|
201
|
+
"--proxy-bypass-list=<-loopback>",
|
|
202
|
+
"--disable-quic",
|
|
203
|
+
"--force-webrtc-ip-handling-policy=disable_non_proxied_udp",
|
|
204
|
+
];
|
|
205
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { startWorker, defaultLaunch, WEB_CAPABILITY, type WorkerOptions, type RunningWorker, type WebProfileOptions } from "./worker.js";
|
|
2
|
+
export { runCmsJob, hostPortOf, type CmsJobOptions, type JobOutcome } from "./cmsJob.js";
|
|
3
|
+
export { runWebJob, normalizeWebParameters, type WebCaptureResult, type WebJobOutcome } from "./webJob.js";
|
|
4
|
+
export { runBrowserHost, startForwarder, visibleSockets, type BrowserHostOptions } from "./browserHost.js";
|
|
5
|
+
export { BrowserHostLink, type EgressPolicy } from "./browserHostLink.js";
|
|
6
|
+
export { browserHostUnitProperties, socketDirectoriesOutsideHiddenTrees, judgeIsolation, webPreconditionRefusal, parheliaIsColocated, ownAddresses, type IsolationReport, type IsolationCheck, } from "./isolation.js";
|
|
7
|
+
export { verifyWebIsolation, webDenyAddresses } from "./webIsolation.js";
|
|
8
|
+
export { startEgressProxy, decideEgress, isBlockedAddress, blockListOf, proxyLaunchArgs, BASELINE_BLOCKED_RANGES, type EgressLogEntry, } from "./egressProxy.js";
|
|
9
|
+
export { ParheliaClient, ParheliaRefusedError, newWorkerKey, workerKeyHash, type CaptureJobOffer, type CapturePollAnswer } from "./parheliaClient.js";
|
|
10
|
+
export { SIDECAR_VERSION } from "./version.js";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACzI,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AACzF,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3G,OAAO,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EACL,yBAAyB,EAAE,mCAAmC,EAAE,cAAc,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,YAAY,EACzI,KAAK,eAAe,EAAE,KAAK,cAAc,GAC1C,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACL,gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,eAAe,EAAE,uBAAuB,EAAE,KAAK,cAAc,GAC7H,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,YAAY,EAAE,aAAa,EAAE,KAAK,eAAe,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACtJ,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { startWorker, defaultLaunch, WEB_CAPABILITY } from "./worker.js";
|
|
2
|
+
export { runCmsJob, hostPortOf } from "./cmsJob.js";
|
|
3
|
+
export { runWebJob, normalizeWebParameters } from "./webJob.js";
|
|
4
|
+
export { runBrowserHost, startForwarder, visibleSockets } from "./browserHost.js";
|
|
5
|
+
export { BrowserHostLink } from "./browserHostLink.js";
|
|
6
|
+
export { browserHostUnitProperties, socketDirectoriesOutsideHiddenTrees, judgeIsolation, webPreconditionRefusal, parheliaIsColocated, ownAddresses, } from "./isolation.js";
|
|
7
|
+
export { verifyWebIsolation, webDenyAddresses } from "./webIsolation.js";
|
|
8
|
+
export { startEgressProxy, decideEgress, isBlockedAddress, blockListOf, proxyLaunchArgs, BASELINE_BLOCKED_RANGES, } from "./egressProxy.js";
|
|
9
|
+
export { ParheliaClient, ParheliaRefusedError, newWorkerKey, workerKeyHash } from "./parheliaClient.js";
|
|
10
|
+
export { SIDECAR_VERSION } from "./version.js";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type InstalledConfig, type Layout } from "./layout.js";
|
|
2
|
+
import type { Sys } from "./sys.js";
|
|
3
|
+
export type Check = {
|
|
4
|
+
name: string;
|
|
5
|
+
ok: boolean;
|
|
6
|
+
warn?: boolean;
|
|
7
|
+
detail: string;
|
|
8
|
+
};
|
|
9
|
+
/** End of life per Node major (nodejs.org release schedule). */
|
|
10
|
+
export declare const NODE_END_OF_LIFE: Record<number, string>;
|
|
11
|
+
export declare function nodeCheck(version: string, now: number): Check;
|
|
12
|
+
/** What a failed request to Parhelia means, by its status or its error (plan §5). */
|
|
13
|
+
export declare function classifyReach(input: {
|
|
14
|
+
status?: number;
|
|
15
|
+
contentType?: string;
|
|
16
|
+
location?: string;
|
|
17
|
+
body?: string;
|
|
18
|
+
error?: unknown;
|
|
19
|
+
}): Check;
|
|
20
|
+
/** The sandbox's failure, named with the supported matrix (A10: never falls back to --no-sandbox). */
|
|
21
|
+
export declare function classifyLaunch(error: unknown): Check;
|
|
22
|
+
/** Linux: the key file is 0600 and the worker user's; Windows: its ACL grants only the three accounts (plan §5). */
|
|
23
|
+
export declare function keyFileCheck(sys: Sys, layout: Layout, keyFile: string, workerUid?: number): Check;
|
|
24
|
+
/** The code is read-only to the user doctor runs as (the worker, in a self-test): it cannot rewrite itself (plan CS-D14). */
|
|
25
|
+
export declare function codeReadOnlyCheck(versionsDir: string, currentLink: string, runningAsRoot: boolean): Check;
|
|
26
|
+
/** The updater's test capture: this version's own browser, sandboxed, renders a page and takes its screenshot. */
|
|
27
|
+
export declare function quickCapture(executablePath: string | undefined): Promise<Check>;
|
|
28
|
+
export declare function reachCheck(origin: string, key: string, fetchImpl?: typeof fetch): Promise<Check>;
|
|
29
|
+
export declare function generalChecks(sys: Sys, layout: Layout, config: InstalledConfig): Promise<Check[]>;
|
|
30
|
+
export declare function printChecks(checks: Check[], print?: (line: string) => void): boolean;
|
|
31
|
+
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/install/doctor.ts"],"names":[],"mappings":"AAWA,OAAO,EAAyC,KAAK,eAAe,EAAE,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AACvG,OAAO,KAAK,EAAE,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CAAC,CAY7G;AAED,wBAAsB,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CA0BvG;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,KAAK,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAkB,GAAG,OAAO,CAGjG"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Capture sidecar CS6 (plan §5): `doctor` names the failure. Node too old or near its end of life; the origin unreachable; a
|
|
3
|
+
* sign-in page in front of Parhelia (SSO); the key refused; the sandbox unavailable (with the supported OS matrix); the key
|
|
4
|
+
* file's permissions; the code directories writable by the service user; proxy or CA trouble; and with `--profile public-web`
|
|
5
|
+
* the isolation proof (webIsolation.ts). `--quick` is the updater's test capture: the version's own browser, sandboxed, renders
|
|
6
|
+
* and screenshots a page.
|
|
7
|
+
*/
|
|
8
|
+
import { chromium } from "playwright-core";
|
|
9
|
+
import { accessSync, constants, readFileSync, statSync } from "node:fs";
|
|
10
|
+
import { MIN_NODE_MAJOR } from "./install.js";
|
|
11
|
+
import { frontOf } from "../parheliaClient.js";
|
|
12
|
+
import { IPC_GROUP, PACKAGE_ENTRY, WORKER_USER } from "./layout.js";
|
|
13
|
+
import { keyFileAclHolds } from "./units.js";
|
|
14
|
+
import { browserOf } from "./versions.js";
|
|
15
|
+
/** End of life per Node major (nodejs.org release schedule). */
|
|
16
|
+
export const NODE_END_OF_LIFE = { 22: "2027-04-30", 24: "2028-04-30", 26: "2029-04-30" };
|
|
17
|
+
export function nodeCheck(version, now) {
|
|
18
|
+
const major = Number(version.split(".")[0]);
|
|
19
|
+
if (!(major >= MIN_NODE_MAJOR))
|
|
20
|
+
return { name: "Node", ok: false, detail: `Node ${version} is too old: ${MIN_NODE_MAJOR} or later is required.` };
|
|
21
|
+
const end = NODE_END_OF_LIFE[major] ? Date.parse(NODE_END_OF_LIFE[major]) : NaN;
|
|
22
|
+
if (Number.isFinite(end) && end - now < 90 * 86_400_000)
|
|
23
|
+
return { name: "Node", ok: true, warn: true, detail: `Node ${version} reaches its end of life on ${NODE_END_OF_LIFE[major]}: upgrade it with the OS packages.` };
|
|
24
|
+
if (major % 2 === 1)
|
|
25
|
+
return { name: "Node", ok: true, warn: true, detail: `Node ${version} is not a long-term release.` };
|
|
26
|
+
return { name: "Node", ok: true, detail: version };
|
|
27
|
+
}
|
|
28
|
+
/** What a failed request to Parhelia means, by its status or its error (plan §5). */
|
|
29
|
+
export function classifyReach(input) {
|
|
30
|
+
const name = "Parhelia";
|
|
31
|
+
if (input.error !== undefined) {
|
|
32
|
+
const error = input.error;
|
|
33
|
+
const code = error.cause?.code ?? error.code ?? "";
|
|
34
|
+
const text = `${error.message ?? ""} ${error.cause?.message ?? ""}`;
|
|
35
|
+
if (/CERT|SELF_SIGNED|UNABLE_TO_(GET|VERIFY)|ERR_TLS/.test(code + text))
|
|
36
|
+
return { name, ok: false, detail: `TLS trouble (${code || "certificate"}): the certificate is not trusted here. Add the CA with NODE_EXTRA_CA_CERTS in the service environment, or use the origin this machine reaches without interception.` };
|
|
37
|
+
if (/ECONNRESET|EPROTO|ERR_PROXY|407/.test(code + text))
|
|
38
|
+
return { name, ok: false, detail: `A proxy cut the connection (${code || "reset"}): let this machine reach Parhelia directly, or allow long-held requests (25 s) through the proxy.` };
|
|
39
|
+
if (/ENOTFOUND|EAI_AGAIN/.test(code + text))
|
|
40
|
+
return { name, ok: false, detail: `The origin's name does not resolve here (${code}): --origin must be the address this machine reaches Parhelia at.` };
|
|
41
|
+
if (/ECONNREFUSED|ETIMEDOUT|EHOSTUNREACH|ENETUNREACH|UND_ERR_CONNECT_TIMEOUT/.test(code + text))
|
|
42
|
+
return { name, ok: false, detail: `Parhelia is unreachable from here (${code}): check the origin, the port and the firewall between this machine and Parhelia.` };
|
|
43
|
+
return { name, ok: false, detail: `The request failed: ${error.message ?? String(input.error)}` };
|
|
44
|
+
}
|
|
45
|
+
const status = input.status ?? 0;
|
|
46
|
+
let json;
|
|
47
|
+
try {
|
|
48
|
+
json = input.body ? JSON.parse(input.body) : undefined;
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
json = undefined;
|
|
52
|
+
}
|
|
53
|
+
const front = frontOf(status, input.contentType ?? "", json);
|
|
54
|
+
if (front)
|
|
55
|
+
return { name, ok: false, detail: `${front}${input.location ? ` (redirected to ${input.location})` : ""}` };
|
|
56
|
+
if (status === 401)
|
|
57
|
+
return { name, ok: false, detail: "The worker key was refused: it was revoked, or belongs to another Parhelia. Pair again from Settings › Capture service." };
|
|
58
|
+
if (status === 404)
|
|
59
|
+
return { name, ok: false, detail: "This Parhelia has no capture service (404 capture-service-unavailable): the host composes none." };
|
|
60
|
+
if (status === 200)
|
|
61
|
+
return { name, ok: true, detail: "reached; the key is accepted" };
|
|
62
|
+
return { name, ok: false, detail: `Parhelia answered ${status}.` };
|
|
63
|
+
}
|
|
64
|
+
/** The sandbox's failure, named with the supported matrix (A10: never falls back to --no-sandbox). */
|
|
65
|
+
export function classifyLaunch(error) {
|
|
66
|
+
const text = error instanceof Error ? error.message : String(error);
|
|
67
|
+
if (/as root without --no-sandbox/i.test(text))
|
|
68
|
+
return { name: "Chromium sandbox", ok: false, detail: "Chromium refuses its sandbox as root: run the test capture as the worker user (doctor does so by itself when it runs as root on an installed machine)." };
|
|
69
|
+
if (/sandbox|namespace|setuid|clone/i.test(text))
|
|
70
|
+
return { name: "Chromium sandbox", ok: false, detail: "Chromium's sandbox cannot start here (user namespaces are off, or a container's seccomp profile forbids them). Supported: Debian 12/13, Ubuntu 22.04/24.04 and Windows Server 2019+ on real or virtual machines; in a container, use the seccomp profile shipped with the container instructions. The sidecar never runs without the sandbox." };
|
|
71
|
+
if (/libnss|lib.*\.so|cannot open shared object/i.test(text))
|
|
72
|
+
return { name: "Chromium sandbox", ok: false, detail: `Chromium's libraries are missing: ${text.split("\n")[0]} (run install again on an apt system, or install them with 'npx playwright-core install-deps chromium-headless-shell').` };
|
|
73
|
+
if (/Executable doesn't exist|ENOENT/i.test(text))
|
|
74
|
+
return { name: "Chromium sandbox", ok: false, detail: `The browser is not installed: ${text.split("\n")[0]}` };
|
|
75
|
+
return { name: "Chromium sandbox", ok: false, detail: `Chromium did not start: ${text.split("\n")[0]}` };
|
|
76
|
+
}
|
|
77
|
+
/** Linux: the key file is 0600 and the worker user's; Windows: its ACL grants only the three accounts (plan §5). */
|
|
78
|
+
export function keyFileCheck(sys, layout, keyFile, workerUid) {
|
|
79
|
+
const name = "Key file";
|
|
80
|
+
if (layout.platform === "win32") {
|
|
81
|
+
const acl = sys.exec("icacls", [keyFile]);
|
|
82
|
+
if (acl.status !== 0)
|
|
83
|
+
return { name, ok: false, detail: `The key file cannot be read: ${acl.stderr.trim()}` };
|
|
84
|
+
const held = keyFileAclHolds(acl.stdout, keyFile);
|
|
85
|
+
return { name, ok: held.ok, detail: held.detail };
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
const stat = statSync(keyFile);
|
|
89
|
+
const mode = stat.mode & 0o777;
|
|
90
|
+
if (mode & 0o077)
|
|
91
|
+
return { name, ok: false, detail: `${keyFile} is ${mode.toString(8).padStart(4, "0")}: it must be 0600 (chmod 600 ${keyFile}).` };
|
|
92
|
+
if (workerUid !== undefined && stat.uid !== workerUid)
|
|
93
|
+
return { name, ok: false, detail: `${keyFile} is not owned by ${WORKER_USER} (chown ${WORKER_USER} ${keyFile}).` };
|
|
94
|
+
return { name, ok: true, detail: "0600, the worker's" };
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
return { name, ok: false, detail: `The key file cannot be read: ${String(error)}` };
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/** The code is read-only to the user doctor runs as (the worker, in a self-test): it cannot rewrite itself (plan CS-D14). */
|
|
101
|
+
export function codeReadOnlyCheck(versionsDir, currentLink, runningAsRoot) {
|
|
102
|
+
const name = "Code directories";
|
|
103
|
+
if (runningAsRoot) {
|
|
104
|
+
try {
|
|
105
|
+
const stat = statSync(versionsDir);
|
|
106
|
+
const writable = (stat.mode & 0o022) !== 0 || stat.uid !== 0;
|
|
107
|
+
return { name, ok: !writable, detail: writable ? `${versionsDir} is writable by others than root.` : "root-owned, read-only to the service users" };
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
return { name, ok: false, detail: String(error) };
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
for (const target of [versionsDir, currentLink]) {
|
|
114
|
+
try {
|
|
115
|
+
accessSync(target, constants.W_OK);
|
|
116
|
+
return { name, ok: false, detail: `${target} is writable by this user: a compromised worker could rewrite its own code.` };
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
// not writable: as it must be
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return { name, ok: true, detail: "not writable by this user" };
|
|
123
|
+
}
|
|
124
|
+
/** The updater's test capture: this version's own browser, sandboxed, renders a page and takes its screenshot. */
|
|
125
|
+
export async function quickCapture(executablePath) {
|
|
126
|
+
try {
|
|
127
|
+
const browser = await chromium.launch({ headless: true, chromiumSandbox: true, ...(executablePath ? { executablePath } : {}) });
|
|
128
|
+
try {
|
|
129
|
+
const page = await browser.newPage({ viewport: { width: 320, height: 200 } });
|
|
130
|
+
await page.setContent("<h1 style='font:24px sans-serif'>Parhelia capture self-test ✓</h1>");
|
|
131
|
+
const png = await page.screenshot({ type: "png" });
|
|
132
|
+
return { name: "Test capture", ok: png.length > 500, detail: `${png.length} bytes` };
|
|
133
|
+
}
|
|
134
|
+
finally {
|
|
135
|
+
await browser.close();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
return classifyLaunch(error);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
export async function reachCheck(origin, key, fetchImpl = fetch) {
|
|
143
|
+
try {
|
|
144
|
+
const response = await fetchImpl(new URL("/parhelia/capture/worker/poll", origin), {
|
|
145
|
+
method: "POST", redirect: "manual", signal: AbortSignal.timeout(15_000),
|
|
146
|
+
headers: { "content-type": "application/json", authorization: `Bearer ${key}` },
|
|
147
|
+
body: JSON.stringify({ protocolVersion: 1, version: "doctor", capabilities: [], waitMs: 0 }),
|
|
148
|
+
});
|
|
149
|
+
const body = await response.text().catch(() => "");
|
|
150
|
+
return classifyReach({ status: response.status, contentType: response.headers.get("content-type") ?? "", location: response.headers.get("location") ?? undefined, body });
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
return classifyReach({ error });
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
export async function generalChecks(sys, layout, config) {
|
|
157
|
+
const checks = [nodeCheck(sys.nodeVersion, sys.now())];
|
|
158
|
+
let key = "";
|
|
159
|
+
try {
|
|
160
|
+
key = readFileSync(config.keyFile, "utf8").trim();
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
checks.push({ name: "Key file", ok: false, detail: `The key file cannot be read by this user: ${String(error)}` });
|
|
164
|
+
}
|
|
165
|
+
if (key) {
|
|
166
|
+
const uid = layout.platform === "linux" ? Number(sys.exec("id", ["-u", WORKER_USER]).stdout.trim()) : undefined;
|
|
167
|
+
checks.push(keyFileCheck(sys, layout, config.keyFile, Number.isFinite(uid) ? uid : undefined));
|
|
168
|
+
checks.push(await reachCheck(config.origin, key, sys.fetch));
|
|
169
|
+
}
|
|
170
|
+
checks.push(codeReadOnlyCheck(layout.versionsDir, layout.currentLink, sys.isPrivileged()));
|
|
171
|
+
if (layout.platform === "linux" && sys.isPrivileged()) {
|
|
172
|
+
// Chromium refuses its sandbox as root: the test capture runs as the worker does, as the worker user.
|
|
173
|
+
const asWorker = sys.exec("runuser", ["-u", WORKER_USER, "-g", IPC_GROUP, "--", sys.nodePath,
|
|
174
|
+
layout.join(config.installDir, ...PACKAGE_ENTRY.split("/")), "doctor", "--quick", "--install-dir", config.installDir], { timeoutMs: 120_000 });
|
|
175
|
+
const line = (asWorker.stdout + asWorker.stderr).split("\n").map((text) => text.trim()).find((text) => /^(ok|FAIL|warn)\s/.test(text));
|
|
176
|
+
checks.push(asWorker.status === 0
|
|
177
|
+
? { name: "Test capture", ok: true, detail: `as ${WORKER_USER}: ${line?.replace(/^ok\s+Test capture:\s*/, "") ?? "ok"}` }
|
|
178
|
+
: { name: "Chromium sandbox", ok: false, detail: line?.replace(/^FAIL\s+[^:]+:\s*/, "") ?? `the test capture as ${WORKER_USER} failed: ${(asWorker.stderr || asWorker.stdout).trim().slice(-300)}` });
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
checks.push(await quickCapture(config.browserPath ?? browserOf(sys, layout, config.installDir)));
|
|
182
|
+
}
|
|
183
|
+
return checks;
|
|
184
|
+
}
|
|
185
|
+
export function printChecks(checks, print = console.log) {
|
|
186
|
+
for (const check of checks)
|
|
187
|
+
print(`${check.ok ? (check.warn ? "warn" : "ok ") : "FAIL"} ${check.name}: ${check.detail}`);
|
|
188
|
+
return checks.every((check) => check.ok);
|
|
189
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type InstallRecord, type Layout } from "./layout.js";
|
|
2
|
+
import type { Sys } from "./sys.js";
|
|
3
|
+
import type { Firewall, ManifestAnswer } from "./updater.js";
|
|
4
|
+
export declare const MIN_NODE_MAJOR = 22;
|
|
5
|
+
export type PairAnswer = {
|
|
6
|
+
workerId: string;
|
|
7
|
+
name: string;
|
|
8
|
+
capabilities: string[];
|
|
9
|
+
};
|
|
10
|
+
export type InstallInput = {
|
|
11
|
+
sys: Sys;
|
|
12
|
+
layout: Layout;
|
|
13
|
+
origin: string;
|
|
14
|
+
/** A one-time pairing code (Settings › Capture service › Add). */
|
|
15
|
+
pairCode?: string;
|
|
16
|
+
/** An existing key file (pipeline-provisioned hosts: the connection string parhelia.capture names its key). */
|
|
17
|
+
keyFile?: string;
|
|
18
|
+
name: string;
|
|
19
|
+
/** Overrides what the pairing allows (false: no public-web even when allowed). */
|
|
20
|
+
web?: boolean;
|
|
21
|
+
probeUrl?: string;
|
|
22
|
+
publicUrl?: string;
|
|
23
|
+
registry?: string;
|
|
24
|
+
browserMirror?: string;
|
|
25
|
+
browserPath?: string;
|
|
26
|
+
fromTarball?: string;
|
|
27
|
+
/** The running package, for a source build (the host names no release). */
|
|
28
|
+
self: {
|
|
29
|
+
packageDir: string;
|
|
30
|
+
playwrightDir: string;
|
|
31
|
+
version: string;
|
|
32
|
+
browserRevision?: string;
|
|
33
|
+
};
|
|
34
|
+
pair(origin: string, code: string, key: string, name: string): Promise<PairAnswer>;
|
|
35
|
+
newKey(): string;
|
|
36
|
+
fetchManifest(key: string): Promise<ManifestAnswer>;
|
|
37
|
+
/** Linux: directories holding a socket outside the hidden trees (A7). */
|
|
38
|
+
scanSockets(): string[];
|
|
39
|
+
/** Whether Parhelia runs on this machine (Windows refuses public-web there). */
|
|
40
|
+
colocated(): Promise<boolean>;
|
|
41
|
+
firewall?: Firewall;
|
|
42
|
+
/** How long to wait for the worker's first good poll (0: do not wait). */
|
|
43
|
+
waitMs?: number;
|
|
44
|
+
log?: (line: string) => void;
|
|
45
|
+
};
|
|
46
|
+
export type InstallReport = {
|
|
47
|
+
version: string;
|
|
48
|
+
source: InstallRecord["source"];
|
|
49
|
+
web: boolean;
|
|
50
|
+
webNote?: string;
|
|
51
|
+
workerId?: string;
|
|
52
|
+
polled: boolean;
|
|
53
|
+
warnings: string[];
|
|
54
|
+
};
|
|
55
|
+
export declare class CaptureInstallError extends Error {
|
|
56
|
+
readonly code: string;
|
|
57
|
+
constructor(code: string, message: string);
|
|
58
|
+
}
|
|
59
|
+
/** Node ≥ 22, the rights, and the service manager, each refused by name (plan §5 "doctor names the failure"). */
|
|
60
|
+
export declare function preflight(sys: Sys, layout: Layout): void;
|
|
61
|
+
export declare function install(input: InstallInput): Promise<InstallReport>;
|
|
62
|
+
export type UninstallInput = {
|
|
63
|
+
sys: Sys;
|
|
64
|
+
layout: Layout;
|
|
65
|
+
keepKey?: boolean;
|
|
66
|
+
log?: (line: string) => void;
|
|
67
|
+
};
|
|
68
|
+
/** Removes the services, the code, the state and (unless kept) the key; on Linux the users and the group. */
|
|
69
|
+
export declare function uninstall(input: UninstallInput): void;
|
|
70
|
+
/** What `status` prints: versions, services, the last poll, the web profile, and the updater's last run. */
|
|
71
|
+
export declare function statusLines(sys: Sys, layout: Layout): string[];
|
|
72
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/install/install.ts"],"names":[],"mappings":"AAYA,OAAO,EACmE,KAAK,aAAa,EAAE,KAAK,MAAM,EACxG,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAgB,MAAM,cAAc,CAAC;AAI3E,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC,MAAM,MAAM,UAAU,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAEpF,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,GAAG,CAAC;IACT,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+GAA+G;IAC/G,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,kFAAkF;IAClF,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IAC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