brendandburns / caddy-wasm

WebAssembly (WASM) extension for the caddy2 web server.
MIT License
10 stars 0 forks source link

upgrade to caddy v2.8.4 and can then add package without xcaddy #2

Closed gedw99 closed 6 days ago

gedw99 commented 3 weeks ago

easier way to add modules in https://github.com/caddyserver/caddy/releases/tag/v2.8.4 than caddy.

It's experimental but I found it works well on many caddy modules so far. Its been very robust.


caddy-run-package-add:
    $(CADDY_RUN_CMD) add-package -h
    #$(CADDY_RUN_CMD) add-package github.com/Odyssey346/ListenCaddy
    #$(CADDY_RUN_CMD) add-package github.com/abiosoft/caddy-exec
    $(CADDY_RUN_CMD) add-package github.com/greenpau/caddy-git
caddy-run-package-del:
    $(CADDY_RUN_CMD) remove-package github.com/Odyssey346/ListenCaddy
    $(CADDY_RUN_CMD) remove-package github.com/abiosoft/caddy-exec
caddy-run-package-ls:
    $(CADDY_RUN_CMD) list-modules --packages
brendandburns commented 3 weeks ago

I'm happy to take a PR to upgrade the version of caddy that we are using.

brendandburns commented 3 weeks ago

I looked into this somewhat, it looks like you have to register your plugin with them somehow and I couldn't find docs about how to do that. If you have pointers to docs, I'm happy to pursue this option.

gedw99 commented 6 days ago

I looked into this somewhat, it looks like you have to register your plugin with them somehow and I couldn't find docs about how to do that. If you have pointers to docs, I'm happy to pursue this option.

your 100% right..

I am guessing they do a git pull on their server, then xcaddy it on the sever and return it back up to your laptop.

I was advised by them to not do it actually. So going to go with the flow on this one.

Just to get work done I generally just import and compile, so I have easier time with version management:

package main

import (
    caddycmd "github.com/caddyserver/caddy/v2/cmd"

    // plug in Caddy modules here
    _ "github.com/caddyserver/caddy/v2/modules/standard"

    _ "github.com/darkweak/souin"
    _ "github.com/darkweak/souin/plugins/caddy"
    _ "github.com/darkweak/storages/nats/caddy"
)

func main() {
    caddycmd.Main()
}

Reckon we should close this ?