Site: read the newest version from Gitea; links follow releases/latest [skip ci]

A worker answers /release.json from the Gitea API (Gitea sends no
CORS headers, so the page cannot ask it directly).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-13 13:35:58 -04:00
1 parent 48306fcd16
commit 87c42fde0e
14 files changed
+76 -16

No files matched your search

+10 -3
View File
@@ -1,3 +1,10 @@
// This version's release page holds every download.
export const VERSION = "0.1.4";
export const RELEASES = "https://git.zacharyzhang.com/ZacharyZhang-NY/ElyOffice/releases/tag/v0.1.4";
// Gitea redirects this to the newest release.
export const RELEASES = "https://git.zacharyzhang.com/ZacharyZhang-NY/ElyOffice/releases/latest";
/** The newest release's version, from the worker. */
export async function latest(): Promise<string> {
const res = await fetch("/release.json");
if (!res.ok) throw new Error(`release.json: ${res.status} ${await res.text()}`);
const { version } = (await res.json()) as { version: string };
return version;
}