Files
JakeHillion abfb823bec
commit-validation / validate-single-commit (pull_request) Successful in 2s
flake / flake (push) Successful in 3m35s
nix-builder (aarch64-linux) Build completed successfully
nix-builder (x86_64-linux) Build completed successfully
nebula: replace internal CA with public ACME using DNS-01 challenges
Internal Nebula services previously used a step-ca ACME server for TLS
certificates. This required running a CA service and distributing root
certificates to all clients.

Implemented a custom ACME DNS-01 challenge system that allows Nebula
services to obtain Let's Encrypt certificates. The system consists of:
a Perl API service (acme-dns-api) that validates requests by checking
that the client's Nebula IP matches DNS resolution of the requested
domain, then uses knotc to add/remove TXT records via atomic zone
transactions; a custom Caddy DNS plugin (caddy-dns-jakehillion) that
communicates with this API; and replacement of NSD with Knot DNS for
authoritative DNS to support dynamic updates.

This eliminates the need for internal CA infrastructure while
maintaining security through IP-based validation on the Nebula network.

Test plan:
- Built configuration with `nix build '.#nixosConfigurations."boron.cx.neb.jakehillion.me".config.system.build.toplevel'`
2026-02-05 17:17:32 +00:00

48 lines
937 B
Go

package jakehillion
import (
"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
)
func init() {
caddy.RegisterModule(Provider{})
}
// CaddyModule returns the Caddy module information.
func (Provider) CaddyModule() caddy.ModuleInfo {
return caddy.ModuleInfo{
ID: "dns.providers.jakehillion",
New: func() caddy.Module { return new(Provider) },
}
}
// UnmarshalCaddyfile sets up the DNS provider from Caddyfile tokens.
//
// Syntax:
//
// jakehillion {
// api_endpoint <url>
// }
func (p *Provider) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
for d.Next() {
for d.NextBlock(0) {
switch d.Val() {
case "api_endpoint":
if !d.NextArg() {
return d.ArgErr()
}
p.APIEndpoint = d.Val()
default:
return d.Errf("unrecognized subdirective: %s", d.Val())
}
}
}
return nil
}
// Interface guards
var (
_ caddyfile.Unmarshaler = (*Provider)(nil)
)