Commit graph

41 commits

Author SHA1 Message Date
Rich
e7ad486b50
plugin/timeouts - Allow ability to configure listening server timeouts (#5784) 2022-12-28 12:14:16 +01:00
Chris O'Haver
b56b080a7c
plugin/view: Advanced routing interface and new 'view' plugin (#5538)
* introduce new interface "dnsserver.Viewer", that allows a plugin implementing it to decide if a query should be routed into its server block.
* add new plugin "view", that uses the new interface to enable a user to define expression based conditions that must be met for a query to be routed to its server block.

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-09-08 14:56:27 -04:00
Chris O'Haver
68e141eff2
plugin/tsig: new plugin TSIG (#4957)
* expose tsig secrets via dnsserver.Config
* add tsig plugin

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2022-06-27 15:48:34 -04:00
Chris O'Haver
3288b111b2
Revert "Initial implementation of ForwardCRD plugin (#4512)" (#4981)
This reverts commit 2e6953c7db.
2021-11-12 13:19:16 -05:00
Christian Ang
2e6953c7db
Initial implementation of ForwardCRD plugin (#4512)
* Add forwardcrd plugin README.md

Co-authored-by: Aidan Obley <aobley@vmware.com>

Signed-off-by: Christian Ang <angc@vmware.com>

* Create forwardcrd plugin

- Place forwardcrd before forward plugin in plugin list. This will avoid
forward from preventing the forwardcrd plugin from handling any queries
in the case of having a default upstream forwarder in a server block (as
is the case in the default kubernetes Corefile).

Co-authored-by: Aidan Obley <aobley@vmware.com>

Signed-off-by: Christian Ang <angc@vmware.com>

* Add Forward CRD

Signed-off-by: Christian Ang <angc@vmware.com>

* Add NewWithConfig to forward plugin

- allows external packages to instanciate forward plugins

Co-authored-by: Aidan Obley <aobley@vmware.com>

Signed-off-by: Christian Ang <angc@vmware.com>

* ForwardCRD plugin handles requests for Forward CRs

- add a Kubernetes controller that can read Forward CRs
- instances of the forward plugin are created based on Forward CRs from
the Kubernetes controller
- DNS requests are handled by calling matching Forward plugin instances
based on zone name
- Defaults to the kube-system namespace to align with Corefile RBAC

Signed-off-by: Christian Ang <angc@vmware.com>

Use klog v2 in forwardcrd plugin

* Refactor forward setup to use NewWithConfig

Co-authored-by: Christian Ang <angc@vmware.com>

Signed-off-by: Edwin Xie <exie@vmware.com>

* Use ParseInt instead of Atoi

- to ensure that the bitsize is 32 for later casting to uint32

Signed-off-by: Christian Ang <angc@vmware.com>

* Add @christianang to CODEOWNERS for forwardcrd

Signed-off-by: Christian Ang <angc@vmware.com>

Co-authored-by: Edwin Xie <exie@vmware.com>
2021-11-12 11:22:34 -05:00
Miek Gieben
50d888f3d7
plugin/header: run go gen and small doc updates (#4754)
* plugin/header: run go gen and small doc updates

Run go gen to enable the new plugin, this should fix the CI failures.
Small tweaks to the docs.

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

* another typo

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

* gofmt

Signed-off-by: Miek Gieben <miek@miek.nl>
2021-07-15 10:10:16 +02:00
Sven Nebel
21f1207afe
Create geoip plugin (#4688)
* Create geoip plugin

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Update plugin/geoip/README.md

Co-authored-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Update plugin/geoip/README.md

Co-authored-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Update plugin/geoip/README.md

Co-authored-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Move DBFILE bullet below example

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Update plugin/geoip/README.md

Co-authored-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Remove plugin name test case

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Remove languages option

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Update free database link

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Remove last language bits

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Use 127.0.0.1 as probing IP

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Update plugin/geoip/geoip.go

Co-authored-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Update plugin/geoip/geoip.go

Co-authored-by: Miek Gieben <miek@miek.nl>
Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Use relative path for fixtures dir

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Set names with default string zero value

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Remove unused db types

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Remove non city databases in testdata

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Remove create databases main

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Fix metadata label format test case

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Fix import path block

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* go fmt after changes

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Tidy up go.mod and go.sum

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

* Add plugin to CODEOWNERS

Signed-off-by: Sven Nebel <nebel.sven@gmail.com>

Co-authored-by: Miek Gieben <miek@miek.nl>
2021-07-14 09:25:30 +02:00
Soumya Ghosh Dastidar
7651e6c4de
Added minimal-responses plugin (#4417)
* Added minimal-responses plugin

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* Removed unnecessary comments

* Updated tests

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* Reformated imports

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* Updated package name

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* Removed  unnecessary comments

Co-authored-by: Miek Gieben <miek@miek.nl>

* Added changes

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* updated

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* Updated comment for NextOrFailure

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* Updated to test.Case for testing

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

* Formated imports using goimports

Signed-off-by: Soumya Ghosh Dastidar <gdsoumya@gmail.com>

Co-authored-by: Miek Gieben <miek@miek.nl>
2021-03-15 15:37:55 +01:00
Miek Gieben
7bbcf6920f
add local plugin (#4262)
* add local plugin

See: #4260

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

* stickler bot

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

* See Also

Signed-off-by: Miek Gieben <miek@miek.nl>
2020-11-05 15:02:07 +01: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
Zou Nengren
8bbfa19223
remove federation (#3794)
Signed-off-by: zounengren <zounengren@cmss.chinamobile.com>
2020-03-30 09:08:20 -07:00
Ben Kochie
4eeaef29ea
Add dns64 plugin (#3534)
* Add dns64 plugin

Add external plugin to core in-tree.
* Pull code from upstream: https://github.com/serverwentdown/dns64
* Update docs.

Signed-off-by: Ben Kochie <superq@gmail.com>

* Make dns64 consistent.

Signed-off-by: Ben Kochie <superq@gmail.com>

* Cleanup README

Signed-off-by: Ben Kochie <superq@gmail.com>

* Cleanup minor issues.

Signed-off-by: Ben Kochie <superq@gmail.com>

* Remove proxy method.

Signed-off-by: Ben Kochie <superq@gmail.com>

* dns64: big cleanup

* Make the code a bit more idiomatic
* Add tests
* use proper Upstream API

Signed-off-by: Casey Callendrello <c1@caseyc.net>
Signed-off-by: Ben Kochie <superq@gmail.com>

* A little more clenaup

* Fix some docs.
* Use the correct plugin register method.
* Cleanup some review items.

Signed-off-by: Ben Kochie <superq@gmail.com>

* Add metrics counter for DNS64 translations

Add a basic counter of how many DNS64 translations have been completed.

Signed-off-by: Ben Kochie <superq@gmail.com>

* Add DNSSEC bug link

Signed-off-by: Ben Kochie <superq@gmail.com>

* Test cleanup

Signed-off-by: Ben Kochie <superq@gmail.com>

* dns64: more test cleanup

Signed-off-by: Casey Callendrello <c1@caseyc.net>

Co-authored-by: Casey Callendrello <c1@caseyc.net>
2020-03-26 08:42:23 +01:00
Kohei Yoshida
e23a34abb4 Add bufsize plugin for preparing the DNS Flag Day and avoiding IP fragmentation (#3401)
* add bufsize plugin

Signed-off-by: ykhr53 <yukihira.lab@gmail.com>

* add docstring and comment

Signed-off-by: ykhr53 <yukihira.lab@gmail.com>

* delete stdout messages when get an error

Signed-off-by: ykhr53 <yukihira.lab@gmail.com>

* change to context.Background from TODO

Signed-off-by: ykhr53 <yukihira.lab@gmail.com>

* define default bufsize as defaultBufSize constant

Signed-off-by: ykhr53 <yukihira.lab@gmail.com>

* fix some comments

Signed-off-by: ykhr53 <yukihira.lab@gmail.com>

* function name change: parse

Signed-off-by: ykhr53 <yukihira.lab@gmail.com>

* function name change: parse

Signed-off-by: ykhr53 <yukihira.lab@gmail.com>
2019-11-10 08:10:12 +00:00
Chris O'Haver
a7ab592e78
plugin/transfer: Zone transfer plugin (#3223)
* transfer plugin

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2019-11-01 12:02:43 -04:00
An Xiao
79f37a1460 Add plugin ACL for source ip filtering (#3103)
* Add plugin ACL for source ip filtering

Signed-off-by: An Xiao <hac@zju.edu.cn>

* Allow all arguments to be optional and support multiple qtypes in a single policy

Signed-off-by: An Xiao <hac@zju.edu.cn>

* Add newline before third party imports

Signed-off-by: An Xiao <hac@zju.edu.cn>

* Use camel instead of underscore in method name

Signed-off-by: An Xiao <hac@zju.edu.cn>

* Start with an upper case letter in t.Errorf()

Signed-off-by: An Xiao <hac@zju.edu.cn>

* Use the qtype parse logic in miekg/dns

Signed-off-by: An Xiao <hac@zju.edu.cn>

* Use third party trie implementation as the ip filter

Signed-off-by: An Xiao <hac@zju.edu.cn>

* Update based on rdrozhdzh's comment

Signed-off-by: An Xiao <hac@zju.edu.cn>

* Change the type of action to int

Signed-off-by: An Xiao <hac@zju.edu.cn>

* Add IPv6 support

Signed-off-by: An Xiao <hac@zju.edu.cn>

* Update plugin.cfg

Signed-off-by: An Xiao <hac@zju.edu.cn>

* Remove file functionality

Signed-off-by: An Xiao <hac@zju.edu.cn>

* Update

Signed-off-by: Xiao An <hac@zju.edu.cn>

* Update README

Signed-off-by: Xiao An <hac@zju.edu.cn>

* remove comments

Signed-off-by: Xiao An <hac@zju.edu.cn>

* update

Signed-off-by: Xiao An <hac@zju.edu.cn>

* Update dependency

Signed-off-by: Xiao An <hac@zju.edu.cn>

* Update

Signed-off-by: Xiao An <hac@zju.edu.cn>

* Update test

Signed-off-by: Xiao An <hac@zju.edu.cn>

* Add OWNERS

Signed-off-by: Xiao An <hac@zju.edu.cn>

* Refactor shouldBlock and skip useless check

Signed-off-by: Xiao An <hac@zju.edu.cn>

* Introduce ActionNone

Signed-off-by: Xiao An <hac@zju.edu.cn>

* Update label name

Signed-off-by: Xiao An <hac@zju.edu.cn>

* Avoid capitalizing private types

Signed-off-by: Xiao An <hac@zju.edu.cn>
2019-09-04 08:43:45 -07:00
Miek Gieben
b8a0b52a5e
plugin/sign: a plugin that signs zone (#2993)
* plugin/sign: a plugin that signs zones

Sign is a plugin that signs zone data (on disk). The README.md details
what exactly happens to should be accurate related to the code.

Signs are signed with a CSK, resigning and first time signing is all
handled by *sign* plugin.

Logging with a test zone looks something like this:

~~~ txt
[INFO] plugin/sign: Signing "miek.nl." because open plugin/sign/testdata/db.miek.nl.signed: no such file or directory
[INFO] plugin/sign: Signed "miek.nl." with key tags "59725" in 11.670985ms, saved in "plugin/sign/testdata/db.miek.nl.signed". Next: 2019-07-20T15:49:06.560Z
[INFO] plugin/file: Successfully reloaded zone "miek.nl." in "plugin/sign/testdata/db.miek.nl.signed" with serial 1563636548
[INFO] plugin/sign: Signing "miek.nl." because resign was: 10m0s ago
[INFO] plugin/sign: Signed "miek.nl." with key tags "59725" in 2.055895ms, saved in "plugin/sign/testdata/db.miek.nl.signed". Next: 2019-07-20T16:09:06.560Z
[INFO] plugin/file: Successfully reloaded zone "miek.nl." in "plugin/sign/testdata/db.miek.nl.signed" with serial 1563637748
~~~

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

* Adjust readme and remove timestamps

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

* Comment on the newline

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

* Update plugin/sign/README.md

Co-Authored-By: Michael Grosser <development@stp-ip.net>
2019-08-29 15:41:59 +01:00
Yong Tang
6402cef337
Move federation plugin to github.com/coredns/federation (#3139)
* Remove federation

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

* Rebuild and point to github.com/coredns/federation

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

* Export `localNodeName` => `LocalNodeName`, to be used by federation (until deprecation)

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

* Remove plugin/kubernetes/federation.go (=> kubernetes/federation repo)

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

* Update github.com/coredns/federation

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

* sticker-ci fix

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-08-18 14:41:51 -07:00
Palash Nigam
194b0f95b4 Add Google Cloud DNS plugin (#3011)
Signed-off-by: Palash Nigam <npalash25@gmail.com>

Closes: #2822
2019-08-17 13:59:09 -07:00
Darshan Chaudhary
879466b028 Add plugin for Azure DNS (#2945)
* Add plugin for Azure DNS

Signed-off-by: darshanime <deathbullet@gmail.com>

* Rename AzureDNS plugin to Azure

Signed-off-by: darshanime <deathbullet@gmail.com>

* remove upstream from azure syntax

Signed-off-by: darshanime <deathbullet@gmail.com>

* Rename azure plugin block keynames

Signed-off-by: darshanime <deathbullet@gmail.com>

* Normalize zone name before lookup in zones

Signed-off-by: darshanime <deathbullet@gmail.com>

* Update import path for caddy

Signed-off-by: darshanime <deathbullet@gmail.com>

* normalize azure zone name only if required

Signed-off-by: darshanime <deathbullet@gmail.com>

* Add support for MX, SRV, TXT, records

Signed-off-by: darshanime <deathbullet@gmail.com>

* Add specs for new record types

Signed-off-by: darshanime <deathbullet@gmail.com>

* Use sequential updates for zones

Signed-off-by: darshanime <deathbullet@gmail.com>

* Add OWNERS file for azure plugin

Signed-off-by: darshanime <deathbullet@gmail.com>

* Rename imports for third party packages

Signed-off-by: darshanime <deathbullet@gmail.com>

* Capitalize values in README

Signed-off-by: darshanime <deathbullet@gmail.com>

* Shorten keys for azure plugin config

Signed-off-by: darshanime <deathbullet@gmail.com>

* Fixup readme for azure plugin

Signed-off-by: darshanime <deathbullet@gmail.com>
2019-08-09 08:10:28 +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
Miek Gieben
39bc2af509
Add any plugin (#2801)
* Add any plugin

This adds the any plugin, a plain copy of coredns/any documented here
https://coredns.io/explugins/any/ as an external plugin.

Fixes: #2785

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

* Stickler bot nit

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-04-28 11:46:45 +01:00
Miek Gieben
a6cc88756c
proxy: remove from config (#2744)
fully remove proxy and make it completely external.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-04-01 07:52:47 +01:00
Miek Gieben
ba87a0e6ba
plugin/cancel: add context cancelation plugin (#2711)
* plugin/cancel: add context cancelation plugin

Per review comments on #2704, move this into a plugin that gets called.
Add the most minimal plugin, tests and documenation.

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

* plugin/cache: add timeout option

review feedback: add option to set custom timeout.

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

* spelling

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-29 19:40:23 +00:00
Iñigo
7b6cb76237 plugin/grpc: New gRPC plugin (#2667)
* plugin/grpc: New gRPC plugin

* some changes after the first review:

- remove healthcheck. gRPC already has this implicitly implemented
- some naming and stetic changes
- fix some comments
- other minor fixes

* plugin/grpc: New gRPC plugin

* some changes after the first review:

- remove healthcheck. gRPC already has this implicitly implemented
- some naming and stetic changes
- fix some comments
- other minor fixes

* add OWNERS file and change plugin order

* remove Rcode checker
2019-03-14 07:12:28 +00:00
Miek Gieben
d69f97be5c
plugin/proxy: remove (#2683)
Point proxy to the fake deprecated plugin, next release that will be
removed as well.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-12 21:36:43 +00:00
Miek Gieben
db0b16b615
Add *ready* plugin (#2616)
Add a ready plugin that allows plugin to signal when they are ready.
Once a plugin is ready it is not queried again.

This uses same mechanism as the health plugin: each plugin needs to
implement an interface.

Implement readines for the *erratic* plugin to aid in testing.

Add README.md and tests moduled after the health plugin; which will be
relegated to just providing process health. In similar vein to health
this is a process wide setting.

With this Corefile:
~~~
. {
    erratic
    whoami
    ready
}

bla {
    erratic
    whoami
}
~~~

ready will lead to:

~~~ sh
% curl localhost:8181/ready
% dig @localhost -p 1053 mx example.org
% curl localhost:8181/ready
OK%
~~~

Meanwhile CoreDNS logs:

~~~
.:1053
bla.:1053
2019-02-26T20:59:07.137Z [INFO] CoreDNS-1.3.1
2019-02-26T20:59:07.137Z [INFO] linux/amd64, go1.11.4,
CoreDNS-1.3.1
linux/amd64, go1.11.4,
2019-02-26T20:59:11.415Z [INFO] plugin/ready: Still waiting on: "erratic"
2019-02-26T20:59:13.510Z [INFO] plugin/ready: Still waiting on: "erratic"
~~~

*ready* can be used in multiple server blocks and will do the right
thing; query all those plugins from all server blocks for readiness.
This does a similar thing to the prometheus plugin.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-03-07 20:35:16 +00:00
Yong Tang
9dd288943a Move *proxy* to external (#2651)
* Move *proxy* to external

move the proxy plugin into coredns/proxy and remove it as a default
plugin. Link the proxy to deprecated in plugin.cfg

coredns/proxy doesn't compile because of the vendoring :(

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

* Add github.com/coredns/proxy

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2019-03-04 07:32:38 +00:00
Miek Gieben
c1c98924c3
Add new plugin: external - resolve k8s ingress and LB address with external names (#2379)
* Add new plugin: external

This plugin works in conjunction with the kubernetes plugin and exports
ingress and LB addresses as DNS records. It bypasses backend.go and
backend_lookup.go flow because it is not needed.

README, tests are implemented. The tests only exercise the unit tests,
this has not been tested in any ci.

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

* Rename to k8s_external

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

* go gen

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-12-14 09:41:51 +00:00
Miek Gieben
84ec780ffc
New plugin: loop (#1989)
* New plugin: loop

Add a plugin that detects loops. It does this by sending an unique query
to our selves. If we see the query more than twice we stop the process.
If there isn't a loop, the plugin disables it self and becomes a noop
plugin.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-20 19:45:17 +01:00
Miek Gieben
99800a687c
plugin/metadata: metadata is just label=value (#1914)
This revert 17d807f0 and re-adds the metadata plugin as a plugin that
just sets a label to a value function.

Add package documentation on how to use the metadata package. Make it
clear that any caching is up to the Func implemented.

There are now - no in tree users. We could add the request metadata by
default under names that copy request.Request, i.e

request/ip - remote IP
request/port - remote port

Variables.go has been deleted.

Signed-off-by: Miek Gieben <miek@miek.nl>
2018-07-01 20:01:17 +01:00
Eugen Kleiner
17d807f05f plugin/metadata: add metadata plugin (#1894)
* plugin/metadata: add metadata plugin

* plugin/metadata: Add MD struct, refactor code, fix doc

* plugin/metadata: simplify metadata key

* plugin/metadata: improve setup_test

* Support of metadata by rewrite plugin. Move calculated variables to metadata.

* Move variables from metadata to pkg, add UTs, READMEs change, metadata small fixes

* Add client port validation to variables_test

* plugin/metadata: improve README

* plugin/metadata: rename methods

* plugin/metadata: Update Metadataer interface, update doc, cosmetic code changes

* plugin/metadata: move colllisions check to OnStartup(). Fix default variables metadataer.

* plugin/metadata: Fix comment for method setValue

* plugin/metadata: change variables order to fix linter warning

* plugin/metadata: rename Metadataer to Provider
2018-06-29 10:44:16 +01:00
Miek Gieben
2758a756dd
Implement deprecation notice for 1.1.4 (#1833)
* Implement deprecation notice for 1.1.4

This still allows all the config to be parsed, but noops it:

* -log; always set the log to stdout; no matter what.
* https_google; removed from the proxy implementation.
* reverse plugin: set to deprecated.

* Whole of reverse can go

* Remove test for deprecated plugin
2018-05-24 14:30:01 +01:00
Miek Gieben
3e6489ef67 Remove the deprecate plugins (#1612)
Remove startup and shutdown completely
2018-03-14 21:18:29 +00:00
Miek Gieben
6cec66ce40
plugin/reload: enable (#1587)
Couldn't revert the original commit, just manually perform the needed
tweaks.
2018-03-02 17:17:26 -08:00
Miek Gieben
50b96fe2ce
deprecate startup/shutdown (#1577)
error on startup when we see these in a corefile:

~~~
% ./coredns
2018/03/01 06:51:23 plugin/startup: this plugin has been deprecated
% ./coredns
2018/03/01 06:51:32 plugin/shutdown: this plugin has been deprecated
~~~
2018-03-01 07:22:08 -08:00
Miek Gieben
2e894eb0a2
plugin/reload: disable for now (#1511)
Reloading should work (kill -TERM reload the coredns process), but a lot
of plugins can't handle it proper. Disable to reload plugin until we fix
(most) of the plugins
2018-02-09 11:30:55 +00:00
Miek Gieben
864f502356
Run go genenerate (#1506)
Forward still wasn't right; run make -f Makefile.doc, as well for good
measure.
2018-02-08 15:00:25 +00:00
John Belamaric
0b35d4d28f Reload hook (#1445)
* Add reload directive

* gofmt

* Fix default jitter and error message

* remove unneeded call to NextArg, add a couple negative setup tests

* Review feedback
2018-01-27 10:42:57 +00:00
Miek Gieben
c56fa8dbd3
Updates (#1432)
* Enable forward

* Regen all docs
2018-01-25 21:59:08 +00:00
Miek Gieben
77bd7eaede
Add on plugin (#1412)
Enable this Caddy plugin by default. Docs will go up coredns.io for this
as well.

See https://caddyserver.com/docs/on
2018-01-25 11:02:51 +00:00
Yong Tang
9d87b953a0 Enhancement of external plugin enabling (#1392)
This fix is an enhancement of external plugin enabling.
Previously, it was already able to build a customerized
coredns with plugins enabled selectively, without changing
coredns source code. However, all default plugins are
actually bundled because of the import rule:
```
"github.com/coredns/coredns/coremain"
```

The issue is best described with the following:
```
root@localhost:/go/src/github.com/coredns/coredns/sample# cat sample.go
package main

import (
        _ "github.com/coredns/forward"

        "github.com/coredns/coredns/coremain"
        "github.com/coredns/coredns/core/dnsserver"
)

var directives = []string{
        "forward",
        "startup",
        "shutdown",
}

func init() {
        dnsserver.Directives = directives
}

func main() {
        coremain.Run()
}
root@localhost:/go/src/github.com/coredns/coredns/sample#
root@localhost:/go/src/github.com/coredns/coredns/sample# go build -v sample.go
root@localhost:/go/src/github.com/coredns/coredns/sample# ./sample -plugins
root@localhost:/go/src/github.com/coredns/coredns/sample# ./sample -plugins
Server types:
  dns

Caddyfile loaders:
  flag
  default

Other plugins:
  dns.auto
  dns.autopath
  dns.bind
  dns.cache
  dns.chaos
  dns.debug
  dns.dnssec
  dns.dnstap
  dns.erratic
  dns.errors
  dns.etcd
  dns.federation
  dns.file
  dns.forward
  dns.health
  dns.hosts
  dns.kubernetes
  dns.loadbalance
  dns.log
  dns.nsid
  dns.pprof
  dns.prometheus
  dns.proxy
  dns.reverse
  dns.rewrite
  dns.root
  dns.route53
  dns.secondary
  dns.template
....
```

This fix moves zplugins.go to a different package/directory so that
it is possible to "only import plugins as needed".

The following is the new output after this fix:
```
root@localhost:/go/src/github.com/coredns/coredns/sample# ./sample -plugins
Server types:
  dns

Caddyfile loaders:
  flag
  default

Other plugins:
  dns.forward
  dns.prometheus
  shutdown
  startup

root@localhost:/go/src/github.com/coredns/coredns/sample#
```

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2018-01-15 21:54:10 +00:00
Renamed from core/zplugin.go (Browse further)