Some checks failed
Build and Push Docker Images (Trusted) / build-and-push (., docker/caddy/Dockerfile, caddy) (push) Has been cancelled
Build and Push Docker Images (Trusted) / build-and-push (., docker/l4-port-manager/Dockerfile, l4-port-manager) (push) Has been cancelled
Build and Push Docker Images (Trusted) / build-and-push (., docker/web/Dockerfile, web) (push) Has been cancelled
Tests / test (push) Has been cancelled
19 lines
548 B
TypeScript
Executable File
19 lines
548 B
TypeScript
Executable File
import { existsSync } from "node:fs";
|
|
import { NextRequest, NextResponse } from "next/server";
|
|
import { requireApiAdmin, apiErrorResponse } from "@/src/lib/api-auth";
|
|
|
|
const COUNTRY_DB = "/usr/share/GeoIP/GeoLite2-Country.mmdb";
|
|
const ASN_DB = "/usr/share/GeoIP/GeoLite2-ASN.mmdb";
|
|
|
|
export async function GET(request: NextRequest) {
|
|
try {
|
|
await requireApiAdmin(request);
|
|
return NextResponse.json({
|
|
country: existsSync(COUNTRY_DB),
|
|
asn: existsSync(ASN_DB),
|
|
});
|
|
} catch (error) {
|
|
return apiErrorResponse(error);
|
|
}
|
|
}
|