gaukas / clienthellod

TLS ClientHello/QUIC Initial Packet reflection service
https://client.tlsfingerprint.io
Apache License 2.0
15 stars 2 forks source link

xcaddy build fails with AppIfConfigured returns 2 values #24

Closed forgetso closed 6 hours ago

forgetso commented 6 hours ago
FROM caddy:2-builder AS builder
RUN apk update && apk add gcc g++ make libpcap-dev libpcap
RUN CGO_ENABLED=1 xcaddy build \
    --with github.com/mholt/caddy-ratelimit \
    --with github.com/gaukas/clienthellod/modcaddy
33.89 go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
34.04 2024/11/07 22:03:41 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /usr/bin/caddy -ldflags -w -s -trimpath -tags nobadger,nomysql,nopgx 
68.73 # github.com/gaukas/clienthellod/modcaddy/listener
68.73 /go/pkg/mod/github.com/gaukas/clienthellod@v0.4.2/modcaddy/listener/listener.go:65:10: assignment mismatch: 1 variable but ctx.AppIfConfigured returns 2 values
68.76 # github.com/gaukas/clienthellod/modcaddy/handler
68.76 /go/pkg/mod/github.com/gaukas/clienthellod@v0.4.2/modcaddy/handler/handler.go:53:10: assignment mismatch: 1 variable but ctx.AppIfConfigured returns 2 values
69.91 2024/11/07 22:04:17 [INFO] Skipping cleanup as requested; leaving folder intact: /tmp/buildenv_2024-11-07-2203.2121729552
69.91 2024/11/07 22:04:17 [FATAL] exit status 1

Any ideas how to fix this?

forgetso commented 6 hours ago

Ah, I can see this is a problem with 0.4.2 but is fixed in 0.5 alpha.

https://github.com/gaukas/clienthellod/blob/bb3ee89b377cc9308cfaa46b0215c74e1cbb2b8f/modcaddy/listener/listener.go#L65

vs.

https://github.com/gaukas/clienthellod/blob/560e27ce8432c6eae9a23f559ccdc5027d11b35e/modcaddy/listener/listener.go#L61