sasa1977 / site_encrypt

Integrated certification via Let's encrypt for Elixir-powered sites
MIT License
470 stars 34 forks source link

Support for coordinating between multiple nodes #50

Open ShahneRodgers opened 1 year ago

ShahneRodgers commented 1 year ago

Firstly, thanks for the library and the comprehensive article about it!

With regard to:

It could also support coordination between multiple nodes, making it possible to implement a distributed certification, where an arbitrary node in the cluster initiates the certification, while any other node can successfully respond to the challenge, including even the nodes which came online after the challenge has been started.

is there any plan to do this, or is it outside of the scope of what you'd like the library to do?

If it is within scope, one approach would be to add optional callbacks whenever a new challenge is registered or invoked (eg via SiteEncrypt.Registry.register_challenge / get_challenge) and then a calling library could support clustering by propagating that to the other nodes and re-calling those functions on the receiving nodes. I'm happy to put up a PR if that sort of approach seems reasonable to you?

Thanks!

sasa1977 commented 1 year ago

Sorry for the super-late reply. This is currently out of scope, because I don't have the capacity to think it through, or assist in the development process. If you want to experiment with it, I'm open to take a look at what you can come up with. However, I can't guarantee that it will be merged, and I can't offer you any help in the process, due to the lack of available time.

ShahneRodgers commented 1 year ago

No worries at all - I've pushed a branch to my fork that contains what I think is the minimal changes required to let people work with clustering, but I'm not sure it's the best way, so perhaps it can just stay there until I've tested it more or someone else wants the functionality.