import type { Metadata } from "next"; import { Settings, ArrowRight, Shield, Globe, Gauge, Database, } from "lucide-react"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { Separator } from "@/components/ui/separator"; export const metadata: Metadata = { title: "Configuration", }; function CodeBlock({ code }: { code: string }) { return (
{code.trim()}
);
}
function EnvVar({
name,
defaultVal,
required,
description,
}: {
name: string;
defaultVal: string;
required?: boolean;
description: string;
}) {
return (
{name}
{defaultVal}
) : (
—
)}
All server configuration is done via environment variables or a{" "} .env{" "} file in the project root.
Copy{" "}
.env.example
{" "}
to{" "}
.env
{" "}
to get started:{" "}
cp .env.example .env
| Variable | Default | Description |
|---|
The Go server uses a shared API key for authentication. This is intentional: the server is designed to be an internal service called only by your Next.js backend — not directly by end users.
When{" "} API_KEY {" "} is set, every request (except{" "} GET /health ) must include the header:
Requests missing or sending an incorrect key receive a{" "} 401 UNAUTHORIZED {" "} response.
Store{" "} DNS_API_KEY {" "} as a secret environment variable in your Next.js deployment. Never expose it client-side.
CORS is handled by{" "} go-chi/cors . Configure allowed origins via the{" "} CORS_ORIGINS {" "} variable.
Development
Production (single domain)
Production (multiple domains)
Since the Go server is an internal API called server-side by Next.js, CORS is mostly relevant for development. In production, only your Next.js server IP/domain needs access.
Rate limiting is provided by{" "} go-chi/httprate {" "} and is enabled by default.
DNS result caching via Redis is on the roadmap. When available, the server will check Redis before querying upstream DNS, storing results with TTL-based expiry.
The cache layer will use{" "} go-redis {" "} and sit as middleware before DNS resolution. A{" "} docker-compose.yml {" "} bundling the Go server with Redis will be provided.