Simplify configuration: connection defaults + optional queue numbers

Closes #20 (closed).

Summary

  • Adds an optional top-level defaults: section to --config YAML files: overall defaults for jump_user/jump_host/forwarded_ports, plus CIDR-scoped overrides via defaults.by_network. An explicit value on a connection always wins over any default.
  • Most-specific-CIDR-wins: when a connection's network matches more than one by_network entry, the entry with the longest/most specific prefix wins, not whichever is listed first (a tie between equally specific matches falls back to list order). Documented explicitly in README.md, docs/README.md, docs/config.example.yaml, and CLAUDE.md.
  • queue_number is now optional: if omitted, a stable number is deterministically auto-assigned from a hash of the connection's name (requires name to be set in that case). This is derived from name specifically so a connection's number stays stable across restarts even if other connections are added/removed/reordered elsewhere in the file - important because the existing crash-recovery iptables cleanup is keyed only by queue number, so an unstable number could orphan stale rules after a crash.
  • internal/config remains at 100% test coverage; new tests cover defaults merging (overall + by_network + explicit-wins + most-specific-CIDR-wins + tie-break), the new jump_user/jump_host validation errors, and queue number auto-assignment (range, determinism, collision-probing, missing-name error).

Not included

  • config.production.yaml (untracked, real prod config) is not touched by this MR - it isn't under version control. Migrating it to use defaults/by_network/optional queue_number is a natural follow-up once this lands.
  • Version tag v1.0.1 will be pushed separately after this MR is reviewed and merged, same as v1.0.0 was for the previous release.

Test plan

  • go build ./...
  • make lint (golangci-lint + yamllint)
  • make test (go test -race -cover ./...)
  • Manually loaded docs/config.example.yaml via config.LoadFromFile and confirmed defaults/CIDR-scoping/queue-number auto-assignment all resolve as documented

Merge request reports

Loading