aboutsummaryrefslogtreecommitdiff
path: root/middleware (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-09-14Remove the word middleware (#1067)Gravatar Miek Gieben 308-29222/+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-09-12Update the tls documentation (#1061)Gravatar Miek Gieben 1-5/+26
* Update the tls documentation * cant test corefile because we dont have pem data * Add note on client support
2017-09-12Remove debug queries (#1058)Gravatar Miek Gieben 16-451/+98
* Remove debug from interface and methods * remove debug queries from etcd * remove debug queries from k8s - they were not used * And remove from mw/proxy-google as well * Remove debug query test
2017-09-11mw/errors: doc (#1057)Gravatar Miek Gieben 1-13/+8
Remove the [FILE] option from the docs, we still allow it, but this one value that we allow now *stdout* isn't shown anymore. Also test the snippet with readme_test.go by adding `~~ corefile`.
2017-09-10mw/chaos: update docs (#1055)Gravatar Miek Gieben 1-1/+23
* mw/chaos: update docs Fix/update the documentation: make the corefile snippets tested and expand them a little. Show `dig` example. Fixes #1050 * dot
2017-09-10mw/whoami: update docs (#1054)Gravatar Miek Gieben 1-6/+12
* mw/whoami: update docs Parse the corefile in the readme_test.go and other tweaks to the docs. Fixes #1049 * trailing * remove the 53 port
2017-09-10documention: test README snippets (#1043)Gravatar Miek Gieben 1-3/+18
If a README has a corefile snippet that is annotated with `corefile`, this test will parse the instance and checks the snippet is legal. This means a) we will get better docs b) we know for sure everything still parses. The test parses everything in middleware/*/README.md, it does not check for README presence, just Corefile snippets. The port used is 10053 and overrides whatever port is set in the docs. The secondary middleware was used as an example and adds two examples that should parse. failures show up as: ~~~ --- FAIL: TestReadme (0.04s) readme_test.go:50: Testing ../middleware/secondary/README.md, with 100 byte snippet readme_test.go:50: Testing ../middleware/secondary/README.md, with 93 byte snippet readme_test.go:53: Failed to start server for input "middleware/secondary: Corefile:3 - Error during parsing: unknown property 'transfeT'": . { secondary example.net { transfeT from 10.1.2.1 transfer to * } } FAIL ~~~
2017-09-09mw/secondary: more tests in setup_test.go (#1039)Gravatar Miek Gieben 1-3/+27
Improve the syntax tests for this middleware.
2017-09-08Add EDNS0_SUBNET rewrite (#1022)Gravatar Thong Huynh 4-1/+276
* Add EDNS0_SUBNET rewrite * Fix review comments * Update comment * Fix according to review comments * Add ResponseWriter6 instead of parameterized the existing ResponseWriter
2017-09-07mw/etcd: fix 'fallthrough' (#1026)Gravatar Miek Gieben 2-8/+5
* mw/etcd: revert 'add fallthrough' This removes 'fallthrough' for *etcd* which is not needed. This was added in 00f5c7797 but is totally not needed and creates backwards incompat behavior even. Thanks to @johnbelamaric for pointing this out in #925. * remove here as well * Revert "remove here as well" This reverts commit 9d44397827425e567af01d43564c4294b42e98c9. * Revert "mw/etcd: revert 'add fallthrough'" This reverts commit 0cfe3cb1ab5495ed38a8a0486e3f5386f3bd95dc. * mw/{etcd,kubernetes}: use fallthrough correctly reverts of reverts, will rebase and squash later.
2017-09-07mw/federation: use original qname in all responses (#1033)Gravatar Miek Gieben 1-2/+4
Maybe a fix for #1031 ?
2017-09-07mw/kubernetes: document stubDomain proxy (#1032)Gravatar Miek Gieben 1-11/+38
Mention stubdomains in the documentation, give an example and fix a few typos. Fixes #1028
2017-09-06mw/autopath: correct type for type switch (#1029)Gravatar Miek Gieben 2-4/+3
* mw/autopath: correct type for type switch Use pointer to kubernetes as that is what is registered. Fix up federation which had the same mistake. * here
2017-09-06mw/federation: correct parse (#1027)Gravatar Miek Gieben 2-6/+19
Fix parse error and add testcase when a ZONE is specified. Fixes #1024
2017-09-02mw/kubernetes: test cleanup (#1020)Gravatar Miek Gieben 4-53/+60
Move tests infra to look like all other middleware, and some small cleanups.
2017-09-02mw/proxy: simplify google code (#1019)Gravatar Miek Gieben 5-41/+46
* mw/proxy: simplify google code Minimize bootstrap code a bit, and block on the first resolve of the google https endpont. Add more logging and include actual error in the returned errors. Also re-resolve every 120 seconds, instead of 300 (might eventually make this an option). * fix test
2017-09-02Cleaning up dnssec docs (#1016)Gravatar Brad Beam 1-19/+31
2017-09-01Add k8s tags to related tests (#1018)Gravatar Yong Tang 3-8/+10
, so that `make test` will pass by default. Also fixed several ineffassign and golint issues. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-09-01Use context.TODO() in tests for go vet fix (#1017)Gravatar Yong Tang 1-1/+1
See #997 #1000. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-09-01mw/dnssec: improve docs (#1015)Gravatar Miek Gieben 1-4/+31
* mw/dnssec: improve docs Improve the docs: add example and details the perrils of having multiple *dnssec* middlewares in one zone. * better
2017-09-01IP endpoint for dnstap (#1002)Gravatar varyoo 5-20/+200
* adds the option to log to a remote endpoint * examples * tests * tcp:// or default to unix:// * cosmetic update * bad naked returns
2017-09-01middleware/proxy: dnstap (#786)Gravatar varyoo 13-96/+316
* experimental dnstap support into proxy * proxy reports dnstap errors * refactoring * add a message builder for less dnstap code * msg lint * context * proxy by DNS: dnstap comments * TapBuilder * resolves conflict * dnstap into ServeDNS * testing * more tests * `go lint` * doc update
2017-09-01Add test for SRV on root (#1010)Gravatar Mohammed Naser 1-0/+6
2017-09-01mw/dnssec: warn when keys don't sign zones (#1011)Gravatar Miek Gieben 2-5/+78
fail startup when dnssec middleware has keys configured that can't be used to sign any of the responses it should sign. More tests added, including ones that actually trigger setup failures.
2017-08-29mw/health: call Shutdown on FinalShutdown (#1003)Gravatar Miek Gieben 1-1/+1
Reloading caddy won't kill the health handler. Only on final shutdown we stop the handler. Currently when reloading CoreDNS with -SIGUSR1 the health handler stops answering - there is a test for this but it doesn't capture whole process reloading, sadly. This PR keeps the handler alive during reloads and only stops on process shutdown.
2017-08-27mw/health: poll other middleware (#976)Gravatar Miek Gieben 6-21/+147
This add the infrastructure to let other middleware report their health status back to the health middleware. A health.Healther interface is introduced and a middleware needs to implement that. A middleware that supports healthchecks is statically configured. Every second each supported middleware is queried and the global health state is updated. Actual tests have been disabled as no other middleware implements this at the moment.
2017-08-27mw/etcd: use context.TODO() in tests (#1000)Gravatar Miek Gieben 1-1/+1
Go vet warning: fix use of context. Fixes #997 Also make *auto*'s reload test less flaky by retrying and then giving up.
2017-08-26mw/kubernetes: add configurable TTL (#995)Gravatar Miek Gieben 5-19/+85
* mw/kubernetes: add configurable TTL Add ttl option to kubernetes. This defaults to 5s but allows configuration to go up to 3600. Configure the tests so that a few actually check for the 5s, while the rest use the TTL of 303 which is ignored by the checking code. Fixes #935 * fix tests * and more
2017-08-26Cleanup in go vet and misspell (#996)Gravatar Yong Tang 3-5/+5
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-08-26changes in Caddy caused mw/root tests to fail: ↵Gravatar varyoo 1-1/+1
https://github.com/mholt/caddy/commit/4cce8c7b6bf08ffff5e30999aa49259324d58f5d (#990)
2017-08-25core: block CH queries earlier (#973)Gravatar Miek Gieben 5-22/+1
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-24mw/kubernetes: split up tests cases (#971)Gravatar Miek Gieben 4-75/+188
Split up the handler_test in four files that all tests their specific bits. Removed the CNAME sort as there was only 1 answer with a CNAME and that was a single one. See #942, this fixes (a bit) the tests in middleware.
2017-08-24Add set EDNS0 with variable substitution (#937)Gravatar Thong Huynh 7-10/+304
* Add set EDNS0 with variable substitution * Change variable from $ to {}. Un-export constants * Update README * Change getRuleData() to ruleData(); Change to use string match from regexp
2017-08-24Middleware/Kubernetes: Add RR check to K8s integration tests (#884)Gravatar Sandeep Rajan 2-14/+20
2017-08-24Small golint cleanup (#977)Gravatar Miek Gieben 1-6/+6
* Small golint cleanup Mostly docs in autopath. * duh
2017-08-23mw/kubernetes: revert if-else for health (#970)Gravatar Miek Gieben 1-51/+53
Do the return early and dedent the rest of the function.
2017-08-23Parse fix (#974)Gravatar Miek Gieben 2-0/+71
* mw/kubernetes: add apex test This adds small test case for apex queries: SOA and HINFO. Fix (obvious) parse bug in parse.go. * Test Ns request also here
2017-08-23mw/kubernetes: remove kPod and kServices (#969)Gravatar Miek Gieben 6-152/+109
Based up on: #939, but redone in a new PR with some cherry-picked commits: aacb91ef0b927683b21d6ee39dbddbd001334854 5dc34247b7d0136d9fe035f6b10d6b3e14ee7f2c This removes kPod and Kservice and creates []msg.Service from k.findPods and k.findServices. Updated few tests which I *think* are correct; they look correct to me.
2017-08-22mw/kubernetes: don't export Pod-mode constants. (#959)Gravatar Miek Gieben 4-42/+43
* mw/kubernetes: don't export Pod-mode constants. * merged
2017-08-22mw/kubernetes: resync to opts (#957)Gravatar Miek Gieben 5-63/+52
* mw/kubernetes: resync to opts Only used to initialize the cache that already has a dnsControlopts, so remove it from the main kubernetes struct. * Fix test * mw/kubernetes: LabelSelector to options as well Labels select is also only used for init. Don't carry it in the main kubernetes struct. * remove this test: can't happen Caddyfile parser will only call setup when it sees kubernetes. * erge gone wrong
2017-08-22mw/kubernetes: Rewrite parseRequest and Readability improvements (#939)Gravatar Miek Gieben 8-162/+175
* mw/kubernetes: rewrite parseRequest Stop looking at the qtype in parseRequest and make k.Namespace a map. Fallout from this is that pkg/strings as it is not used anymore. Also add a few helper functions to make unexposed namespaces easier to see in the code. Add wildcard tests to the middleware tests. * Fix tests Add a whole bunch of comments to document what we are trying to do. * This is now answered * up coverage * duh * Update testcase * Make it nodata
2017-08-22mw/*: updates docs about upstream (#968)Gravatar Miek Gieben 4-5/+8
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 9-39/+32
* 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-21mw/autopath: a minimal bug section (#961)Gravatar Miek Gieben 1-0/+5
Briefly highlight that autopath might return the wrong results to pods in different namespaces. Fixes #778
2017-08-21mw/file: add include test (#960)Gravatar Miek Gieben 1-0/+32
$INCLUDE was fixed in miekg/dns, create tests in CoreDNS so that we know we have the latest version. Fixes #880
2017-08-19Move nonwriter to mw/pkg/nonwriter (#948)Gravatar Miek Gieben 6-46/+46
Make it its own package as shared between autopath and federation. Fixes #933
2017-08-19Dns.join (#944)Gravatar Miek Gieben 8-14/+52
* Add dnsutil.Join * Create dnsutil.Join Create Join helper function and move bits in the code over.
2017-08-19backend.Records make it take request.Request (#943)Gravatar Miek Gieben 4-12/+14
This is more general and aligns well with the other methods. Also allows the kubernetes middleware to use it. Fixes #940
2017-08-19mw/kubernetes: remove zone from parseRequest (#938)Gravatar Miek Gieben 3-10/+12
* mw/kubernetes: remove zone from parseRequest State has the zone info as well, so don't need to have it in parseRequest anymore. * Fix up tests * improve test coverage