Serve daemon-managed .vm names directly from bangerd on 127.0.0.1:42069 instead of shelling out to mapdns. This keeps DNS state tied to VM lifecycle and lets the daemon rebuild records from running VMs after startup or reconcile. Add a small in-process authoritative DNS server, register and remove records from the VM start/stop/delete paths, and show the listener in daemon status. Remove the mapdns config and preflight surface, stop helper-flow DNS publishing in customize.sh and interactive.sh, drop dns.sh from the runtime bundle, and update docs/tests for the new local-resolver integration model. Validated with GOCACHE=/tmp/banger-gocache go test ./..., GOCACHE=/tmp/banger-gocache make build, and bash -n customize.sh interactive.sh.
2.7 KiB
2.7 KiB
Repository Guidelines
Project Structure & Module Organization
cmd/bangerandcmd/bangerdare the primary user-facing entrypoints.internal/contains the daemon, CLI, RPC, storage, Firecracker, and system integration code.customize.sh,make-rootfs.sh, andinteractive.shremain as image-build/customization helpers; normal VM lifecycle, NAT, and.vmDNS are handled by the Go control plane.- Source checkouts use a generated
./runtime/bundle for Firecracker, kernels, modules, rootfs images, and helper copies. Bundle defaults come from./runtime/bundle.jsonwhen present. Those runtime artifacts are not meant to be tracked directly in Git. - The daemon keeps state under XDG directories rather than the old repo-local
state/layout.
Build, Test, and Development Commands
make buildbuilds./bangerand./bangerd.make runtime-bundlebootstraps./runtime/from the archive referenced byRUNTIME_MANIFEST; the checked-inruntime-bundle.tomlis only a template.bangervalidates required host tools per command and reports actionable missing-tool errors; do not assume one workstation's package set../banger vm create --name testboxcreates and starts a VM../banger vm ssh testboxconnects to a running guest../banger vm stop testboxstops a VM while preserving its disks../banger tuilaunches the terminal UI.make testrunsgo test ./...../verify.shruns the smoke test for the Go VM workflow.
Coding Style & Naming Conventions
- Go code should stay small, direct, and standard-library-first unless there is a clear reason otherwise.
- Shell helpers use Bash with
set -euo pipefail; keep remaining shell scripts strict and explicit. - Prefer lowercase filenames with short descriptive names.
- Use
gofmtfor Go formatting; no extra formatter is configured for shell files.
Testing Guidelines
- Primary automated coverage is
go test ./.... - Manual verification for VM lifecycle changes:
./banger vm create, confirm SSH access, then stop/delete the VM. - If you add a new operational workflow, document how to exercise it in
README.md. - For NAT changes, verify both guest outbound access and host rule cleanup, for example with
./verify.sh --nat.
Commit & Pull Request Guidelines
- Git history uses short, imperative subjects.
- Prefer a real commit body when the change affects lifecycle behavior, storage semantics, or host integration.
- PRs should call out runtime requirements, migration impact, and any host-side verification performed.
Security & Configuration Tips
- The VM workflow requires
sudoand/dev/kvmaccess; do not commit secrets. id_ed25519lives inside the runtime bundle; rotate or replace it before publishing a shared bundle.