capiumbrowser 0.1.1 → 1.0.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/lib/channels.json +4 -4
- package/lib/download.js +12 -4
- package/lib/license.js +3 -0
- package/package.json +1 -1
package/lib/channels.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_comment": "SINGLE SOURCE OF TRUTH for the current stable Capium browser build per OS/arch. Each OS reaches stable independently -- edit one entry without touching the others. This file ships inside the wheel (the SDK reads it to pick each host's stable build) AND is published to the download server by the release pipeline (so the server/website can resolve 'latest stable' without a new SDK release). `version` is the Chromium base of the immutable artifact folder; `revision` is the cap<N> re-spin counter. `published: false` means the tag is declared but no artifact exists yet -- the SDK raises a clear 'not published yet' error instead of a raw 404.",
|
|
3
3
|
"schema": 1,
|
|
4
|
-
"updated": "2026-09-
|
|
4
|
+
"updated": "2026-09-02",
|
|
5
5
|
"channels": {
|
|
6
6
|
"stable": {
|
|
7
|
-
"windows-x64": { "version": "152.0.7977.65", "revision":
|
|
8
|
-
"macos-arm64": { "version": "152.0.7977.65", "revision":
|
|
9
|
-
"linux-x64": { "version": "152.0.7977.64", "revision":
|
|
7
|
+
"windows-x64": { "version": "152.0.7977.65", "revision": 2, "sha256": "eec6d63a8a1ae7371388a39d10506117261131768020f15aa2d281d9931d35c0", "published": true },
|
|
8
|
+
"macos-arm64": { "version": "152.0.7977.65", "revision": 2, "sha256": "350e7f87b8f8e7e32feee26b8844e80b4650c9aa5fb6888fbcf4cc19fb08eda9", "published": true },
|
|
9
|
+
"linux-x64": { "version": "152.0.7977.64", "revision": 2, "sha256": "248e735b3afec58a44e962cd866f704adfb15ee8b71cf976665dd109f512b7c5", "published": true },
|
|
10
10
|
"linux-arm64": { "version": "152.0.7977.64", "revision": 1, "sha256": null, "published": false }
|
|
11
11
|
}
|
|
12
12
|
}
|
package/lib/download.js
CHANGED
|
@@ -41,9 +41,10 @@ const tar = require('tar');
|
|
|
41
41
|
const config = require('./config');
|
|
42
42
|
const license = require('./license');
|
|
43
43
|
const { CapiumError, CapiumExpiredError, CapiumServerDownError } = require('./errors');
|
|
44
|
-
const { binaryVersionFor, isPublished } = require('./version');
|
|
44
|
+
const { SDK_VERSION, binaryVersionFor, isPublished } = require('./version');
|
|
45
45
|
|
|
46
46
|
const NET_TIMEOUT_MS = 300000;
|
|
47
|
+
const USER_AGENT = `capiumbrowser/${SDK_VERSION}`;
|
|
47
48
|
|
|
48
49
|
// (normalized os, normalized arch) -> distro tag used in the filename/URL.
|
|
49
50
|
const SUPPORTED = {
|
|
@@ -86,8 +87,11 @@ function downloadTag(system = null, machine = null) {
|
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
/**
|
|
89
|
-
* The signed request path for a build
|
|
90
|
-
*
|
|
90
|
+
* The signed request path for a build: version in the folder, tag in the filename
|
|
91
|
+
* (`/download/distro/chromium-v<version>/capiumbrowser-<tag>.tar.gz`). Per-OS versions work
|
|
92
|
+
* because each tag lives under its own chromium-v<version>/ folder (win/mac .65 while linux
|
|
93
|
+
* is .64). Key travels in the X-Capzy-License header, the path is HMAC-signed, and the bytes
|
|
94
|
+
* are verified against the response's X-Capzy-SHA256.
|
|
91
95
|
*/
|
|
92
96
|
function distroPath(version, tag) {
|
|
93
97
|
return `/download/distro/chromium-v${version}/capiumbrowser-${tag}.tar.gz`;
|
|
@@ -216,8 +220,12 @@ function removeInstalls(root) {
|
|
|
216
220
|
*/
|
|
217
221
|
async function download(url, headers, dest, version, tag) {
|
|
218
222
|
let res;
|
|
223
|
+
// Identify the SDK on every request. undici otherwise sends a default UA that Cloudflare's
|
|
224
|
+
// Browser Integrity Check rejects as a bot (403) before the request reaches the origin. A
|
|
225
|
+
// stable product UA is both correct hygiene and what the edge allows.
|
|
226
|
+
const h = Object.assign({ 'User-Agent': USER_AGENT }, headers || {});
|
|
219
227
|
try {
|
|
220
|
-
res = await fetch(url, { headers:
|
|
228
|
+
res = await fetch(url, { headers: h, signal: AbortSignal.timeout(NET_TIMEOUT_MS) });
|
|
221
229
|
} catch (e) {
|
|
222
230
|
throw new CapiumServerDownError(
|
|
223
231
|
`could not reach the download server ${url}: ${e.cause?.message || e.message || e}`);
|
package/lib/license.js
CHANGED
|
@@ -14,8 +14,10 @@ const os = require('os');
|
|
|
14
14
|
const path = require('path');
|
|
15
15
|
|
|
16
16
|
const { CapiumConfigError, CapiumExpiredError, CapiumServerDownError } = require('./errors');
|
|
17
|
+
const { SDK_VERSION } = require('./version');
|
|
17
18
|
|
|
18
19
|
const DEFAULT_SERVER = 'https://license.capzy.ai';
|
|
20
|
+
const USER_AGENT = `capiumbrowser/${SDK_VERSION}`;
|
|
19
21
|
|
|
20
22
|
function licenseFile() {
|
|
21
23
|
// CAPIUM_LICENSE_FILE is a test/deploy override; the contract path is ~/.capium/license.
|
|
@@ -167,6 +169,7 @@ async function status(key = null, server = null) {
|
|
|
167
169
|
'X-Capzy-Device-Fp': fp,
|
|
168
170
|
'X-Capzy-Signature': sig,
|
|
169
171
|
'Content-Type': 'application/json',
|
|
172
|
+
'User-Agent': USER_AGENT,
|
|
170
173
|
},
|
|
171
174
|
signal: AbortSignal.timeout(10000),
|
|
172
175
|
});
|
package/package.json
CHANGED