Simplify configuration: connection defaults + optional queue numbers #62
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
keyop-go/nfq_forwarder!62
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue20_simplify_config"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #20.
Summary
defaults:section to--configYAML files: overall defaults forjump_user/jump_host/forwarded_ports, plus CIDR-scoped overrides viadefaults.by_network. An explicit value on a connection always wins over any default.networkmatches more than oneby_networkentry, 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 inREADME.md,docs/README.md,docs/config.example.yaml, andCLAUDE.md.queue_numberis now optional: if omitted, a stable number is deterministically auto-assigned from a hash of the connection'sname(requiresnameto be set in that case). This is derived fromnamespecifically 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/configremains at 100% test coverage; new tests cover defaults merging (overall + by_network + explicit-wins + most-specific-CIDR-wins + tie-break), the newjump_user/jump_hostvalidation 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 usedefaults/by_network/optionalqueue_numberis a natural follow-up once this lands.v1.0.1will be pushed separately after this MR is reviewed and merged, same asv1.0.0was for the previous release.Test plan
go build ./...make lint(golangci-lint + yamllint)make test(go test -race -cover ./...)docs/config.example.yamlviaconfig.LoadFromFileand confirmed defaults/CIDR-scoping/queue-number auto-assignment all resolve as documentedadded 1 commit
4ce5fcfc- Add latest Claude conversation exportCompare with previous version
requested review from @danny
assigned to @danny
LGTM.
approved this merge request
mentioned in commit
709e697017mentioned in issue #20
mentioned in commit
4005455d53