Using DNS Plugins like "generic" and "httpreq"

(Niksac) #1

Hi,

I plan to use Caddy with DNS ACME Challenge and read through the documentation where it said " Caddy supports many DNS providers.". I read through the source code and decided to ready my own DNS Server for the httpreq method.

I noticed that this method was only pulled in a few days ago and also wrote a sh script to make it work via the “generic” DNS provider.

When downloading i noticed that generic isn’t available from the plugin list either.
Is the only option to use those plugins building caddy myself?

Best regards and thank you for the awesome work.

(Matthew Fay) #2

Howdy @Niksac, welcome to the Caddy community.

I think this is just a case where @matt has yet to document the functionality and make it available to the build server (download page). As you noted, the httpreq provider was only recently added to the Caddy repo for plugging in.

(Niksac) #3

Hi,
thank you!!
I think the “generic” / exec DNS provider was added quite some time ago which makes me wonder why he is still missing from the downloads page.

I tried to build caddy to get these plugins working like this:

package main

import (
	"github.com/mholt/caddy/caddy/caddymain"
	_ "github.com/caddyserver/dnsproviders/generic"
)

func main() {
	caddymain.Run()
}

Unfortunately i am getting errors like this:

go: github.com/h2non/gock@v0.0.0-00010101000000-000000000000: unknown revision 000000000000
go: error loading module requirements

I have no experience in go - can anybody hint me how to get a built with those providers?

Nik

(Matthew Fay) #4

I’m assuming you followed all the instructions over at https://github.com/mholt/caddy/wiki/Plugging-in-Plugins-Yourself?

(Niksac) #5

Yes, also it works, when i don’t include the dns plugin

(Matthew Fay) #6

Strange. Can you build it with a different, known working provider plugin? Like github.com/caddyserver/dnsproviders/cloudflare?

(Niksac) #7

It happens in the module dnsproviders, so no provider works.

If i were to guess, i’m facing this

mholt already did something to fix it. I guess i need to import the master of the dnsproviders package.

I successfully built with the "generic " package by adding this to my local go.mod

replace github.com/h2non/gock => gopkg.in/h2non/gock.v1 v1.0.14

(Niksac) #8

Any idea if / when the remaining DNS plugins will be available from the build-server?

The generic plugin - for instance - was added to the source 11 month ago.

(Matthew Fay) #9

I’m not sure, sorry. That’s something only @matt can answer.

(Matt Holt) #10

Oh. Sorry… I just need to set aside some time and deploy them. There are so many :sweat:

Actually, anyone can add the DNS provider plugins to the Caddy website. Just create an account and go through the form to register a new plugin.

1 Like