Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support SSL on AWS-based buttonmen sites #2712

Merged
merged 1 commit into from
Apr 7, 2021

Conversation

cgolubi1
Copy link
Contributor

@cgolubi1 cgolubi1 commented Apr 3, 2021

@cgolubi1 cgolubi1 changed the title Configure certbot on all AWS BM sites which have an 'fqdn' instance tag Support SSL on AWS-based buttonmen sites Apr 3, 2021
@cgolubi1
Copy link
Contributor Author

cgolubi1 commented Apr 3, 2021

I put a dev site up at https://makeshift.dev.buttonweavers.com/ui/

The only thing that's complicated about this is that in order to configure LetsEncrypt/certbot, you need to know the public FQDN of the site, because that's what LetsEncrypt is going to use to reach out and verify the cert it's providing, not to mention that the FQDN is tied to the provided cert. That caused two problems:

  1. Not all sites have a public FQDN (e.g. local sandboxes, replay sites that i only access via IP, etc), and those don't need HTTPS, but they need to not break
  2. Even sites that have a public FQDN don't typically know what it is, and we don't have reverse DNS for dev sites, so they can't easily look it up

I opted to solve this by putting the FQDN in an EC2 instance tag, for sites that have one that we care about (dev sites, staging, prod). I'll add this tag one-time for staging and prod, and i updated my existing dev site tagging utility script to add it for dev sites. If that tag can be found, we have certbot use it, and we're off to the races. If not, we use the dummy sandbox.buttonweavers.com name, and don't try to configure certbot.

I tested this on virtualbox, and on the aforementioned dev site, and it worked on both.

The only thing that's a little irritating is that it takes a few minutes for instance tags to become consistent and thus queryable by a new instance, so typically a new dev site doesn't get its fqdn the first time. That's not a big deal --- with the current setup, provisioning succeeds (it just doesn't setup SSL), and rerunning vagrant provision will make the right thing happen without intervention. So i'm not going to worry about that.

Folks should check out the dev site and see if anything behaves badly/oddly. It should work just fine both at https:// and at http://

@blackshadowshade
Copy link
Contributor

I've taken a look at this. I can play a move on the https site, view a discussion thread, log out, and log back in---all pages remaining as https://...

Similarly, when I log in under http, everything remains http and is responsive.

I'm happy to try this out.

@jl8e
Copy link
Contributor

jl8e commented Apr 19, 2021

If I go to buttonweavers.com, not www.buttonweavers.com, I get a certificate mismatch.

@blackshadowshade
Copy link
Contributor

Maybe this should be linked to #1097, which deals with somewhat similar issues.

@cgolubi1 cgolubi1 deleted the 224_lets_encrypt branch January 4, 2022 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

access to the site should use SSL
3 participants