mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-17 07:42:23 +00:00
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:
1 parent
0ea8d929d2
commit
470ddeedc4
11 files changed
+135
-128
No files matched your search
@@ -9,6 +9,11 @@ import {
|
||||
readFailingQueues,
|
||||
} from "@/lib/jobs/job-failures";
|
||||
import { readFileSync } from "node:fs";
|
||||
import {
|
||||
geoLookupMode,
|
||||
geoProviderChosen,
|
||||
resolveGeoProviderHost,
|
||||
} from "@/lib/geo";
|
||||
|
||||
// Build timestamp (set at build time via next.config)
|
||||
const BUILD_TIME = process.env.BUILD_TIMESTAMP || new Date().toISOString();
|
||||
@@ -109,5 +114,12 @@ export const GET = apiHandler(async () => {
|
||||
: null,
|
||||
webPush: webPushConfigured ? { configured: true } : null,
|
||||
},
|
||||
// How login IPs are placed on this host. Admin-only: the public
|
||||
// `/api/version` keeps just `offlineGeoEnabled` and `geoProviderHost`.
|
||||
geo: {
|
||||
lookup: geoLookupMode(),
|
||||
providerChosen: geoProviderChosen(),
|
||||
providerHost: resolveGeoProviderHost(),
|
||||
},
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user