Commit graph

19 commits

Author SHA1 Message Date
Ondřej Benkovský
2fa9821c7e
plugin/template : add support for extended DNS errors (#5659)
* plugin/template : add support for extended DNS errors

Signed-off-by: Ondřej Benkovský <ondrej.benkovsky@jamf.com>
2022-10-03 11:04:56 -04:00
Erik Johansson
0032be6a56
plugin/template: fix formatting with go fmt (#5622)
Signed-off-by: Erik Johansson <ejohansson@spotify.com>

Signed-off-by: Erik Johansson <ejohansson@spotify.com>
2022-09-15 15:48:38 -04:00
Erik Johansson
e93e932ce8
plugin/template: Add parseInt template function (#5609)
* plugin/template: Add parseInt template function

Signed-off-by: Erik Johansson <ejohansson@spotify.com>
2022-09-15 15:25:58 -04:00
Chris O'Haver
4d1d9adb0e
fix and document zone-match regex-no-match case (#5180)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-05-13 23:23:28 -04: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
Maxime Guyot
b3d08f9b21
plugin/template: Add client IP data (#4034)
Signed-off-by: Maxime Guyot <maxime@root314.com>
2020-08-10 10:38:18 +02:00
Chris O'Haver
3f47fc8ba4
typo fixes (#3169)
* spelling fixes

* its/it's
2019-08-21 16:08:55 -04:00
John Belamaric
7cf73cc01d
plugin/template: support metadata (#2958)
* Enable use of metadata in templates

* Update README

* Don't stash away ctx, instead use a new func
2019-07-03 16:10:56 +01: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
Karsten Weiss
6d8a078704 Typo fixes (#2031) 2018-08-14 08:55:55 -07:00
Chris O'Haver
716791aa09
plugin/template: fix CNAME upstream handling (#1886) 2018-06-21 14:38:29 -04:00
Miek Gieben
0930eb8beb
all: fix plugin import ordering (#1717)
Got a bit messed up with stb lib "context" usage.
2018-04-22 08:34:35 +01:00
Miek Gieben
8722336fff
global: move to context (#1699)
* global: move to context

Move from golang.org/x/net/context to std lib's context.

Change done with:

for i in $(grep -l '/context' **/*.go); do sed -e 's|golang.org/x/net/context|context|' -i $i; echo $i; done
for i in **/*.go; do goimports -w $i; done

* drop from dns.pb.go as well
2018-04-20 11:01:06 +01:00
Miek Gieben
f91cb61086 Don't use standard lib context package (#1468)
With Go 1.9 you *can* include the std lib's context package and nothing
breaks. However we never officially made the move (and grpc also doesn't
ues the std lib's one).

Standardize all plugins on using the extern context package.

Fixes #1466
2018-01-30 09:19:37 -05:00
Yong Tang
fe0767987e
Fix several typos (#1395)
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-15 18:27:47 -08:00
Miek Gieben
cced1a4c12
pkg/fall: make Zero and Root vars not funcs (#1367)
These can be just vars. Think that was intended as well.
2018-01-09 22:29:19 +00:00
Miek Gieben
a19ea63d3a
plugin/template: small tweaks (#1366)
Small README updates, and fallthrough fixes (using less code)
2018-01-09 21:48:32 +00: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