Files
caddy-proxy-manager/app/api/geoip-status/route.ts
fuomag9 f80b0c4735 feat: add geoip-status API route with auth
Returns whether GeoLite2-Country and GeoLite2-ASN databases are loaded,
used by the UI to show the GeoIP ready indicator in GeoBlockFields.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 08:20:48 +01:00

15 lines
400 B
TypeScript

import { existsSync } from "node:fs";
import { NextResponse } from "next/server";
import { requireUser } from "@/src/lib/auth";
const COUNTRY_DB = "/usr/share/GeoIP/GeoLite2-Country.mmdb";
const ASN_DB = "/usr/share/GeoIP/GeoLite2-ASN.mmdb";
export async function GET() {
await requireUser();
return NextResponse.json({
country: existsSync(COUNTRY_DB),
asn: existsSync(ASN_DB),
});
}