1. Caddy version (caddy version
):
v2.3.0 h1:fnrqJLa3G5vfxcxmOH/+kJOcunPLhSBnjgIvjXV/QTA=
2. How I run Caddy:
a. System environment:
Ubuntu 20.04
b. Command:
xcaddy build master --with github.com/caddy-dns/cloudflare@latest
sudo systemctl restart caddy
c. Service/unit/compose file:
n/a
d. My complete Caddyfile:
{
debug
}
darrenter.cyou, *.darrenter.cyou {
root * /var/www/html/darrenter.cyou
# Enable the static file server.
file_server
# Compress Response
encode gzip
log {
output file /var/log/caddy/darrenter.cyou.access.log {
roll_size 1gb
roll_keep 1000
roll_keep_for 2880h
}
}
tls {
dns cloudflare [REDACTED]
}
}
3. The problem I’m having:
I have installed the cloudflare module via
xcaddy build master --with github.com/caddy-dns/cloudflare@latest
View the result of command here
but the dns.providers.cloudflare doesn’t listed inside caddy list-modules
Full List of my list-modules
admin.api.load
admin.api.metrics
caddy.adapters.caddyfile
caddy.listeners.tls
caddy.logging.encoders.console
caddy.logging.encoders.filter
caddy.logging.encoders.filter.delete
caddy.logging.encoders.filter.ip_mask
caddy.logging.encoders.json
caddy.logging.encoders.logfmt
caddy.logging.encoders.single_field
caddy.logging.writers.discard
caddy.logging.writers.file
caddy.logging.writers.net
caddy.logging.writers.stderr
caddy.logging.writers.stdout
caddy.storage.file_system
http
http.authentication.hashes.bcrypt
http.authentication.hashes.scrypt
http.authentication.providers.http_basic
http.encoders.gzip
http.encoders.zstd
http.handlers.acme_server
http.handlers.authentication
http.handlers.encode
http.handlers.error
http.handlers.file_server
http.handlers.headers
http.handlers.map
http.handlers.metrics
http.handlers.push
http.handlers.request_body
http.handlers.reverse_proxy
http.handlers.rewrite
http.handlers.static_response
http.handlers.subroute
http.handlers.templates
http.handlers.vars
http.matchers.expression
http.matchers.file
http.matchers.header
http.matchers.header_regexp
http.matchers.host
http.matchers.method
http.matchers.not
http.matchers.path
http.matchers.path_regexp
http.matchers.protocol
http.matchers.query
http.matchers.remote_ip
http.matchers.vars
http.matchers.vars_regexp
http.reverse_proxy.selection_policies.cookie
http.reverse_proxy.selection_policies.first
http.reverse_proxy.selection_policies.header
http.reverse_proxy.selection_policies.ip_hash
http.reverse_proxy.selection_policies.least_conn
http.reverse_proxy.selection_policies.random
http.reverse_proxy.selection_policies.random_choose
http.reverse_proxy.selection_policies.round_robin
http.reverse_proxy.selection_policies.uri_hash
http.reverse_proxy.transport.fastcgi
http.reverse_proxy.transport.http
pki
tls
tls.certificates.automate
tls.certificates.load_files
tls.certificates.load_folders
tls.certificates.load_pem
tls.handshake_match.sni
tls.issuance.acme
tls.issuance.internal
tls.issuance.zerossl
tls.stek.distributed
tls.stek.standard
For references, my DNS record configured to be:
A darrenter.cyou {my server ip} DNS only
A * {my server ip} DNS only
4. Error messages and/or full log output:
parsing caddyfile tokens for 'tls': /etc/caddy/Caddyfile:33 - Error during parsing: getting DNS provider module named 'cloudflare': module not registered: dns.providers.cloudflare
5. What I already tried:
I saw similar issue in repo of cloudflare module, the maintainer suggest to build the xcaddy with tagged release.
So I run
xcaddy build v2.2.0-rc.1 --with github.com/caddy-dns/cloudflare@latest
Instead of:
xcaddy build --with github.com/caddy-dns/cloudflare
But I still doesn’t saw cloudflare module in list-modules
Another thing I notice with this issue is, when I run xcaddy
in terminal, error message occur:
go list -m: not using modules
2021/03/31 03:18:50 [ERROR] exec [go list -m]: exit status 1:
Not sure whether it cause the issue I face now.
6. Links to relevant resources:
opened 03:31PM - 08 Aug 20 UTC
closed 06:05PM - 11 Aug 20 UTC
I tried to build `caddy` with this plugin using `xcaddy` but it failed.
**Com… mand used**:
```
xcaddy build --with github.com/caddy-dns/cloudflare
```
**Output:**
```
2020/08/08 15:21:00 [INFO] Temporary folder: /tmp/buildenv_2020-08-08-1521.391743880
2020/08/08 15:21:00 [INFO] Writing main module: /tmp/buildenv_2020-08-08-1521.391743880/main.go
2020/08/08 15:21:00 [INFO] Initializing Go module
2020/08/08 15:21:00 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod init caddy
go: creating new go.mod: module caddy
2020/08/08 15:21:00 [INFO] Pinning versions
2020/08/08 15:21:00 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/caddyserver/caddy/v2@v2.1.1
go: downloading github.com/caddyserver/caddy/v2 v2.1.1
go: downloading go.uber.org/zap v1.15.0
go: downloading golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
go: downloading github.com/caddyserver/certmagic v0.11.2
go: downloading go.uber.org/atomic v1.6.0
go: downloading go.uber.org/multierr v1.5.0
go: downloading github.com/go-acme/lego/v3 v3.7.0
go: downloading github.com/klauspost/cpuid v1.3.0
go: downloading golang.org/x/sys v0.0.0-20200413165638-669c56c373c4
go: downloading gopkg.in/square/go-jose.v2 v2.4.0
go: downloading github.com/cenkalti/backoff/v4 v4.0.0
go: downloading github.com/miekg/dns v1.1.27
go: downloading golang.org/x/net v0.0.0-20200625001655-4c5254603344
go: downloading golang.org/x/text v0.3.2
2020/08/08 15:21:34 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/caddy-dns/cloudflare
go: downloading github.com/caddy-dns/cloudflare v0.0.0-20200807233547-c4ab2c801158
go: github.com/caddy-dns/cloudflare upgrade => v0.0.0-20200807233547-c4ab2c801158
go: downloading github.com/caddyserver/caddy/v2 v2.1.2-0.20200807181229-65a09524c392
go: downloading github.com/libdns/cloudflare v0.0.0-20200528144945-97886e7873b1
go: downloading github.com/libdns/libdns v0.0.0-20200501023120-186724ffc821
go: downloading golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de
go: downloading github.com/caddyserver/certmagic v0.11.3-0.20200730200704-7d9dfc3fe638
go: downloading github.com/mholt/acmez v0.1.0
go: downloading github.com/miekg/dns v1.1.30
go: downloading golang.org/x/net v0.0.0-20200707034311-ab3426394381
2020/08/08 15:21:41 [INFO] Build environment ready
2020/08/08 15:21:41 [INFO] Building Caddy
2020/08/08 15:21:41 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /build/caddy -ldflags -w -s -trimpath
go: downloading github.com/smallstep/certificates v0.15.0-rc.1.0.20200506212953-e855707dc274
go: downloading github.com/klauspost/compress v1.10.10
go: downloading github.com/google/cel-go v0.5.1
go: downloading google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98
go: downloading github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac
go: downloading github.com/go-chi/chi v4.1.2+incompatible
go: downloading github.com/lucas-clemente/quic-go v0.17.3
go: downloading github.com/smallstep/truststore v0.9.6
go: downloading github.com/smallstep/nosql v0.3.0
go: downloading github.com/marten-seemann/qpack v0.1.0
go: downloading google.golang.org/protobuf v1.25.0
go: downloading github.com/golang/protobuf v1.4.1
go: downloading github.com/cheekybits/genny v1.0.0
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/francoispqt/gojay v1.2.13
go: downloading github.com/dgraph-io/badger v1.5.3
go: downloading github.com/yuin/goldmark v1.2.1
go: downloading github.com/smallstep/cli v0.14.6
go: downloading github.com/marten-seemann/qtls v0.9.1
go: downloading github.com/dgraph-io/badger/v2 v2.0.1-rc1.0.20200413122845-09dd2e1a4195
go: downloading github.com/go-sql-driver/mysql v1.5.0
go: downloading github.com/Masterminds/sprig/v3 v3.1.0
go: downloading github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3
go: downloading github.com/mitchellh/copystructure v1.0.0
go: downloading github.com/yuin/goldmark-highlighting v0.0.0-20200307114337-60d527fdb691
go: downloading github.com/naoina/toml v0.1.1
go: downloading github.com/alecthomas/chroma v0.8.0
go: downloading github.com/mitchellh/reflectwalk v1.0.0
go: downloading gopkg.in/natefinch/lumberjack.v2 v2.0.0
go: downloading github.com/huandu/xstrings v1.3.1
go: downloading github.com/naoina/go-stringutil v0.1.0
go: downloading github.com/cespare/xxhash v1.1.0
go: downloading github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2
go: downloading github.com/google/uuid v1.1.1
go: downloading go.etcd.io/bbolt v1.3.2
go: downloading github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
go: downloading github.com/manifoldco/promptui v0.3.1
go: downloading gopkg.in/yaml.v2 v2.3.0
go: downloading github.com/dlclark/regexp2 v1.2.0
go: downloading github.com/spf13/cast v1.3.1
go: downloading github.com/Masterminds/semver v1.4.2
go: downloading github.com/Masterminds/semver/v3 v3.1.0
go: downloading github.com/urfave/cli v1.22.2
go: downloading github.com/imdario/mergo v0.3.8
go: downloading github.com/golang/snappy v0.0.1
go: downloading github.com/antlr/antlr4 v0.0.0-20200503195918-621b933c7a7f
go: downloading github.com/jsternberg/zap-logfmt v1.2.0
go: downloading github.com/cpuguy83/go-md2man v1.0.10
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0
go: downloading github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a
go: downloading github.com/mattn/go-colorable v0.1.6
go: downloading github.com/lunixbochs/vtclean v1.0.0
go: downloading github.com/mattn/go-isatty v0.0.12
go: downloading github.com/russross/blackfriday v1.5.2
go: downloading github.com/russross/blackfriday/v2 v2.0.1
go: downloading github.com/samfoo/ansi v0.0.0-20160124022901-b6bd2ded7189
go: downloading github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964
go: downloading github.com/Masterminds/goutils v1.1.0
go: downloading github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
go: downloading github.com/rs/xid v1.2.1
go: downloading github.com/sirupsen/logrus v1.4.2
go: downloading cloud.google.com/go v0.54.0
go: downloading google.golang.org/grpc v1.27.1
go: downloading github.com/googleapis/gax-go v2.0.0+incompatible
go: downloading google.golang.org/api v0.20.0
go: downloading github.com/googleapis/gax-go/v2 v2.0.5
go: downloading golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
go: downloading go.opencensus.io v0.22.3
go: downloading github.com/google/go-cmp v0.5.0
go: downloading github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
# github.com/smallstep/certificates/authority/provisioner
/go/pkg/mod/github.com/smallstep/certificates@v0.15.0-rc.1.0.20200506212953-e855707dc274/authority/provisioner/jwk.go:155:24: assignment mismatch: 3 variables but x509util.SplitSANs returns 4 values
/go/pkg/mod/github.com/smallstep/certificates@v0.15.0-rc.1.0.20200506212953-e855707dc274/authority/provisioner/x5c.go:197:24: assignment mismatch: 3 variables but x509util.SplitSANs returns 4 values
2020/08/08 15:22:32 [INFO] Cleaning up temporary folder: /tmp/buildenv_2020-08-08-1521.391743880
2020/08/08 15:22:32 [FATAL] exit status 2
```
Is it something that I am doing wrongly?
EDIT: I was able to build a Dockerfile using `caddy:builder` image. If anyone's interested: https://github.com/mr-karan/caddy-plugins-docker