Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/plutoploy/dns-handling/llms.txt

Use this file to discover all available pages before exploring further.

DNS Handling is configured entirely through environment variables, with sensible defaults for local development. Copy .env.example to .env, adjust the values for your environment, and the service will pick them up at startup via config.Load().

Variables

DATABASE_URL
default:"file:./tls.db"
LibSQL/SQLite connection string. Use file:./path.db for a local file-based SQLite database, or a Turso libsql:// URL for a remote managed database.Examples:
  • file:./tls.db — local SQLite file in the working directory
  • libsql://<database-name>.turso.io?authToken=<token> — remote Turso instance
ACME_EMAIL
default:"admin@example.com"
Contact email address registered with the ACME certificate authority. This address is used during ACME account creation and may receive renewal failure notifications from Let’s Encrypt.
ACME_DIRECTORY
ACME directory URL that points to the certificate authority’s API. The default is the Let’s Encrypt staging environment, which issues untrusted certificates suitable for testing without hitting production rate limits.Known values:
  • https://acme-staging-v02.api.letsencrypt.org/directory — Let’s Encrypt staging (default)
  • https://acme-v02.api.letsencrypt.org/directory — Let’s Encrypt production
SERVER_ADDR
default:":8080"
TCP address the HTTP server listens on. Follows Go’s net.Listen format: [host]:port. Omitting the host binds to all interfaces.Examples:
  • :8080 — all interfaces, port 8080
  • 127.0.0.1:9000 — localhost only, port 9000
LOG_LEVEL
default:"info"
Logging verbosity level. Accepted values are info and debug. Setting debug switches to development-mode logging with pretty-printed output and caller information.

Hardcoded Timing Constants

The following timing parameters are set directly in internal/config/config.go and are not configurable via environment variables:
ConstantValuePurpose
DNS_TIMEOUT10sTimeout for individual DNS lookup operations
POLL_INTERVAL10sInterval between ACME challenge status poll attempts
POLL_TIMEOUT5mMaximum total time to wait for an ACME challenge to complete

Example .env File

The .env.example file in the repository root provides a ready-to-copy template with all configurable variables:
# Database
DATABASE_URL=file:./tls.db

# ACME
ACME_EMAIL=admin@example.com
ACME_DIRECTORY=https://acme-staging-v02.api.letsencrypt.org/directory

# Server
SERVER_ADDR=:8080

# Logging
LOG_LEVEL=info
Before deploying to production, change ACME_DIRECTORY to the Let’s Encrypt production endpoint:
ACME_DIRECTORY=https://acme-v02.api.letsencrypt.org/directory
The default staging URL issues certificates that are not trusted by browsers or clients. Rate limits are also more lenient on staging, so keep the default while iterating during development.
Setting LOG_LEVEL=debug switches the logger to zap.NewDevelopment(), which enables pretty-printed, human-readable log output with file and line caller information. This is particularly useful when tracing the ACME DNS-01 challenge flow locally. Leave LOG_LEVEL=info (the default) in production to use the structured JSON logger from zap.NewProduction().

Build docs developers (and LLMs) love