tutorbookapp / old-tutorbook

Source available code for Tutorbook's progressive web app (PWA).
https://tutorbook.app
Other
13 stars 10 forks source link

Add dynamic DNS to automatically create app subdomains #254

Closed nicholaschiang closed 4 years ago

nicholaschiang commented 4 years ago

Right now, I've been manually adding DNS records to our Netlify domain whenever we have a new school. All of those DNS records point to the same two IP addresses (Google's Firebase Hosting IPs).

Our existing setup on Netlify DNS:

image

We want to automatically create those DNS records (or do something similar) to support an interface that enables the school to choose a subdomain name (e.g. https://gunn.tutorbook.app for Gunn High School's landing page) for their virtual student support landing page.

nicholaschiang commented 4 years ago

@gfalqui This is what I was talking about for our dynamic DNS problem.

rdelcampog commented 4 years ago

@nicholaschiang @gfalqui Amazon AWS Route53 DNS Service can handle wildcard domains. Maybe you can delegate a subdomain zone to AWS like school.tutorbook.app (If you dont want to use Route53 as principal DNS management service) and create a wildcard record "*.school.tutorbook.app" pointing to Google Firebase Hosting IPs.

Once this is done, you just need to script the Firebase hosting creation and you're done.

EDIT: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DomainNameFormat.html#domain-name-format-asterisk

nicholaschiang commented 4 years ago

@rdelcampog That seems like an awesome solution!

rdelcampog commented 4 years ago

@rdelcampog That seems like an awesome solution!

Nice! Let me know if you need help setting things up.

abdennour commented 4 years ago

Aslo if you are running in Kubernetes, you just need to link the wildcard DNS recordset with the loadbalancer of the Ingress controller (Alias A Record)

nicholaschiang commented 4 years ago

Ok, I just transferred all of our existing DNS records over to Route 53 and changed tutorbook.app's Namecheap configuration.

Now I'm going to work on updating the way that we grab each website's configuration document (e.g. the document denoted by window.app.id which points to a Firestore document within the websites collection).

After that's finished, all we'll have to do is add that wildcard record @rdelcampog!

nicholaschiang commented 4 years ago

@rdelcampog If you could help out over at #255 that would be great!