Commit graph

10 commits

Author SHA1 Message Date
Ondřej Benkovský
c2dbb7141a
add golangci-lint linter (#5499) 2022-07-10 11:06:33 -07:00
Miek Gieben
b003d06003
For caddy v1 in our org (#4018)
* For caddy v1 in our org

This RP changes all imports for caddyserver/caddy to coredns/caddy. This
is the v1 code of caddy.

For the coredns/caddy repo the following changes have been made:

* anything not needed by us is deleted
* all `telemetry` stuff is deleted
* all its import paths are also changed to point to coredns/caddy
* the v1 branch has been moved to the master branch
* a v1.1.0 tag has been added to signal the latest release

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix imports

Signed-off-by: Miek Gieben <miek@miek.nl>

* Group coredns/caddy with out plugins

Signed-off-by: Miek Gieben <miek@miek.nl>

* remove this file

Signed-off-by: Miek Gieben <miek@miek.nl>

* Relax import ordering

github.com/coredns is now also a coredns dep, this makes
github.com/coredns/caddy fit more natural in the list.

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix final import

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-09-24 18:14:41 +02:00
Yong Tang
f8bba51f84
Update Caddy to 1.0.1, and update import path (#2961)
* Update Caddy to 1.0.1, and update import path

This fix updates caddy to 1.0.1 and also
updates the import path to github.com/caddyserver/caddy

This fix fixes 2959

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

* Also update plugin.cfg

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

* Update and bump zplugin.go

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-07-03 09:04:47 +08:00
Miek Gieben
22c6e3e179
plugins: set upstream unconditionally (#2956)
`upstream` is not needed as a setting; just set if unconditionally and
remove all documentation and tests for it.

At some point we want remove the hanlding for `upstream` as well and
error out on seeing it.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-07-02 16:23:47 +01:00
Chris O'Haver
e1d0b63e3f allow an empty response (#2855) 2019-06-01 08:40:12 +01:00
Miek Gieben
9c16ed1d14
Default to upstream to self (#2436)
* Default to upstream to self

This is a backwards incompatible change.

This is a massive (cleanup) PR where we default to resolving external
names by the coredns process itself, instead of directly forwarding them
to some upstream.

This ignores any arguments `upstream` may have had and makes it depend
on proxy/forward configuration in the Corefile. This allows resolved
upstream names to be cached and we have better healthchecking of the
upstreams. It also means there is only one way to resolve names, by
either using the proxy or forward plugin.

The proxy/forward lookup.go functions have been removed. This also
lessen the dependency on proxy, meaning deprecating proxy will become
easier. Some tests have been removed as well, or moved to the top-level
test directory as they now require a full coredns process instead of
just the plugin.

For the etcd plugin, the entire StubZone resolving is *dropped*! This
was a hacky (but working) solution to say the least. If someone cares
deeply it can be brought back (maybe)?

The pkg/upstream is now very small and almost does nothing. Also the
New() function was changed to return a pointer to upstream.Upstream. It
also returns only one parameter, so any stragglers using it will
encounter a compile error.

All documentation has been adapted. This affected the following plugins:
* etcd
* file
* auto
* secondary
* federation
* template
* route53

A followup PR will make any upstream directives with arguments an error,
right now they are ignored.

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix etcd build - probably still fails unit test

Signed-off-by: Miek Gieben <miek@miek.nl>

* Slightly smarter lookup check in upstream

Signed-off-by: Miek Gieben <miek@miek.nl>

* Compilez

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-01-13 16:54:49 +00:00
Tobias Schmidt
0d305387f7 plugin/template: Support NODATA responses (#1816)
A NODATA response has no answers and rcode NOERROR, but should have a
SOA record in the authority section.
2018-05-21 07:45:45 +01:00
Chris O'Haver
2cad04ec10 plugin/template: add upstream option (#1529)
* add upstream

* docs

* tests
2018-02-16 09:45:25 +01:00
Rene Treffer
0091e1c9dc Align plugin/template usage and syntax with other plugins (#1360)
* Align plugin/template usage and syntax with other plugins

* Use new fallthrough logic in plugin/template

* Use zone name normalization for plugin/template

* Test fallthrough parsing in plugin/template

* Rework scoping of match checks

Most matches are not plugin global but per template. The plugin does only a
very rough check while detailed checks are done per-template.

Per template checks include:
- Zones
- Class/Type
- Regex
- Fallthrough

* Remove trailing `.` from fully qualified domain names

* Register template metrics with zone/class/type instead of regex

* Remove trailing fqdn dot from multiple testcases
2018-01-09 21:30:58 +00:00
Rene Treffer
a322d90f6f plugin/template (#1298)
* Add a template plugin

The template plugin matches the incoming query by class, type and regex
and templates a response with go templates.

* Fix go style errors

* Fix template README example

* Fix corefile example in plugin/template

* Clarify plugin/template/README.md

Add more details and external links where needed.

* Fix code issues in plugin/template

* Add template metrics

* Add section and template to template plugin metrics

* Fix style / remove extra newline on go imports

* Fix typo in plugin/template/README.md

* Update README.md

I've change the format a bit in a PR that I merged yesterday.

* Add authority section to plugin/template

* Fix naming of incoming query name in plugin/template/README.md

* Fix doc syntax in plugin/template/README.md

* Add authority section to plugin/template/README.md config overview

* Add metric labels to plugin/template/README.md metrics section

* Use request.Request to pass state to the template matcher
2018-01-08 10:52:25 +00:00