v0.8.0 — Update-available detection (version chip + changelog)
Footer becomes a changelog chip and shows an 'Update available' badge when a newer APP_VERSION exists upstream. Detection reads src/lib/version.ts from the Gitea default branch (dms model) and compares — self-contained, no OTM control plane. Adds src/lib/update-check.ts and GET /api/version (also a running-version probe for the upcoming one-click rebuild). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
19
src/app/api/version/route.ts
Normal file
19
src/app/api/version/route.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { requireAuth } from "@/lib/auth";
|
||||
import { getUpdateStatus } from "@/lib/update-check";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
// Running-version probe + upstream update check. Used by the footer chip, and
|
||||
// (later) polled by the self-update UI to detect when the rebuilt instance is
|
||||
// back online on the new version.
|
||||
export async function GET() {
|
||||
try {
|
||||
await requireAuth();
|
||||
} catch {
|
||||
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
|
||||
}
|
||||
return NextResponse.json(await getUpdateStatus(), {
|
||||
headers: { "Cache-Control": "no-store" },
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user