caddyserver / caddy

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
https://caddyserver.com
Apache License 2.0
55.45k stars 3.91k forks source link

Documentation claims `basicauth` was renamed to `basic_auth` but this doesn’t work for me on 2.8.4 #6418

Closed dpk closed 1 week ago

dpk commented 1 week ago

Docs:

Prior to v2.8.0, this directive was named basicauth, but was renamed for consistency with other directives.

[nix-shell:/var/service/caddy]$ caddy --version
2.8.4

Trying to use the name basic_auth gave me:

Error: adapting config using caddyfile: /var/nix-shell/caddy/Caddyfile:32: unrecognized directive: basic_auth

but basicauth worked.

francislavoie commented 1 week ago

What do you have if you run caddy build-info? I think that version number might be a lie somehow. You might need to reach out to the nix people about how they're packaging Caddy.

mholt commented 1 week ago

Yeah, that's not a genuine caddy version string. So it must have been modified, and it probably isn't actually that version. There should be a module checksum next to it.

dpk commented 1 week ago

This is the standard Nix version. So it’s possibly a bug in the Nix derivation.

[nix-shell:~]$ caddy build-info
go  go1.22.3
path    github.com/caddyserver/caddy/v2/cmd/caddy
mod github.com/caddyserver/caddy/v2 (devel)
dep filippo.io/edwards25519 v1.1.0
dep github.com/BurntSushi/toml  v1.3.2
dep github.com/Masterminds/goutils  v1.1.1
dep github.com/Masterminds/semver/v3    v3.2.0
dep github.com/Masterminds/sprig/v3 v3.2.3
dep github.com/alecthomas/chroma/v2 v2.13.0
dep github.com/antlr4-go/antlr/v4   v4.13.0
dep github.com/aryann/difflib   v0.0.0-20210328193216-ff5ff6dc229b
dep github.com/beorn7/perks v1.0.1
dep github.com/caddyserver/certmagic    v0.21.3
dep github.com/caddyserver/zerossl  v0.1.3
dep github.com/cenkalti/backoff/v4  v4.2.1
dep github.com/cespare/xxhash/v2    v2.2.0
dep github.com/chzyer/readline  v1.5.1
dep github.com/cpuguy83/go-md2man/v2    v2.0.3
dep github.com/dlclark/regexp2  v1.11.0
dep github.com/dustin/go-humanize   v1.0.1
dep github.com/felixge/httpsnoop    v1.0.4
dep github.com/fxamacker/cbor/v2    v2.6.0
dep github.com/go-chi/chi/v5    v5.0.12
dep github.com/go-jose/go-jose/v3   v3.0.3
dep github.com/go-kit/kit   v0.13.0
dep github.com/go-kit/log   v0.2.1
dep github.com/go-logfmt/logfmt v0.6.0
dep github.com/go-logr/logr v1.4.1
dep github.com/go-logr/stdr v1.2.2
dep github.com/go-sql-driver/mysql  v1.7.1
dep github.com/google/cel-go    v0.20.1
dep github.com/google/certificate-transparency-go   v1.1.8-0.20240110162603-74a5dd331745
dep github.com/google/go-tpm    v0.9.0
dep github.com/google/go-tspi   v0.3.0
dep github.com/google/uuid  v1.6.0
dep github.com/grpc-ecosystem/grpc-gateway/v2   v2.18.0
dep github.com/huandu/xstrings  v1.3.3
dep github.com/imdario/mergo    v0.3.12
dep github.com/jackc/chunkreader/v2 v2.0.1
dep github.com/jackc/pgconn v1.14.3
dep github.com/jackc/pgio   v1.0.0
dep github.com/jackc/pgpassfile v1.0.0
dep github.com/jackc/pgproto3/v2    v2.3.3
dep github.com/jackc/pgservicefile  v0.0.0-20221227161230-091c0ba34f0a
dep github.com/jackc/pgtype v1.14.0
dep github.com/jackc/pgx/v4 v4.18.3
dep github.com/klauspost/compress   v1.17.8
dep github.com/klauspost/cpuid/v2   v2.2.7
dep github.com/libdns/libdns    v0.2.2
dep github.com/manifoldco/promptui  v0.9.0
dep github.com/mattn/go-colorable   v0.1.13
dep github.com/mattn/go-isatty  v0.0.20
dep github.com/mgutz/ansi   v0.0.0-20200706080929-d51e80ef957d
dep github.com/mholt/acmez/v2   v2.0.1
dep github.com/miekg/dns    v1.1.59
dep github.com/mitchellh/copystructure  v1.2.0
dep github.com/mitchellh/go-ps  v1.0.0
dep github.com/mitchellh/reflectwalk    v1.0.2
dep github.com/pires/go-proxyproto  v0.7.0
dep github.com/pkg/errors   v0.9.1
dep github.com/prometheus/client_golang v1.19.1
dep github.com/prometheus/client_model  v0.5.0
dep github.com/prometheus/common    v0.48.0
dep github.com/prometheus/procfs    v0.12.0
dep github.com/quic-go/qpack    v0.4.0
dep github.com/quic-go/quic-go  v0.44.0
dep github.com/rs/xid   v1.5.0
dep github.com/russross/blackfriday/v2  v2.1.0
dep github.com/shopspring/decimal   v1.2.0
dep github.com/shurcooL/sanitized_anchor_name   v1.0.0
dep github.com/sirupsen/logrus  v1.9.3
dep github.com/slackhq/nebula   v1.6.1
dep github.com/smallstep/certificates   v0.26.1
dep github.com/smallstep/go-attestation v0.4.4-0.20240109183208-413678f90935
dep github.com/smallstep/nosql  v0.6.1
dep github.com/smallstep/pkcs7  v0.0.0-20231024181729-3b98ecc1ca81
dep github.com/smallstep/scep   v0.0.0-20231024192529-aee96d7ad34d
dep github.com/smallstep/truststore v0.13.0
dep github.com/spf13/cast   v1.4.1
dep github.com/spf13/cobra  v1.8.0
dep github.com/spf13/pflag  v1.0.5
dep github.com/stoewer/go-strcase   v1.2.0
dep github.com/tailscale/tscert v0.0.0-20240517230440-bbccfbf48933
dep github.com/urfave/cli   v1.22.14
dep github.com/x448/float16 v0.8.4
dep github.com/yuin/goldmark    v1.7.1
dep github.com/yuin/goldmark-highlighting/v2    v2.0.0-20230729083705-37449abec8cc
dep github.com/zeebo/blake3 v0.2.3
dep go.etcd.io/bbolt    v1.3.9
dep go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp   v0.49.0
dep go.opentelemetry.io/contrib/propagators/autoprop    v0.42.0
dep go.opentelemetry.io/contrib/propagators/aws v1.17.0
dep go.opentelemetry.io/contrib/propagators/b3  v1.17.0
dep go.opentelemetry.io/contrib/propagators/jaeger  v1.17.0
dep go.opentelemetry.io/contrib/propagators/ot  v1.17.0
dep go.opentelemetry.io/otel    v1.24.0
dep go.opentelemetry.io/otel/exporters/otlp/otlptrace   v1.21.0
dep go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0
dep go.opentelemetry.io/otel/metric v1.24.0
dep go.opentelemetry.io/otel/sdk    v1.21.0
dep go.opentelemetry.io/otel/trace  v1.24.0
dep go.opentelemetry.io/proto/otlp  v1.0.0
dep go.step.sm/cli-utils    v0.9.0
dep go.step.sm/crypto   v0.45.0
dep go.step.sm/linkedca v0.20.1
dep go.uber.org/automaxprocs    v1.5.3
dep go.uber.org/multierr    v1.11.0
dep go.uber.org/zap v1.27.0
dep go.uber.org/zap/exp v0.2.0
dep golang.org/x/crypto v0.23.0
dep golang.org/x/crypto/x509roots/fallback  v0.0.0-20240507223354-67b13616a595
dep golang.org/x/exp    v0.0.0-20240506185415-9bf2ced13842
dep golang.org/x/net    v0.25.0
dep golang.org/x/sync   v0.7.0
dep golang.org/x/sys    v0.20.0
dep golang.org/x/term   v0.20.0
dep golang.org/x/text   v0.15.0
dep golang.org/x/time   v0.5.0
dep google.golang.org/genproto/googleapis/api   v0.0.0-20240506185236-b8a5c65736ae
dep google.golang.org/genproto/googleapis/rpc   v0.0.0-20240429193739-8cf5692501f6
dep google.golang.org/grpc  v1.63.2
dep google.golang.org/protobuf  v1.34.1
dep gopkg.in/natefinch/lumberjack.v2    v2.2.1
dep gopkg.in/yaml.v3    v3.0.1
build   -buildmode=exe
build   -compiler=gc
build   -tags=nobadger
build   -trimpath=true
build   DefaultGODEBUG=httplaxcontentlength=1,httpmuxgo121=1,tls10server=1,tlsrsakex=1,tlsunsafeekm=1
build   CGO_ENABLED=1
build   GOARCH=amd64
build   GOOS=linux
build   GOAMD64=v1
dpk commented 1 week ago

I’m not seeing anything unusual going on here … https://github.com/NixOS/nixpkgs/blob/nixpkgs-unstable/pkgs/by-name/ca/caddy/package.nix Looks like a pretty standard build from Go source.

dpk commented 1 week ago

Okay, this definitely seems like an issue with Nix (possibly only my local Nix setup) so I’m closing this. Thanks for the hints.