corazawaf / coraza-caddy

OWASP Coraza middleware for Caddy. It provides Web Application Firewall capabilities
https://www.coraza.io/
Apache License 2.0
290 stars 35 forks source link

Build tag KO? #68

Closed zguig52 closed 1 year ago

zguig52 commented 1 year ago

Hello,

I am trying to keep track of the version I use of coraza-caddy, but I have issue when calling it with the new release: xcaddy build --with github.com/corazawaf/coraza-caddy@v2.0.0-rc.1

[...]

0 1.031 go: added golang.org/x/term v0.5.0

0 1.031 go: added golang.org/x/text v0.7.0

0 1.031 go: added golang.org/x/tools v0.2.0

0 1.031 go: added google.golang.org/protobuf v1.28.1

0 1.034 2023/05/30 20:59:10 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/local/go/bin/go get -d -v github.com/corazawaf/coraza-caddy/v2@v2.0.0-rc.1 github.com/caddyserver/caddy/v2@v2.6.4

0 11.08 go: github.com/corazawaf/coraza-caddy@v2.0.0-rc.1: invalid version: module contains a go.mod file, so module path must match major version ("github.com/corazawaf/coraza-caddy/v2")

0 11.08 2023/05/30 20:59:20 [FATAL] exit status 1

When I specify the previous release, it is working fine: xcaddy build --with github.com/corazawaf/coraza-caddy@v1.2.2

Here is the Dockerfile I use:

# Set Caddy release tag
ARG CADDY_TAG="2.6-builder-alpine"

# Use official Caddy builder image
FROM caddy:"${CADDY_TAG}" as builder-caddy

# Build Caddy with Coraza
RUN --mount=type=cache,target=/go,id=caddy \
  xcaddy build --with github.com/corazawaf/coraza-caddy@v2.0.0-rc.1

Is it me doing something wrong or is there an issue with metadata somewhere?

Please note, when I try this way, I get the same error: xcaddy build --with github.com/corazawaf/coraza-caddy/v2@v2.0.0-rc.1

ericswpark commented 1 year ago

Getting the same issue here, trying to use v2.0.0-rc.1 because that's the revision that is not affected by issue #63. Until this can be fixed using master is another option.

jcchavezs commented 1 year ago

Opened a PR to fix this.