Ok. So I am finally ready to jump into V2 but I have two questions related to plugins
What V1 plugins/modules are available for V2 (is there a list like on the v1 website)? In particular I need the route53 dns plugin.
I run caddy mostly on armv8 machines. At the V1 caddy web it would compile an executable with the plugins I chose for the architecture I chose and then I could download it. Looks like in V2 I have to compile it myself? I have a setup of go with modules for my dev x86 for doing basic compiles of go source but since I am not a go programmer I have no idea how to cross compile for armv8. I don’t really want to compile on my armv8 machines directly they are for production and also at least with kernal compiles, slow. What is going to be the easy way to create custom binaries (i.e. with plugins) for armv8?
There is no central registry yet. Like with v1: first I need to get the software released, and then I can spend time working on the website.
v2 doesn’t yet have full-fledged DNS provider support, since I need to do some major refactoring of a fork of an upstream project first. But if you don’t mind using a PR that someone made, you can at least use Route53 sooner than later with v2: https://github.com/caddyserver/tls.dns/pull/2
We have compiled binaries for various platforms at our Download link (expand the “Assets” link – I wish GitHub would make those more prominent but whatever).
Of course, these don’t have extra plugins installed.
Use xcaddy - you can cross-compile just like you would with the regular go command: GOOS=linux GOARCH=arm64 xcaddy build ...
Another issue is that if the build completes (i.e. I leave out the module for now) xcaddy tries to run the executable (why I asked for build) but it fails for some permission error (why?). Owner of folder is same as user who launched the script. . Not a big deal my script runs it for version afterwards anyway
/opt/caddy2/amd64 version
2020/04/15 12:36:10 [FATAL] fork/exec /opt/caddy2/amd64: permission denied
Oh, yeah, this is because it’s a fork… hmm… needs a replace statement. I’m not sure xcaddy supports that yet… I suppose I need to implement something like:
@danlsgiga Sorry as I mentioned I’m a go coder noob. Guess I’m gonna more explicit directions
In this case seems I can’t use xcaddy (doesn’t support replace) but must compile from the source?
ok so I cloned caddy2 source
So then I run mod edit -replace github.com/caddyserver/tls.dns=github.com/danlsgiga/tls.dns on the caddy 2 source right?
whoops another error
go mod: -replace=github.com/caddyserver/tls.dns=github.com/danlsgiga/tls.dns: unversioned new path must be local directory
I assume that github.com/caddyserver/tls.dns is already a module that caddy2 source pulls? cause I have no idea how to add modules with go build like xcaddy does --with.
hmm… if I look at go.mod github.com/caddyserver/tls.dns is not even listed` so maybe the error
I think the easiest solution is to make a fork of @danlsgiga’s repo, make a commit to change the go.mod file module github.com/caddyserver/tls.dns to module github.com/<your-username>/tls.dns then use github.com/<your-username>/tls.dns@<commit-hash> with xcaddy.
Not a permanent solution, but it should work for now.