Pointer updates are atomic so drop the sync.RWMutex as it is not needed
anymore. This also fixes the race introduced with dfc71df (although I
believe this is the first time we properly tested that code path).
There was no inherent reason *not* to allow multiple listeners for the
monitoring data. Actually enforcing only one listener lead to more code
then just allowing multiple. It's probably not what you want; but
CoreDNS is happy to oblige.
Add middleware by directly linking it from caddy, i.e. without any code
changes. To be fair: this does not added a ServeHTTP, but does give
some nice features in the Corefile.
* add proxy tcp
* add truncated for tcp to udp response
* move truncation to scrubbing
* add test that executes upstream over tcp
* middleware/proxy: some tweaks
rename force-tcp to force_tcp to be inline with the rest and use
a dnsOptions struct to put the options in to allow it to be extended.
Add some parse tests as well.
* Fix test and rename dnsOptions Options
According to the code, the default health check interval is 30 seconds,
not 10 as stated in the documentation. (The alternative would be to
adjust the interval in the code.)
* core: add listening for other protocols
Allow CoreDNS to listen for TLS request coming over port 853. This can
be enabled with `tls://` in the config file.
Implement listening for grps:// as well.
a Corefile like:
~~~
. tls://.:1853 {
whoami
tls
}
~~~
Means we listen on 1853 for tls requests, the `tls` config item allows
configuration for TLS parameters. We *might* be tempted to use Caddy's
Let's Encrypt implementation here.
* Refactor coredns/grpc into CoreDNS
This makes gRPC a first class citizen in CoreDNS. Add defines as being
just another server.
* some cleanups
* unexport the servers
* Move protobuf dir
* Hook up TLS properly
* Fix test
* listen for TLS as well. README updates
* disable test, fix package
* fix test
* Fix tests
* Fix remaining test
* Some tests
* Make the test work
* Add grpc test from #580
* fix crash
* Fix tests
* Close conn
* README cleanups
* README
* link RFC
We don't need to use the muxer in Go DNS s we only have one entry point
per server - and mux ourselves in ServeDNS. Also make ServeDNS take a
context, and make that the canonical way to call all middleware.
* Add edns0 code rewrite
* check arg count
* change `new`; set EDNS0 if request doesn't have it set
* change set to replace_or_append
* change to append_or_replace
* return error in new
* update documents
* fixt UT
* return error
* go fmt
* Rework for more general EDNS0 use
Also changed how rules are created and validated. Implements
EDNS0 NSID in addition to local.
* go fmt
* README updates, NSID tests and fixes
* gofmt -s -w
* Fix tests for rewrite syntax change
* Add tests, fix error message
* Review nits
* Missed on nit
* More tests, integration test, fix edns0 parse issue
* Fix README, use RewriteIgnored
* go fmt
In both etcd and k8s don't error log NXDOMAIN as this log spams the logs
for no good reason.
Fixes#568
Better long term solution is log rate limiting for both *log* and
*error*.
This fix updates the Makefile to add the `go lint` check
for the build. This fix also fixes several go lint issues.
NOTE: This fix does not enforce `go lint` (suggestion only).
This fix also ignores the `go lint` error:
```
middleware/middleware.go:72:1: context.Context should be the first parameter of a function
```
as it requires too many changes in API.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
* checkpoint
* Pass context through ServeDNS, enable gRPC tracing
* Fix types and make tracer available to proxy. go fmt
* Fix imports
* Use the DoNotStartTrace option
* Change to SpanFilter from DoNotStartTrace
* Use new name (IncludeSpan)
* Final names
* Add tests; fix possible client/conn leaks in grpc
* go fmt
* middleware/metrics: survive restart
Keep the handler running during restart. Stopping and starting the
handler results in "address in use" - sometimes, meaning the reload
will be flaky. In turn this behavior means any changes to the monitor
stanza are not picked up.
* remove resync
* Document fallthrough and fix *reverse*
While documenting the fallthrough behavior and testing it I noticed
the did not properly work. This PR does a tiny bit too much as it
- Documents fallthrough
- Fixes fallthrough in reverse
- Makes directives_generate complain on duplicate priorities
- Moved reverse *before* file in middleware.cfg
- Add a test that tests the reverse fallthrough behavior with a file
backend
Fixes#515
* ....and fix the tests
* all-middleware-equal
* Revert "all-middleware-equal"
This reverts commit ee77b2a981.
* middleware: treat external and local the same
Make the middleware generation simpler and also specify the local
middleware, meaning that it can now be removed as well. Simplify
the code a bit and regen everything.
* remove lineNR, not used
* server: fix data race
This fixes the detected race.
Fixes#534
* Remove the listener and packetconn from Server
There does not seem a need to store the listener and packetconn again
in the Server structure. The dns.Servers already has access to them
and can also shutdown the handlers.
When using an external middleware, the generated file was failing to compile.
The issue is a typo in directives_generate.go that left imports with an
unterminated string.