fix(version): move the finer geo state to the admin status

geoLookup and geoProviderChosen on the public /api/version added one
more way to tell instances apart. They now live on /api/admin/status
(requireAdmin, cookie only) as geo { lookup, providerChosen,
providerHost }, which both admin status views read. offlineGeoEnabled
and geoProviderHost stay public as before.
This commit is contained in:
Marc-André Bombeck committed 2026-10-09 10:44:18 +02:00
1 parent 0ea8d929d2
commit 470ddeedc4
11 files changed
+135 -128

No files matched your search

+21 -26
View File
@@ -25,7 +25,6 @@ import { useFormatters, useTranslations } from "@/lib/i18n/context";
import {
geoLookupState,
StatusItem,
usePublicVersion,
useSystemStatus,
type FailingQueue,
} from "./_shared";
@@ -129,7 +128,6 @@ export function SystemStatusSection() {
const { t } = useTranslations();
const fmt = useFormatters();
const { data: status, isError, refetch } = useSystemStatus();
const { data: version } = usePublicVersion();
return (
<div className="space-y-6">
@@ -238,30 +236,27 @@ export function SystemStatusSection() {
tone="success"
/>
)}
{/* v1.4.27 R5 — offline GeoLite2 availability. Renders only
when /api/version returns the new field so legacy
responses do not produce a placeholder row. */}
{version?.offlineGeoEnabled !== undefined && (
<StatusItem
icon={Map}
label={t("admin.offlineGeoLabel")}
value={
{
offline: t("admin.offlineGeoEnabled"),
off: t("admin.offlineGeoOff"),
chosen: t("admin.offlineGeoChosen", {
host: version.geoProviderHost ?? "ipwho.is",
}),
default: t("admin.offlineGeoFallback", {
host: version.geoProviderHost ?? "ipwho.is",
}),
}[geoLookupState(version)]
}
tone={
geoLookupState(version) === "default" ? "warning" : "success"
}
/>
)}
{/* v1.4.27 R5 — offline GeoLite2 availability, read from the
admin status rather than the public /api/version. */}
<StatusItem
icon={Map}
label={t("admin.offlineGeoLabel")}
value={
{
offline: t("admin.offlineGeoEnabled"),
off: t("admin.offlineGeoOff"),
chosen: t("admin.offlineGeoChosen", {
host: status.geo.providerHost,
}),
default: t("admin.offlineGeoFallback", {
host: status.geo.providerHost,
}),
}[geoLookupState(status.geo)]
}
tone={
geoLookupState(status.geo) === "default" ? "warning" : "success"
}
/>
</div>
) : isError ? (
// P19: surface load failures inline instead of leaving the