Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
161 changes: 101 additions & 60 deletions bin/fetch-warp-releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,29 @@ import fs from "fs";
import YAML from "yaml";
import { marked } from "marked";

const tracks = [
"windows/ga",
"windows/beta",
"macos/ga",
"macos/beta",
"noble-intel/ga",
"noble-intel/beta",
const BASE_URL = "https://downloads.cloudflareclient.com/v1/update/json";

const platforms = [
"windows",
"macos",
"noble-intel",
"noble-arm",
"jammy-intel",
"jammy-arm",
"focal-intel",
"focal-arm",
"buster-intel",
"buster-arm",
"bullseye-intel",
"bullseye-arm",
"bookworm-intel",
"bookworm-arm",
"centos8-intel",
"centos8-arm",
"fedora34-intel",
"fedora34-arm",
"fedora35-intel",
"fedora35-arm",
];

const linesToRemove = [
Expand All @@ -18,72 +34,97 @@ const linesToRemove = [
"For Consumer documentation please see: <https://developers.cloudflare.com/warp-client/>",
];

for (let track of tracks) {
fetch(`https://downloads.cloudflareclient.com/v1/update/json/${track}`)
.then((res) => res.json())
.then((data) => {
if (!data.items) {
console.warn(
`${track} has no releases: ${JSON.stringify(data, null, 2)}`,
);

return;
}

data.items.forEach((item) => {
if (track.startsWith("noble-intel")) {
track = track.replace("noble-intel", "linux");
}

const folder = `./src/content/warp-releases/${track}`;
const path = `${folder}/${item.version}.yaml`;
for (const platform of platforms) {
const isLinux = platform !== "windows" && platform !== "macos";

if (!fs.existsSync(folder)) {
fs.mkdirSync(folder, { recursive: true });
}
for (const track of ["ga", "beta"]) {
fetch(`${BASE_URL}/${platform}/${track}`)
.then((res) => res.json())
.then((data) => {
if (!data.items) {
console.warn(
`${track} has no releases: ${JSON.stringify(data, null, 2)}`,
);

if (fs.existsSync(path)) {
console.log(`${track} ${item.version} already exists.`);
return;
}

console.log(`Saving ${track} ${item.version}.`);
data.items.forEach((item) => {
let folder = `./src/content/warp-releases/`;

let markdown = item.releaseNotes;
if (isLinux) {
folder += `linux/${track}`;
} else {
folder += `${platform}/${track}`;
}

markdown.replace(/\r\n/g, "\n");
const path = `${folder}/${item.version}.yaml`;

for (const line of linesToRemove) {
markdown = markdown.replace(line, "");
}
if (!fs.existsSync(folder)) {
fs.mkdirSync(folder, { recursive: true });
}

if (fs.existsSync(path)) {
if (isLinux) {
const existingFile = YAML.parse(fs.readFileSync(path, "utf-8"));

existingFile.linuxPlatforms ??= [];

markdown = markdown.trim();
if (!existingFile.linuxPlatforms.includes(platform)) {
console.log(
`Adding ${platform} to Linux ${track} ${item.version}.`,
);

const tokens = marked.lexer(markdown);
existingFile.linuxPlatforms.push(platform);
}

marked.walkTokens(tokens, (token) => {
if (token.type === "heading") {
token.type = "strong";
token.raw = `**${token.text}**\n`;
fs.writeFileSync(path, YAML.stringify(existingFile), "utf-8");
} else {
console.log(
`${platform} ${track} ${item.version} already exists.`,
);
}

delete token.depth;
return;
}
});

const releaseNotes = tokens.reduce((s, t) => s + t.raw, "");
const platformName = data.platformName.startsWith("noble-")
? "Linux"
: data.platformName;

fs.writeFileSync(
`./src/content/warp-releases/${track}/${item.version}.yaml`,
YAML.stringify({
...item,
releaseNotes,
platformName,
}),
"utf-8",
);
console.log(`Saving ${track} ${item.version}.`);

let markdown = item.releaseNotes;

markdown.replace(/\r\n/g, "\n");

for (const line of linesToRemove) {
markdown = markdown.replace(line, "");
}

markdown = markdown.trim();

const tokens = marked.lexer(markdown);

marked.walkTokens(tokens, (token) => {
if (token.type === "heading") {
token.type = "strong";
token.raw = `**${token.text}**\n`;

delete token.depth;
}
});

const releaseNotes = tokens.reduce((s, t) => s + t.raw, "");
const platformName = isLinux ? "Linux" : data.platformName;

fs.writeFileSync(
path,
YAML.stringify({
...item,
releaseNotes,
platformName,
linuxPlatforms: isLinux ? [platform] : undefined,
}),
"utf-8",
);
});
});
});
}
}
91 changes: 90 additions & 1 deletion src/components/WARPRelease.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,53 @@ const props = z.object({
});

const { header, open, release } = props.parse(Astro.props);

const getPrettyLinuxName = (platform: string) => {
switch (platform) {
case "noble-intel":
return "Ubuntu Noble (Intel)";
case "noble-arm":
return "Ubuntu Noble (Arm)";
case "jammy-intel":
return "Ubuntu Jammy (Intel)";
case "jammy-arm":
return "Ubuntu Jammy (Arm)";
case "focal-intel":
return "Ubuntu Focal (Intel)";
case "focal-arm":
return "Ubuntu Focal (Arm)";
case "buster-intel":
return "Debian Buster (Intel)";
case "buster-arm":
return "Ubuntu Buster (Arm)";
case "bullseye-intel":
return "Debian Bullseye (Intel)";
case "bullseye-arm":
return "Debian Bullseye (Arm)";
case "bookworm-intel":
return "Debian Bookworm (Intel)";
case "bookworm-arm":
return "Debian Bookworm (Arm)";
case "centos8-intel":
return "Centos 8 (Intel)";
case "centos8-arm":
return "Centos 8 (Arm)";
case "fedora34-intel":
return "Fedora 34 (Intel)";
case "fedora34-arm":
return "Fedora 34 (Arm)";
case "fedora35-intel":
return "Fedora 35 (Intel)";
case "fedora35-arm":
return "Fedora 35 (Arm)";
default:
return platform;
}
};

release.linuxPlatforms?.sort((a, b) => {
return getPrettyLinuxName(a).localeCompare(getPrettyLinuxName(b));
});
---

<Details header={header} open={open}>
Expand All @@ -37,8 +84,28 @@ const { header, open, release } = props.parse(Astro.props);
)
}
</div>
</p>
<p>
<span>
<a href={release.packageURL}>Download</a>
{
release.linuxPlatforms ? (
<warp-linux-downloads data-version={release.version}>
<select>
{release.linuxPlatforms.map((platform) => (
<option value={platform}>{getPrettyLinuxName(platform)}</option>
))}
</select>
<a
class="inline-block"
href={`https://downloads.cloudflareclient.com/v1/download/${release.linuxPlatforms[0]}/version/${release.version}`}
>
Download
</a>
</warp-linux-downloads>
) : (
<a href={release.packageURL}>Download</a>
)
}
</span>
</p>
<p>
Expand All @@ -48,3 +115,25 @@ const { header, open, release } = props.parse(Astro.props);
<Fragment set:html={marked.parse(release.releaseNotes)} />
</p>
</Details>

<script>
class WarpLinuxDownloads extends HTMLElement {
connectedCallback() {
const dropdown = this.querySelector<HTMLSelectElement>("select");

dropdown?.addEventListener("change", () => {
console.log("change");
const platform = dropdown?.value;
const download = this.querySelector<HTMLAnchorElement>("a");

console.log(download);
download?.setAttribute(
"href",
`https://downloads.cloudflareclient.com/v1/download/${platform}/version/${this.dataset.version}`,
);
});
}
}

customElements.define("warp-linux-downloads", WarpLinuxDownloads);
</script>
14 changes: 12 additions & 2 deletions src/content/warp-releases/linux/beta/2025.2.459.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ releaseNotes: >-

**Changes and improvements**

- Improved command line interface for Access for Infrastructure
with added function for filtering and ordering.
- Improved command line interface for Access for Infrastructure with added
function for filtering and ordering.

- Fixed client connectivity issues when switching between managed network
profiles that use different WARP protocols.
Expand All @@ -27,3 +27,13 @@ releaseDate: 2025-03-13T17:13:33.600Z
packageURL: https://downloads.cloudflareclient.com/v1/download/noble-intel/version/2025.2.459.1
packageSize: 44462470
platformName: Linux
linuxPlatforms:
- buster-intel
- fedora34-intel
- jammy-intel
- fedora35-intel
- bookworm-intel
- focal-intel
- bullseye-intel
- centos8-intel
- noble-intel
28 changes: 15 additions & 13 deletions src/content/warp-releases/linux/beta/2025.2.460.1.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
releaseNotes: >-
This release contains significant improvements to our captive portal / public
Wi-Fi detection logic. If you have experienced captive portal issues in the past, re-test and give this version a try.

releaseNotes: |-
This release contains significant improvements to our captive portal / public Wi-Fi detection logic. If you have experienced captive portal issues in the past, re-test and give this version a try.

**Changes and improvements**

- Improved [captive portal detection](/cloudflare-one/connections/connect-devices/warp/configure-warp/warp-settings/captive-portals/) to make more public networks compatible
and have faster detection.

- WARP tunnel protocol details can now be viewed using the `warp-cli tunnel stats`
command.

- Fixed issue with device revocation and re-registration when switching
configurations.
- Improved [captive portal detection](/cloudflare-one/connections/connect-devices/warp/configure-warp/warp-settings/captive-portals/) to make more public networks compatible and have faster detection.
- WARP tunnel protocol details can now be viewed using the `warp-cli tunnel stats` command.
- Fixed issue with device revocation and re-registration when switching configurations.
version: 2025.2.460.1
releaseDate: 2025-03-13T18:24:32.891Z
packageURL: https://downloads.cloudflareclient.com/v1/download/noble-intel/version/2025.2.460.1
packageSize: 44461586
platformName: Linux
linuxPlatforms:
- buster-intel
- fedora34-intel
- jammy-intel
- fedora35-intel
- bookworm-intel
- focal-intel
- bullseye-intel
- centos8-intel
- noble-intel
19 changes: 19 additions & 0 deletions src/content/warp-releases/linux/beta/2025.4.589.1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,22 @@ releaseDate: 2025-04-22T19:12:01.383Z
packageURL: https://downloads.cloudflareclient.com/v1/download/noble-intel/version/2025.4.589.1
packageSize: 45489326
platformName: Linux
linuxPlatforms:
- fedora35-arm
- bullseye-arm
- buster-intel
- focal-arm
- fedora34-intel
- jammy-intel
- bookworm-arm
- buster-arm
- fedora35-intel
- bookworm-intel
- focal-intel
- bullseye-intel
- centos8-intel
- noble-intel
- centos8-arm
- fedora34-arm
- jammy-arm
- noble-arm
Loading
Loading