Make middleware that sets up a (http) handler survive a graceful
restart. We calls the middleware's Shutdown function(s). If restart
fails the Start function is called again.
* middleware/health: OK
* middleware/pprof: OK
* middleware/metrics: OK
All restart OK.
Fix CoreDNS graceful reloading. This uses the same stuff as Caddy
(obviously), but extends it for UDP listeners as well. Also add to the
README that we *will* call Shutdown for middleware.
Fixes#4
* Changed reference to Caddy over to CoreDNS
* Removing references to caddy
* Fixed misleading error message to reference coredns
* Cleaning up references to caddy
* Adding clean and deps targets
Muscle memory is resulting in "make clean" commands.
* Adding test target to makefile
* More "Caddy" cleanup
Add prometheus metrics to the cache handler. This just used prometheus,
if the metrics middleware does not setup the handler, there is nobody
reading these metrics, but they are still reported. Seems the simplest
solution while keeping the whole middleware separation in tact.
Put error back in the correct place in the directives.go. Also don't
make it a pointer. If it *is* a pointer the buildstack function does
not correctly set the Next Handler. Don't understand *why* this is
different from Caddy. Anyway this fixes it, with the caveat that
the error log file is now openend earlier in the startup.
Fixes#127
* Add middleware/cache
Add a caching middleware that caches nxdomain, nodata and successful
responses. It differentiates between DNSSEC on normal DNS replies.
Each reply is compress and scrubbed so it will fit the specific client
asking for it.
* first simple test, less exporting of stuff
* more
* Add middleware/cache
Add a caching middleware that caches nxdomain, nodata and successful
responses. It differentiates between DNSSEC on normal DNS replies.
Each reply is compressed and scrubbed so it will fit the specific client
asking for it. The TTL is decremented with the time spend in the cache.
There is syntax that allows you to cap the TTL for all records, no
matter what. This allows for a shortlived cache, just to absorb query
peaks.
+Tests
* cache test infrastructure
* Testing
Return a delegation when seeing one while traversing the tree in
search of an answer.
Put the SOA and NS record in the zone.Apex as these are to be handled
somewhat special.
Lowercase record on insert to make compares easier. This lowercases
all RR that have domain names in their rdata as well.
Instead of watching a single file watch the entire directory and
catch the .Name from the event. On any event, just reload the damn
thing. This also fixes the problem of loosing events when the inode
changes.
Error out when parsing and transferring such a zone. If we would serve
it we would give out the wrong answers, leading to (probably) validation
failures...
Fixes#114