A modular, Go-based application for managing Cloudflare DNS records for anvilcomputing.com.
Packaged declaratively using NixOS Flakes for deployment to Proxmox VE LXC containers, this tool provides both a Command Line Interface (CLI) and a data-dense Web Admin Dashboard. It is designed to quickly provision unproxied A records that point to a VPS running a reverse proxy, prevent naming collisions, and provide simple commands to audit and clean up your Cloudflare zone.
- Dual Interfaces: Manage DNS via the terminal or a data-dense, filtering-enabled web dashboard.
- Collision Prevention: Automatically checks if a subdomain exists before provisioning.
- Interactive Auditing: Instant client-side filtering (Web) to easily audit existing records.
- Declarative Infrastructure: The entire OS, networking (Tailscale), SSH configuration, and Go application are built into a single, reproducible Proxmox LXC template via
flake.nix. - GitOps Ready: Continuous deployment over SSH using
deploy-rs.
- A Cloudflare API Token with the following permissions:
Zone->DNS->Edit- Zone Resources:
Include->Specific Zone->anvilcomputing.com
- Nix installed locally with Flakes enabled.
- A Proxmox VE cluster.
This process only needs to be done once to seed the initial container.
Run this command locally to compile the Go application and the entire NixOS operating system into a single Proxmox template:
nix build .#lxc-templatego run cmd/cli/main.go check
go run cmd/cli/main.go create --target-ip <VPS_IP>
go run cmd/cli/main.go list
go run cmd/cli/main.go delete
The Web Admin provides a responsive, data-dense UI to perform the same actions as the CLI. It runs a lightweight HTTP server on port 8081.
go run cmd/web/main.goOnce running, open your browser and navigate to: http://localhost:8081
Web Features:
- Create records using a simple form.
- Instantly filter active subdomains by Name or Record Type without page reloads.
- Delete records with one click (includes safety confirmations).
- No horizontal scrolling; optimized for desktop data density.
anvil-dns/
├── cmd/
│ ├── cli/ # The CLI interface (Cobra/Viper)
│ └── web/ # The Web Admin interface (net/http, html/template)
│ ├── main.go
│ └── index.html
├── internal/
│ └── cloudflare/ # Shared Core API logic
├── go.mod
└── go.sum
-
webInterface (Admin UI): Create a lightweight, data-dense HTML frontend. - NixOS & Proxmox Packaging:
- Add a
flake.nixto package the Go binaries. - Create a declarative NixOS LXC configuration for Proxmox.
- Implement
sops-nixfor secure, encrypted Cloudflare API token management. - Enable continuous deployment via
deploy-rs.
- Add a
-
apiInterface: Addcmd/api/main.goto expose the core logic as a REST/Webhook interface for CI/CD automation agents. - Cloudflare Proxy Support: Add a flag/toggle to optionally enable the Cloudflare proxy ("orange cloud").