pteich / caddy-tlsconsul

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

Build error with caddy 2.5.0 #23

Closed resmo closed 2 years ago

resmo commented 2 years ago

Hi @pteich

I see a build error using caddy 2.5.0, would be happy if you could look into it. Many thanks.

2022/05/03 10:00:05 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /usr/bin/caddy -ldflags -w -s -trimpath 
# github.com/pteich/caddy-tlsconsul
/go/pkg/mod/github.com/pteich/caddy-tlsconsul@v1.3.8/module.go:47:9: cannot use cs (variable of type *ConsulStorage) as type certmagic.Storage in return statement:
    *ConsulStorage does not implement certmagic.Storage (wrong type for Delete method)
        have Delete(key string) error
        want Delete(ctx context.Context, key string) error
/go/pkg/mod/github.com/pteich/caddy-tlsconsul@v1.3.8/storage.go:157:25: undefined: certmagic.ErrNotExist
/go/pkg/mod/github.com/pteich/caddy-tlsconsul@v1.3.8/storage.go:161:25: undefined: certmagic.ErrNotExist
/go/pkg/mod/github.com/pteich/caddy-tlsconsul@v1.3.8/storage.go:179:20: undefined: certmagic.ErrNotExist
/go/pkg/mod/github.com/pteich/caddy-tlsconsul@v1.3.8/storage.go:183:20: undefined: certmagic.ErrNotExist
/go/pkg/mod/github.com/pteich/caddy-tlsconsul@v1.3.8/storage.go:212:31: undefined: certmagic.ErrNotExist
/go/pkg/mod/github.com/pteich/caddy-tlsconsul@v1.3.8/storage.go:216:31: undefined: certmagic.ErrNotExist
/go/pkg/mod/github.com/pteich/caddy-tlsconsul@v1.3.8/storage.go:254:41: undefined: certmagic.ErrNotExist
pteich commented 2 years ago

Hi @resmo

The necessary changes for the new Caddy version were not included in the v1.3.8 version but in the latest master. The cause is that I've not added a tag vor a new release of this plugin so the Go toolchain always loaded the old one.

I've added a new v1.4.0 release that now supports the new CertMagic interfaces and Caddy v2.5.0. It should work now. (Maybe a go get -u github.com/pteich/caddy-tlsconsul is needed first)

resmo commented 2 years ago

fixed with v1.4.0 ❤️