Gr33nbl00d / caddy-revocation-validator

Certificate Revocation check support for caddy
MIT License
19 stars 5 forks source link

Live-reloading config via Admin API fails due to the "one `work_dir` per HTTP server" rule #17

Open vikanezrimaya opened 1 month ago

vikanezrimaya commented 1 month ago

Repro for Caddy v2.8.4 and this module v1.0.5:

$ CADDY_ADMIN="localhost:2019" caddy run &

$ curl -d@config.json -H "Content-Type: application/json" http://localhost:2019/config/
{"error":"loading new config: loading http app module: provision http: server srv0: setting up TLS connection policies: loading client cert verifiers: position 0: loading module 'revocation': provision tls.client_auth.verifier.revocation: The same work dir ./crl was defined for multiple servers"}
Gr33nbl00d commented 1 month ago

Hm interesting. I will have a look at it on Monday. Might be a timing issue

Gr33nbl00d commented 1 month ago

A first code analysis did not reveal any issue. In theorie the cleanup should be called before another provision. I will try to debug this in the next days. How many servers did you have configured ? Only 1?

vikanezrimaya commented 1 month ago

How many servers did you have configured ? Only 1?

Yes, that's only one server. I can try making a minimal config for reproduction.

Gr33nbl00d commented 1 month ago

How many servers did you have configured ? Only 1? Yes, that's only one server. I can try making a minimal config for reproduction.

yeah a minimal config could help. Currently i try to reproduce it and i already got a problem related to opening ports during reloading: Not related to revocation in general. I wonder if the provision/cleanup of modules in caddy is broken.

Which operating system are you on?

Gr33nbl00d commented 1 month ago

Should be fixed. i am currently doing some code cleanup in a feature branch. I fixed it there.

I would like to do some more extensive testing before merging it to master, because it was quite a big change needed. Maybe you can try to build with the feature branch?

https://github.com/Gr33nbl00d/caddy-revocation-validator/tree/fb-codecleanup