pteich / caddy-tlsconsul

🔒 Consul K/V storage for Caddy Web Server / Certmagic TLS data
Apache License 2.0
96 stars 17 forks source link

project targets invalid Caddy version and doesn't compile anymore on 2.0.0 #12

Closed rgdev closed 4 years ago

rgdev commented 4 years ago

the go.mod points to a 2.0.1 version of Caddy but it's nowhere to be found in Caddy's releases. I assume it got skipped and merged into the current 2.1 beta perhaps ?

Anyway, compiling against the latest stable version of Caddy (2.0.0) results in a failed compilation because your go.mod requires certmagic 0.11.1 but Caddy 2.0.0 is not compatible with this version yet according to this issue.

I simply used the official docker builder image to compile it :

FROM caddy:2.0.0-builder AS builder
RUN caddy-builder github.com/pteich/caddy-tlsconsul@9b3eabb7bc8272133c982dbdb82073b31b48bf69

FROM caddy:2.0.0
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
ENTRYPOINT ["/usr/bin/caddy"]

And ended up with :

[...]
go: downloading github.com/opencontainers/go-digest v1.0.0-rc1
go: downloading github.com/Microsoft/go-winio v0.4.14
go: downloading github.com/konsorten/go-windows-terminal-sequences v1.0.2
# github.com/caddyserver/caddy/v2/modules/caddytls/distributedstek
/src/caddy/modules/caddytls/distributedstek/distributedstek.go:144:16: not enough arguments in call to s.storage.Lock
    have (string)
    want (context.Context, string)
The command '/bin/sh -c caddy-builder github.com/pteich/caddy-tlsconsul@9b3eabb7bc8272133c982dbdb82073b31b48bf69' returned a non-zero code: 2

I'm not quite sure what happened with caddy 2.0.1 but maybe it would be better to stick to the latest released stable version of Caddy for new releases of TLSConsul. Or at least tag new builds targeting in-development or beta versions of Caddy differently like 1.2.3-beta or something ?

On a more positive note : Good job on the UnmarshalCaddyfile support, i'm looking forward to using it 👍

pteich commented 4 years ago

That's right. The version in master does not compile with the lastest stable version of Caddy right now. @mholt added support for the new Locker interface of CertMagic 0.11.0 in #10 but this only available in Caddy's master branch right now.

This is the reason that go.mod points to a development version of Caddy. Go creates links to a "fake" version number when running go get github.com/caddyserver/caddy/v2@master.

Have a look at my updated Dockerfile on how to compile with this version.