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:
2026-06-15 22:12:18 -05:00
parent 2e0931343f
commit 42cd7a7b4d
5 changed files with 164 additions and 7 deletions

View 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" },
});
}