Add portable Windows desktop downloads and release uploads

This commit is contained in:
2026-10-11 11:44:27 +05:00
parent fc6da6756d
commit a54a3e7705
24 changed files with 4159 additions and 5 deletions

33
tests/desktop.test.ts Normal file
View File

@@ -0,0 +1,33 @@
import assert from "node:assert/strict";
import { test } from "node:test";
import { createRequire } from "node:module";
const require = createRequire(import.meta.url);
const { isInternal, isExternal } = require("../desktop/navigation.cjs");
test("desktop navigation confines remote content to the production origin", () => {
assert.equal(isInternal("https://minegeo.vercel.app/play?map=1"), true);
for (const url of [
"http://minegeo.vercel.app",
"https://minegeo.vercel.app.evil.test",
"https://minegeo.vercel.app@evil.test",
"file:///C:/Windows",
"javascript:alert(1)",
"not a URL",
]) {
assert.equal(isInternal(url), false, url);
}
});
test("desktop only opens credential-free HTTPS links in external apps", () => {
assert.equal(isExternal("https://discord.com/invite/example"), true);
for (const url of [
"file:///C:/Windows",
"javascript:alert(1)",
"ms-settings:windowsupdate",
"http://example.com",
"https://user:password@example.com",
"not a URL",
]) {
assert.equal(isExternal(url), false, url);
}
});