Commit graph

13 commits

Author SHA1 Message Date
Miek Gieben
e43384b501 middleware/file: proper support for wildcard (#323)
Add support for wildcard records, while taking care of wildcard-cnames
and DNSSEC. Add enough tests to check all the corner cases.
2016-10-08 15:22:31 +01:00
Miek Gieben
6cf14746ad small fix 2016-10-08 15:07:07 +01:00
Miek Gieben
a05901f62a middleware/proxy: make it scale (#287)
* middleware/proxy

Use connection pooling for communicating with an upstream, instead of
opening a new socket every time.

This makes the proxy more efficient and allowed for some cleanups.

* Some cleanups

* Some fixes

* more

* Kill pool

* Add nil check

* remove pool
2016-10-08 14:46:22 +01:00
Miek Gieben
4096c4906d Pr 311 2 (#312)
* Add a setup test for middleware/file

This fix adds a setup test for middleware/file so that there is
a basic coverage for the Corefile processing of middleware/file.

This fix is related to 308 (Will look into it).

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* middleware/file: use helper function for test

Fixup setup_test.go and use the test.TempFile function to make things
somewhat shorter.

Use clean up the use of testing.T in TempFile - it is not used.
2016-10-02 15:58:01 +01:00
Miek Gieben
e54c232c8c middleware/cache: split cache in positive and negative and use lru (#298)
Make the cache memory bounded, by using a LRU cache. Also split the
cache in a positive and negative one - each with its own controls.

Extend the cache stanza to allow for this:

    cache {
       positive limit [ttl]
       negative limit [ttl]
    }

is now possible. This also add a cache_test.go in the toplevel test/
directory that exercises the caching path.

Fixes #260
2016-10-02 08:31:44 +01:00
Miek Gieben
5301c5af5f Run golint and go vet (#276)
Cleanup the errors and removed deadcode along the way. The leaves
some error laying around, mostly about commenting exported identifier.
We should look hard if those really are needed.
2016-09-21 17:01:19 +01:00
Miek Gieben
d1f17fa7e0 Cleanup: put middleware helper functions in pkgs (#245)
Move all (almost all) Go files in middleware into their
own packages. This makes for better naming and discoverability.

Lot of changes elsewhere to make this change.

The middleware.State was renamed to request.Request which is better,
but still does not cover all use-cases. It was also moved out middleware
because it is used by `dnsserver` as well.

A pkg/dnsutil packages was added for shared, handy, dns util functions.

All normalize functions are now put in normalize.go
2016-09-07 11:10:16 +01:00
Miek Gieben
416603383d Cleanup and fixes (#223)
* Set version to 001
* Remove k8stest, test fails is k8s is not there: touch luck
* Remove server directory: not used anymore
* Disable k8s test (for now)
* gometalinter changes
2016-08-20 23:03:36 +01:00
Miek Gieben
9ac3cab1b7 Make CoreDNS a server type plugin for Caddy (#220)
* Make CoreDNS a server type plugin for Caddy

Remove code we don't need and port all middleware over. Fix all tests
and rework the documentation.

Also make `go generate` build a caddy binary which we then copy into
our directory. This means `go build`-builds remain working as-is.

And new etc instances in each etcd test for better isolation.
Fix more tests and rework test.Server with the newer support Caddy offers.

Fix Makefile to support new mode of operation.
2016-08-19 17:14:17 -07:00
Miek Gieben
b738d6e4e7 Fix issue 187: exit test (#188)
When not receiving a reply, exit the test and don't check the contents
of the unreceived packet.

Fixes #187
2016-07-07 20:04:25 +01:00
Miek Gieben
efd5135ee3 Some tiny changes and new benchmark test function (#136) 2016-04-26 20:45:29 +01:00
Miek Gieben
1aa1a92198 Add middleware/dnssec (#133)
This adds an online dnssec middleware. The middleware will sign
responses on the fly. Negative responses are signed with NSEC black
lies.
2016-04-26 17:57:11 +01:00
Miek Gieben
9f651a397b All (non etcd) tests are now local (#105)
We don't need to network to do tests, we up enough local servers
to we don't need to forward to,s say 8.8.8.8
2016-04-11 15:56:22 +01:00