diff --git a/frontend/src/features/download/api.ts b/frontend/src/features/download/api.ts index 0d97847..93370e8 100644 --- a/frontend/src/features/download/api.ts +++ b/frontend/src/features/download/api.ts @@ -4,10 +4,14 @@ const DEFAULT_REPO = 'loki5512344/LoVisual-' export const GITHUB_REPO: string = import.meta.env.VITE_GITHUB_REPO || DEFAULT_REPO /** - * One-click download of the newest build: GitHub redirects `releases/latest/download/` - * straight to the file, so every release must carry an asset named exactly `lovisual.jar`. + * One-click download of the newest build. Served directly from our own origin (not a + * github.com redirect) so the button keeps working even where GitHub itself is blocked. + * The file at `/downloads/lovisual.jar` on the server is NOT rebuilt automatically — + * whoever cuts a mod release has to `./gradlew build` and re-upload it there by hand + * (this is a separate Gradle project from the site, deliberately not wired into + * `backend/deploy/deploy.sh`). */ -export const DOWNLOAD_URL = `https://github.com/${GITHUB_REPO}/releases/latest/download/lovisual.jar` +export const DOWNLOAD_URL = '/downloads/lovisual.jar' /** A published GitHub release, narrowed to the fields the download page renders. */ export type Release = { diff --git a/frontend/src/features/download/tests/download.test.tsx b/frontend/src/features/download/tests/download.test.tsx index 4c26657..92579b0 100644 --- a/frontend/src/features/download/tests/download.test.tsx +++ b/frontend/src/features/download/tests/download.test.tsx @@ -23,9 +23,7 @@ afterEach(() => vi.restoreAllMocks()) test('DownloadButton links straight to the latest lovisual.jar', () => { const { container } = withQuery() const link = container.querySelector('a') - expect(link?.getAttribute('href')).toBe( - 'https://github.com/loki5512344/LoVisual-/releases/latest/download/lovisual.jar', - ) + expect(link?.getAttribute('href')).toBe('/downloads/lovisual.jar') expect(link?.hasAttribute('download')).toBe(true) })