Files
piik/scripts/app-package-targets.mjs
T
AAA 72d94ae8b3 chore(tunnel): refresh the pinned Cloudflared runtime
Use Cloudflared 2026.11.2 and its verified official asset digests, regenerate notices, and align the Android Go toolchain with upstream's 1.27.4 requirement. Keep explicit auto selection and the Android exhausted-QUIC repair, whose independent role remains reproduced.

All five desktop assets match asset-level digests and embedded build identity. Both Android ABIs pass the helper builder's PIE and 16 KB checks on both lines; the fallback decision control and Windows synthetic Quick Tunnel succeed. Full package checks and a live UDP-blocked fallback remain separate acceptance work.
2026-11-26 01:52:39 -05:00

103 lines
3.3 KiB
JavaScript

import semver from "semver";
export const CLOUDFLARED_VERSION = "2026.11.2";
export const CLOUDFLARED_SOURCE_SHA256 = "e9122343a3708e9a691239b5901916819e4933f8751a0364b3800fc5bc6a7ca4";
export const MACOS_MIN_VERSION = "13.0";
// Android packages both supported ABIs in one installable APK, not a Go CLI.
export const ANDROID_APP_PACKAGE_TARGET = {
id: "android-universal",
artifact: "piik-app-android-universal.apk",
};
export function androidVersionCode(version) {
if (version === "development") return 1;
const parsed = semver.parse(version);
if (!version.startsWith("v") || !parsed || parsed.version !== version.slice(1))
throw new Error("Android version must be vMAJOR.MINOR.PATCH with an optional prerelease suffix, or development");
const { major, minor, patch } = parsed;
const code = major * 1_000_000 + minor * 1_000 + patch;
if (minor > 999 || patch > 999 || !Number.isSafeInteger(code) || code < 1 || code > 2_100_000_000) {
throw new Error("Android versionCode requires minor/patch <= 999 and a code in 1..2100000000");
}
return code;
}
export const APP_PACKAGE_TARGETS = [
{
id: "windows-amd64",
nodePlatform: "win32",
nodeArch: "x64",
goos: "windows",
goarch: "amd64",
rustTarget: "x86_64-pc-windows-msvc",
appName: "piik-app.exe",
tunnelName: "cloudflared.exe",
tunnelAsset: "cloudflared-windows-amd64.exe",
tunnelSha256: "555b46c85582461d189cac30d14ad05480d612613801be9f110b8ce08c5b2113",
tunnelArchive: false,
},
{
id: "linux-amd64",
nodePlatform: "linux",
nodeArch: "x64",
goos: "linux",
goarch: "amd64",
rustTarget: "x86_64-unknown-linux-gnu",
appName: "piik-app",
tunnelName: "cloudflared",
tunnelAsset: "cloudflared-linux-amd64",
tunnelSha256: "56f13335143ec0e22772963290683a84a04114a35ec64cbc794a4d39ff9bb8cf",
tunnelArchive: false,
},
{
id: "linux-arm64",
nodePlatform: "linux",
nodeArch: "arm64",
goos: "linux",
goarch: "arm64",
rustTarget: "aarch64-unknown-linux-gnu",
appName: "piik-app",
tunnelName: "cloudflared",
tunnelAsset: "cloudflared-linux-arm64",
tunnelSha256: "04a7b7f08bce85d56b26ffe1fdbfbb21a074495a363d16f0783c40e25b5c5281",
tunnelArchive: false,
},
{
id: "darwin-arm64",
nodePlatform: "darwin",
nodeArch: "arm64",
goos: "darwin",
goarch: "arm64",
rustTarget: "aarch64-apple-darwin",
appName: "piik-app",
tunnelName: "cloudflared",
tunnelAsset: "cloudflared-darwin-arm64.tgz",
tunnelSha256: "f6d58eeec91ad1ec5fd1f7e4a587303772929b2625be5d24068033851c36ff55",
tunnelArchive: true,
},
{
id: "darwin-amd64",
nodePlatform: "darwin",
nodeArch: "x64",
goos: "darwin",
goarch: "amd64",
rustTarget: "x86_64-apple-darwin",
appName: "piik-app",
tunnelName: "cloudflared",
tunnelAsset: "cloudflared-darwin-amd64.tgz",
tunnelSha256: "6153d9ec629174882a3adbff2f7dc5a24b4f3bdd7ccc38eaa84fba26eb890311",
tunnelArchive: true,
},
];
export function appPackageTarget(id) {
return APP_PACKAGE_TARGETS.find((target) => target.id === id) ?? null;
}
// Finder can relocate a downloaded .app independently of its ZIP neighbours.
// Keep the executable and its existing relative runtime paths inside the bundle.
export function appPackageDirectory(target) {
return target.goos === "darwin" ? "Piik App.app/Contents/MacOS" : "";
}