aboutsummaryrefslogtreecommitdiff
path: root/middleware/auto (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-09-14Remove the word middleware (#1067)Gravatar Miek Gieben 10-838/+0
* Rename middleware to plugin first pass; mostly used 'sed', few spots where I manually changed text. This still builds a coredns binary. * fmt error * Rename AddMiddleware to AddPlugin * Readd AddMiddleware to remain backwards compat
2017-08-25core: block CH queries earlier (#973)Gravatar Miek Gieben 1-4/+0
block chaos queries, unless the chaos or proxy middleware is loaded. We respond with REFUSED. This removes the need for each middleware to do this class != ClassINET if-then. Also make config.Registry non-public.
2017-08-22mw/*: updates docs about upstream (#968)Gravatar Miek Gieben 1-1/+2
Upstream allows file structured like /etc/resolv.conf. Update docs. Fixes #709
2017-08-22mw/auto: increate setup coverage (#967)Gravatar Miek Gieben 1-0/+25
Fixes #965
2017-08-22core: hide registerHandler (#964)Gravatar Miek Gieben 1-7/+8
* core: hide registerHandler Remove RegisterHandler and just make it implicit when we look at the handler compilation step. * Rename GetHandler to just Handler Update callers and make auto check Hander in OnStartup. * Up test coverage in erratic * up test coverage
2017-08-13cidr everywhere: check all middleware (#915)Gravatar Miek Gieben 1-0/+6
* cidr everywhere: check all middleware Add tests for cidr in only that middleware that already tests for this. Check the other ones manually (and put reverse in the tests cases anyway). Make etcd setup_test run without +build etcd tag - it is not needed for this test - move rest of the code to lookup_test.go. Cleanup proxy test a bit and remove TempDir as there is test.TempFile that does the same thing. Fixes #909 * coredns package * Fix test compile
2017-08-10core: replace GetMiddleware (#885)Gravatar Miek Gieben 1-1/+3
* core: replace GetMiddleware See the discussion in #881. GetMiddleware would add a `nil` middleware to the callstack thereby breaking functionality. This PR drops it in favor of RegisterHandler which is a completely standalone registry for middleware that want to let it self know to other middleware. Currenly *autopath* uses this to call *kubernetes*'s AutoPath method for dynamic autopathing. * Drop GetMiddleware * Register metrics * drop the panic
2017-08-10core: small cleanup (#877)Gravatar Miek Gieben 1-71/+68
Add some docs about normalize.Host and normalize.Name. They are used correctly in the middleware even though they are somewhat confusing, esp when you copy from ServerBlockKeys in your middleware.
2017-08-06all: gometalinter (#843)Gravatar Miek Gieben 1-1/+1
* kubernetes/reverse: remove deadcode * deadcode in errors and kubernetes removed * unnecessary conversion * constants * proxy: time.Since() * simplications * static check * Disable test/external_test
2017-06-08middleware/file: don't reload zone when SOA isn't changed (#707)Gravatar Miek Gieben 1-2/+3
* middleware/file: don't reload zone when SOA isn't changed Give Parse an extra argument which is the SOA's serial, if > 0 we check against the just parsed SOA and then just return. Most notable use is in reload.go which is both used in the file and auto middleware. Fixes #415 * PR comments
2017-02-22Fix import path `github.com/miekg/coredns` -> `github.com/coredns/coredns` ↵Gravatar Yong Tang 4-13/+13
(#547) This fix fixes import path from `github.com/miekg/coredns` -> `github.com/coredns/coredns`
2017-01-15middleware/proxy: implement Exchanger (#480)Gravatar Miek Gieben 1-1/+1
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
2016-12-20Add middleware.NextOrFailure (#462)Gravatar Miek Gieben 1-5/+2
This checks if the next middleware to be called is nil, and if so returns ServerFailure and an error. This makes the next calling more robust and saves some lines of code. Also prefix the error with the name of the middleware to aid in debugging.
2016-11-24Use upstream parsing from master branch (#438)Gravatar Miek Gieben 1-7/+5
2016-11-24merge conflict fixedGravatar Miek Gieben 5-1/+26
2016-11-16middleware/auto: Close to readerGravatar Miek Gieben 1-0/+1
Close the reader, stop leaking file descriptors.
2016-11-10Compile fixes and make it workGravatar Miek Gieben 3-2/+3
2016-11-10Implement external lookups for CNAMEsGravatar Miek Gieben 3-2/+3
2016-11-09middleware/{file, auto}: resolve external CNAMEsGravatar Miek Gieben 3-0/+23
Do the same thing as in etcd and give the option of externally resolving CNAME. This is needed when CoreDNS is a proxy as well is serving zones.
2016-11-07middleware/file|auto: Notifies and AXFR (#399)Gravatar Miek Gieben 2-11/+25
Be more explicit in the logs when a notify fails. New notify error message looks like: 2016/11/07 18:21:42 [ERROR] Notify for zone "example.org." was not accepted by "8.8.8.8:53": rcode was "SERVFAIL" Correctly pick up secondaries When multiple secondary are specified make sure they are picked up. Fixes #393 #398
2016-11-07Issue 388 (#389)Gravatar Miek Gieben 1-4/+1
* add extra test * middleware/auto: fix crash when calling empty handler Don't call the next middleware, we should be auth. for this zone getitng into this path we should respond with ServFail. Fixes #388
2016-11-07finish missing watcher check (#387)Gravatar Miek Gieben 1-3/+9
2016-11-06middleware/auto: handle non-existent directory (#385)Gravatar Miek Gieben 2-1/+20
Don't panic on a non-existent directory. Add test for it as well. Fixes #384
2016-10-27golintGravatar Miek Gieben 1-0/+1
2016-10-26middleware/metrics: cleanup (#355)Gravatar Miek Gieben 6-25/+53
* middleware/metrics: add more metrics middleware/cache: Add metrics for number of elements in the cache. Also export the total size. Update README to detail the new metrics. middleware/metrics Move metrics into subpackage called "vars". This breaks the import cycle and is cleaner. This allows vars.Report to be used in the the dnsserver to log refused queries. middleware/metrics: tests Add tests to the metrics framework. The metrics/test subpackage allows scraping of the local server. Do a few test scrape of the metrics that are defined in the metrics middleware. This also allows metrics integration tests to check if the caching and dnssec middleware export their metrics correctly. * update README * typos * fix tests
2016-10-17middleware/auto: add (#333)Gravatar Miek Gieben 10-0/+723
Add auto-load middleware that automatically picks up zones. Every X seconds it will scan for new zones. Add tests and documentation. Make 'make test' use -race.