sasa1977 / site_encrypt

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

Add support for Bandit web server #45

Closed axelson closed 1 year ago

axelson commented 1 year ago

Adds SiteEncrypt.Phoenix.configure_https_bandit/2 to allow the ability to easily run SiteEncrypt with the Bandit web server (https://github.com/mtrudel/bandit/)

axelson commented 1 year ago
  1. Optional requirement for the bandit version in mix.exs

Added in c5fc376e0159e820612f3c25921563ce0467a5d0

  1. A test proving that this works

Do you have any guidance about what type of format this test should take? i.e. unit test of configure_https/2, a new bandit-powered phoenix application in demos, or something else.

sasa1977 commented 1 year ago

Do you have any guidance about what type of format this test should take? i.e. unit test of configure_https/2, a new bandit-powered phoenix application in demos, or something else.

I'll try to look into this, but can't commit on time.

sasa1977 commented 1 year ago

This took me down the rabbit hole, because after 2 years of not touching anything, the CI broke because of various issues. I had to upgrade the base stack (Erlang/Elixir/deps) on master, and then fix some issues. I merged the new master back to this branch and expanded the tests to include bandit. These tests start the actual endpoint, so I think this proves that the stuff is working correctly. Regardless, could you please verify that a bandit powered site actually works now?

axelson commented 1 year ago

@sasa1977 Thank you! CI failures are definitely an annoying rabbit hole!

I am pleased to confirm that the latest commit from this branch is successfully running in "prod" (i.e. my hobby sites):

https://github.com/axelson/vps/pull/2

axelson commented 1 year ago

@sasa1977 is there anything that is blocking this from being merged now? Phoenix 1.7 and MainProxy 0.3.0 are now released and it would be nice to be able to use SiteEncrypt with Bandit.

sasa1977 commented 1 year ago

Sorry for not merging sooner. It was a busy time and I completely forgotten about this :( It's been awhile since I've last released, so I need to go through the commits and assemble a changelog. I'll try to publish to hex during the weekend.

Note that Phoenix 1.6 and 1.7 are not officially supported. If they are working it's by chance :-) But to be certain that everything works, we'd need to upgrade the deps and ensure that all the tests are passing. This isn't required for the immediate hex publish, but it's something that should be done going forward. Pull requests are welcome :-)

axelson commented 1 year ago

No worries! I've waited significantly longer to merge PRs on some of the projects I help maintain :smile:

Note that Phoenix 1.6 and 1.7 are not officially supported. If they are working it's by chance :-) But to be certain that everything works, we'd need to upgrade the deps and ensure that all the tests are passing.

I've created https://github.com/sasa1977/site_encrypt/pull/46 to update the deps and all the tests pass, although I didn't run the docker tests but they appear to have succeeded on the PR at least.

sasa1977 commented 1 year ago

FYI I've pushed 0.5.0 to hex