* 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.
* WIP: Client-side of gRPC proxy
* Add tests
* gofmt
* Implement OnShutdown; add a little logging
* Update for context in Exchange change
* go fmt
* Update README
* Review comments
* Compiling is good
* More README improvements
Remove the "gen" directory and move directives_generate.go out of it.
Add a build ignore tag so it isn't build by default. Cleanup the go gen
invocations so there are not seen as package docs.
Simplify the code a bit and don't run go gen twice.
* middleware/proxy: give Exchange a context
Make context.Context the first paramater in the Exchange method.
This is inline with all other query functions.
* up the version
* core: make coredns.Server a caddy.GracefulServer
We needed to also implement the Address() method.
Fixes: #519
* Add compile time check if we implement caddy.GracefulServer
* Check if we should shutdown
* middleware/reverse: random updates
Make the documentation somewhat shorter (and hopefully clearer in the
process). Also to be on-par with the *auto* middleware, start counting
the referenced zones from 1 (instead of 0).
Some variable cleanups and use the NextOrFailure in the ServeDNS
function.
* More TODOs
Fix the except keyword usage - the config would allow it, but it was
not enforced in the code.
Turns out that **FROM** was also not enforced, fix both, by (basically)
copying the code from Caddy.
Update the README and tests.
Locally test as well, shows that this works:
~~~
.:1053 {
proxy miek.nl 8.8.8.8:53 {
except a.miek.nl
}
proxy a.miek.nl 8.8.4.4:53
errors stdout
log stdout
}
~~~
And gives the desired results, not having a proxy line for `a.miek.nl`
results in a SERVFAIL (as expected).
Fixes#502
* middleware/proxy: absorb httpproxy
Move the httproxy into proxy. This adds and Exchanger interface which
is used to exchange the messages with the upstream.
The https_google upstream will re-resolve itself and update the upstream
hosts used every 300s.
* Remove and add TODO
* add cidrs opt
* remove state data from middleware object
* update k8s docs
* Add integration tests
* add unit tests for cidr and pods config
* more README fixes, separate dev notes
* adjust section headers
* fix typo
The gRPC server middleware[1] needs access to the Server object
in order to push the unpacked Msg through the normal middleware
pipeline. These are the changes to core needed to make that
possible.
[1] https://github.com/infobloxopen/coredns-grpc
* Use go generate to build middleware setup based on middleware.cfg
Init default config
* generated files
* Move gen to an isolated area
* rename files
* PR review updates
* undo readme
Adds a middleware to enable tracing with OpenTracing/OpenZipkin.
Enabling tracing will have a large impact on performance so it is
not advisable in production.
By defining and using an proxy.Exchanger interface we make the proxy
more generic and we can then fold back httproxy into proxy.
This overrides #463 and #473 and should make futures extensions rather
trivial
* Add docs that talk about `protocol` and how to set it.
* middleware/proxy: rename New to NewLookup
It's used as a Lookup mechanism not as a completely new proxy,
reflect that in the name.
* Set maxfails to 3 by default when looking up names.
Most of the changes have been copied
from https://github.com/johnbelamaric/coredns/pull/1/files
* dont require/allow "_" prefix for srv wildcard fields
* streamline parse/validation of req name
* removing nametemplate
* error when zone not found, loopify unit tests
* Use common TLS parsing routine for etcd
Change to use the new common routine, and update the docs to reflect
the different options for passing TLS configuration.
* Move middleware/tls to middleware/pkg/tls
This was put in the wrong place originally.
Create a small speedup running the tests:
PASS
ok github.com/miekg/coredns/test 10.329s
PASS
ok github.com/miekg/coredns/test 6.079s
Skip the etcd ones. Doing the middleware/*/*_test ones doesn't yield
any speedup as these are still done on a per directory basis.
Add deadline to break the connection. We use the default of 5 seconds.
After this the backend is marked unhealthy and not used for some time.
Fixes#467
* Add common TLS config routines
These routines can be used to load TLS configs based upon the
args in the Corefile.
* Add common routine for Corefile arg handling
Add the NewTLSConfigFromArgs routine so that you can just pass
in the Corefile args and get a tls.Config. This ensures the
parameters are handled consistently across middleware.
* Change to varargs style params
Change to use args ...string instead of []string. Add
documentation of what each call means.
This middleware allows playing with responses. Only one type is
implemented: it allows you to drop queries. I.e. withhold the response
from the client.