dulli / caddy-wol

Caddy plugin that sends wake-on-lan magic packets to remote hosts to wake up e.g. reverse proxy targets.
Apache License 2.0
27 stars 5 forks source link

Crash when starting the server #26

Open ydemartino opened 6 months ago

ydemartino commented 6 months ago

Hi,

I'm very interested in your module, but I'm getting a crash when starting the server:

{"level":"info","ts":1713386974.230629,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
{"level":"info","ts":1713386974.2570424,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
{"level":"info","ts":1713386974.2582517,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0x40005fb180"}
{"level":"info","ts":1713386974.258622,"logger":"http.auto_https","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
{"level":"info","ts":1713386974.2587116,"logger":"http.auto_https","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x10b7920]

I'm using the following Docker file

FROM caddy:builder-alpine AS builder

RUN xcaddy build \
    --with github.com/dulli/caddy-wol

FROM caddy:alpine

COPY --from=builder /usr/bin/caddy /usr/bin/caddy

Any idea how I can fix this? Thanks

dulli commented 2 months ago

Hi! Sorry for the late reply! I just updated and tidied up the go.mod file, could you check if this helped already?