Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem in caddy upgrade #195

Open
skrlance opened this issue Jan 16, 2025 · 7 comments
Open

Problem in caddy upgrade #195

skrlance opened this issue Jan 16, 2025 · 7 comments

Comments

@skrlance
Copy link

Hi,
Coraza caddy build from xCaddy works:

xcaddy build --with github.com/corazawaf/coraza-caddy/v2

However, if I have to add package coraza caddy it still installs 1.2.2 version, not v2.0.0 stable:

caddy add-package github.com/corazawaf/coraza-caddy

Likewise, if I have v1.2.2 and want to upgrade through caddy upgrade command, it doesn't update to v2.0.0 stable release rather it stays on v1.2.2.

So, please point the available package to the latest stable release.

Thank You!

@jcchavezs
Copy link
Member

jcchavezs commented Jan 17, 2025 via email

@skrlance
Copy link
Author

Yes, I tried it and it says:

Error: download failed: download failed: HTTP 400: github.com/corazawaf/coraza-caddy/v2 is not a registered Caddy module package path (id=c29116b6-7ea5-4c29-8eec-e2ca7e7e24f4)

@jcchavezs
Copy link
Member

jcchavezs commented Jan 17, 2025 via email

@mholt
Copy link

mholt commented Jan 17, 2025

/v2 is a different module than the original v1, since the module path is different. The module path needs to be updated on the Caddy website to support v2.

@jptosso
Copy link
Member

jptosso commented Jan 17, 2025

I guess it's done

Image

Image

> docker run caddy:2.9-builder xcaddy build --with github.com/corazawaf/coraza-caddy/v2
2025/01/17 16:30:55 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /usr/bin/caddy -ldflags -w -s -trimpath -tags nobadger,nomysql,nopgx 
2025/01/17 16:31:07 [INFO] Build complete: ./caddy
2025/01/17 16:31:07 [INFO] Skipping cleanup as requested; leaving folder intact: /tmp/buildenv_2025-01-17-1630.3860700284
2025/01/17 16:31:07 [INFO] Setting capabilities (requires admin privileges): [setcap cap_net_bind_service=+ep ./caddy]

././caddy version
v2.9.1 h1:OEYiZ7DbCzAWVb6TNEkjRcSCRGHVoZsJinoDR/n9oaY=

@skrlance
Copy link
Author

I guess it's done

Image

Image

docker run caddy:2.9-builder xcaddy build --with github.com/corazawaf/coraza-caddy/v2
2025/01/17 16:30:55 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /usr/bin/caddy -ldflags -w -s -trimpath -tags nobadger,nomysql,nopgx
2025/01/17 16:31:07 [INFO] Build complete: ./caddy
2025/01/17 16:31:07 [INFO] Skipping cleanup as requested; leaving folder intact: /tmp/buildenv_2025-01-17-1630.3860700284
2025/01/17 16:31:07 [INFO] Setting capabilities (requires admin privileges): [setcap cap_net_bind_service=+ep ./caddy]

././caddy version
v2.9.1 h1:OEYiZ7DbCzAWVb6TNEkjRcSCRGHVoZsJinoDR/n9oaY=

When we have version 2.0.0 stable available why leave the place to keep up on v1.2.2? It would be good if it could just update to v2.0.0 by:

caddy add-package github.com/corazawaf/coraza-caddy

instead of:

caddy add-package github.com/corazawaf/coraza-caddy/v2

We don't need v1.2.2 when we have v2 stable available!

@jptosso
Copy link
Member

jptosso commented Jan 18, 2025

That's by design through go versioning. You have to specify v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants