pteich / caddy-tlsconsul

🔒 Consul K/V storage for Caddy Web Server / Certmagic TLS data
Apache License 2.0
96 stars 17 forks source link

Implement certmagic.Storage to be used as Caddy cluster plugin #4

Closed pteich closed 5 years ago

pteich commented 5 years ago

This change is more or less a complete rewrite and implements the new certmagic.Storage interface. With this it can be used as an offical Caddy cluster plugin.

mholt commented 5 years ago

Awesome, that was quick. A little too quick, haha.

The storage interface is probably changing slightly, to just Lock instead of TryLock. It will work a little more like a distributed mutex in that sense. It should simplify your job and reduce some logic. I'm mobile right now but feel free to have a look at the only open PR on certmagic.

So, unfortunately, I think some changes will be needed soon but mostly small changes, and then we'll lock it in as soon as the next version of Caddy is released. We just want to get it right as soon as possible. :)

pteich commented 5 years ago

No prob @mholt . I'll hold my horses until you finish https://github.com/mholt/certmagic/pull/7 - in the meantime I follow your discussion there :D Just a Lock() / Unlock() makes my case indeed easier because this is exactly like Consul's distributed locks work out-of-the-box.

mholt commented 5 years ago

K, we're done -- have at it!

pteich commented 5 years ago

Thanks @mholt - I'm done too. 😄Should work now with your updated interface (at least my tests pass).

mholt commented 5 years ago

Cool! I don't foresee any major changes to that interface so I think we're good here.