EastCoastGreenwayAlliance / ecg-map

Interactive map and trip planner for the ECGA
https://map.greenway.org
7 stars 0 forks source link

Custom Subdomain with HTTP to HTTPS Redirect #48

Closed danrademacher closed 7 years ago

danrademacher commented 7 years ago

On the Heroku app, we need to force redirect all traffic to HTTPS for location services to work.

@gregallensworth did you figure this out for caliparks.org with something we can reuse here?

gregallensworth commented 7 years ago

It was pretty fussy and did take a few hours, all told.

clhenrick commented 7 years ago

In this case we'll probably want the site to forward to a subdomain such as map.greenway.org but need to check with the client

clhenrick commented 7 years ago

Implemented enforcement of HTTPS server side using the express-sslify module, which is currently working without the custom domain name.

clhenrick commented 7 years ago

Per discussion with @gregallensworth today looks like we'll have SSL through Let's Encrypt, so now it's a matter of pointing map.greenway.org away from WikiMapping and instead to Heroku.

First step is adding the subdomain, via the Heroku CLI

heroku domains:add map.greenway.org

Then it's a matter of setting up a CNAME record with ECGA's DNS provider, explained here: https://devcenter.heroku.com/articles/custom-domains#configuring-dns-for-subdomains

clhenrick commented 7 years ago

updated above with some corrections

clhenrick commented 7 years ago

CNAME record should be:

map map.greenway.org.herokudns.com.

note the trailing "." may or may not be required depending on the DNS provider

clhenrick commented 7 years ago

@danrademacher reassigned this to you so that we can work with @nilesbarnes to set up the custom subdomain with Heroku and ECGA's DNS.

@nilesbarnes let us know if you'd like help with setting up the custom domain.

nilesbarnes commented 7 years ago

Thanks @clhenrick I will likely need help setting this up/providing the info necessary.

danrademacher commented 7 years ago

@nilesbarnes, probably easiest if I connect directly with the person who manages your domain name assignments. IT or webmaster/manager usually.

nilesbarnes commented 7 years ago

@stevespindler Could you help us on this?

@danrademacher We have another person who may also be able to help us if Steve isn't able to. Since Steve manages Wikimapping wanted to check with him first.

danrademacher commented 7 years ago

@nilesbarnes usually this would be done by whoever "owns" domain name management for your overall greenway.org site. So the person who made Greenway.org point way from your old site and toward the new Punk'd Ave site could also repoint map.greenway.org away from Wikimapping and toward the new app. This is also where IT or sysadmin types set up how a domain handles email or other uses of your domain.

@stevespindler might have insight on who did that or where last time, or maybe his role is broader than WikiMapping, but the owner of a current subdomain doesn't necessarily have access to the overall DNS.

clhenrick commented 7 years ago

Second what @danrademacher has said.

@nilesbarnes do you know who handled the redirect of greenway.org to the new site once it was finished? That person would probably handle the map.greenway.org redirect or at least have the keys to do so.

danrademacher commented 7 years ago

@clhenrick, Niles's team is working on the DNS change for this coming Monday. As far as I can tell, we did the Heroku CLI command as you described here: https://github.com/EastCoastGreenwayAlliance/ecg-map/issues/48#issuecomment-315862743

Can you confirm that's working as expected?

In the settings, it all looks solid: image

But then when I go to http://map.greenway.org.herokudns.com, I get "No such App": image

I would expect to see the map load there or redirect, etc. Maybe we still need to do something with SSL?

nilesbarnes commented 7 years ago

@danrademacher We have our team standing by ready to help on Monday.

clhenrick commented 7 years ago

Looks like map.greenway.org is still pointing to the WikiMapping site. Was the CNAME record created in ECGA's DNS?

nilesbarnes commented 7 years ago

@clhenrick @danrademacher Nothing has been done on our end yet to begin having the new tool pointing to map.greenway.org. Dan was going to do a a new data upload on Friday. Is there anything we need folks to do on our end now to have the shift start on Monday? Or can they start the process on Monday. Goal is to launch to public on Thursday 8/17. Just want to be clear on who needs to be doing what, when.

danrademacher commented 7 years ago

Just checked in with Chris on this -- sounds like this is all as expected and once you all make the CNAME change on monday, it should "just work." I would recommend that you make that change just after 12 pm Eastern on Monday, just so it's during business hours here and we'll be on deck if anything needs to be adjusted quickly in our Heroku settings.

clhenrick commented 7 years ago

Also noting that after making the CNAME record in your DNS it may take some time to propagate, could be a couple minutes or a whole day, depends on your DNS provider. I think for most DNS providers now a days it should happen sooner then later.

You'll want to make sure that any record pointing map.greenway.org to the old WikiMapping site is removed as well. That may also be a CNAME record but could have been set up differently.

danrademacher commented 7 years ago

Looks like the DNS might be in place now but HTTPS is having some issue:

image

I just enabled Automated Certificate Management here: image

Maybe that takes a bit to propagate. Will check again in a half hour

nilesbarnes commented 7 years ago

Now working on my end.

danrademacher commented 7 years ago

Confirmed!

screen shot 2017-08-14 at 9 59 35 am