Add developer API, Prometheus metrics, and community links

This commit is contained in:
2026-10-12 19:59:37 +05:00
parent 3cc3136762
commit 018be5049e
50 changed files with 4087 additions and 31 deletions

16
lib/forum.ts Normal file
View File

@@ -0,0 +1,16 @@
import "server-only";
import forum from "@/shared/forum.json";
/** Only expose a public HTTPS destination, never embedded credentials. */
export function forumUrl() {
const value = process.env.MINEGEO_FORUM_URL ?? forum.url;
if (!value.trim()) return null;
try {
const url = new URL(value.trim());
if (url.protocol !== "https:" || url.username || url.password || url.port)
return null;
return url.href;
} catch {
return null;
}
}