Contributing
Ground rules, development workflow, and how to add a DNS provider.
DockRoute is MIT licensed and built in the open. Issues and pull requests are welcome at github.com/Dockroute/Dockroute.
Development
The project runs on Bun:
bun install
bun test # unit tests (in-memory fakes, no real HTTP)
bun run typecheck # strict TypeScript
bun run lint # Biome — bun run lint:fix to auto-fixGround rules
Three properties are non-negotiable, in this order:
- Ownership safety. Nothing may weaken the rule that unowned records are never modified, deleted or adopted. The planner's conflict handling is the heart of the project.
- Anti-corruption layer. Provider wire formats stay inside the provider's own directory. The core deals only in DockRoute's own types.
- Testing style. Tests use in-memory fakes, not HTTP mocks — a provider is tested by driving it against a fake API that enforces the real API's semantics.
See CONTRIBUTING.md for the full version.
Adding a provider
Providers implement one interface and get the ownership planner for free —
route53, rfc2136 and pihole are natural candidates. The rough shape:
- Implement the provider interface — it is just
nameplussync(desiredState); listing current records and applying the diff are your provider's internals. - Map your provider's wire format at the boundary — never leak it into core types.
- Reuse the provider-agnostic planner for ownership, policies, conflicts and orphan handling; it is already tested.
- Register the provider with
registerProvider("<name>", factory)and import the file fromsrc/index.ts— an unimported provider is never registered. - Add an in-memory fake of the provider API and test against it.
The cloudflare provider is the reference implementation to crib from. Open a
draft PR early — API-shape discussions are easier before the code hardens.