Firebase SSL and Subdomains - firebase

So I was using Google cloud buckets to host my site, I figured out SSL Is impossible doing that so I tried app engine and that just got really complicated really fast so I tried firebase and it seems the best, however I have my main site (https://example.com) and my development build of the site with an auth login for me and my devs (https://staging.example.com). I have 2 different firebase projects one for the main site and another for the subdomain, however I first connected the subdomain one and it got an SSL cert and said connected in like 2 seconds, however I did the same for my main site and it's been stuck on pending all day now. I read somewhere that it can't do a subdomain and a normal site because of some SNI thing but if you can't enable SSL on a domain and a subdomain that's a pretty bad system imo. I use Google Domains for my domain and there are A records for the normal domain and subdomain pointing to firebase.
Thanks to anyone with any clarification.

Turns out I just had to wait for the certificate to be made, I was just confused as to why one domain took seconds to make it and the subdomain took almost a day so I thought something was wrong.

Related

Sneaky Way Around Firebase Hosting Wildcard Subdomain for Users

I want to let users sign-up for a sub-domain on my app's main domain. Unfortunately Firebase Hosting doesn't support wildcard subdomains (yet?), but I think I have an almost-automated way to do this.
I'll lay out my plan, but I'd really appreciate any feedback or improvements of how else I should solve this problem.
Steps:
Gather a user's intention to create a subdomain
Automate Firebase CLI to create another site, get DNS settings and add them into a Firestore doc (that I will then show the user)
Upload a simple HTML page with <object> and their site app.website/username
Cry because <objects> doesn't change the URL in the browser
Each user has a public profile on the main domain, like this: app.website/username, but I want to also host this page at username.app.website so they can point their domain (or subdomain) to their app.
Is there a way to do this efficiently?
From the documentation on connecting to Firebase Hosting:
Each custom domain is limited to having 20 subdomains per apex domain, due to SSL certificate minting limits.
So you can't have more than 20 subdomains. As long as you stay within that limit, you approach could work. But it won't allow you to go over the limit.

How to setup domain & its sub domain to different Firebase hosting projects

Suppose my domain is mydomain.com, and subdomain subdomain.mydomain.com. I got it from Godaddy.
What I want
I want to run different websites on each.
mydomain.com -> Website 1
subdomain.mydomain.com -> Website 2
How I setup so far
Website 1 is hosted on Firebase project 1 and accessible via default URL firebase-projectid.firebaseapp.com.
Website 2 is hosted on Firebase project 2 and accessible via default URL.
Both Firebase projects are on same Google account.
What I have done successfully so far
I started with mydomain.com -> Website 1
Verified domain by adding TXT record provided by Firebase project 1.
Added couple of A records to point domain to Firebase project 1 hosting.
So far so good, and mydomain.com is working fine.
What is not working
Now I want to host subdomain.mydomain.com -> Website 2 with Firebase project 2.
I started with custom subdomain, added subdomain.mydomain.com. Firebase had already verified domain and directly provided me ip address for A records. I added both A records on my domain registrar.
As far as I understand, these are only steps needed. But subdomain.mydomain.com is not working and Firebase still shows status of subdomain as Needs Setup.
Observations
Two things I observed seems strange to me.
IP address provided by Firebase for both projects mydomain.com and subdomain.mydomain.com are same. Not sure if this is normal or not.
subdomain.mydomain.com with A records, is not propagating when checked on https://dnschecker.org/. However, if subdomain is added via Godaddy Forwarding option, then it start propagating in few minutes.
Questions
BTW, is it really possible to host domain and its subdomain on Firebase running different websites?
If yes, then is there any other step which I am missing?
Any idea why subdomain.mydomain.com is not propagating. I checked just after 10 mins. May be I need to wait longer?
Anything wrong I am doing to setup subdomain.
I tried exploring other threads but couldn't understand what I am doing wrong. Any help will be appreciated.
After scratching my head for few more hours I found issue at Godaddy side. While adding subdomain A record, I was providing host as subdomain.mydomain.com, which was wrong.
Instead of subdomain.mydomain.com host should have been subdomain only. After updating host it started propagating in few seconds, and status on Firebase is Pending. After a minute, subdomain.mydomain.com is working fine.

Firebase custom domain, other hosting provider

So firebase seems cool! i would love to build my angular webapp and use firebase to host it. Pushing it to firebase with my terminal seems like a dream.
I bought my custom domain on Siteground.com
When starting out with firebase it asked me to change the DNS records on siteground to direct my custom domain to firebase.
Which i did and seems to be working correctly.
My question now is, do i still need my siteground.com hosting? Maybe a newb qeustion.
But i am seriously confused now.
Cause when i want to buy a domain mostly it comes together with a hosting plan like on siteground. I dont see an option on firebase to get custom domains with firebase hosting, thats why i am wondering how this all works together.
Thanks in advance,
There are typically two services that, together, make up "web hosting".
The first is a DNS Provider. Your DNS provider is what tells computers that try to load yourdomain.com that it needs to talk to a server at IP address X.X.X.X.
The second is a Web Host (e.g. Firebase Hosting). This is what actually serves up the content for your website from an IP address.
You'll need both for your domain to work correctly, but many providers offer both services together. Firebase Hosting is a web host, but it is not a DNS provider. Typically your domain registrar is also your DNS provider and provides DNS configuration for free when you purchase a domain.
Hope that helps!

Pointing domain and subdomain to the same firebase app

Custom domain is currently setup with A record pointing to the IP of the firebase AND wildcard CNAME record pointing to the same app.
dig +short mydomain.com
151.101.65.75
151.101.1.75
dig +short abc.mydomain.com
myapp.firebaseapp.com.
app-cert.firebaseapp.com.
151.101.65.75
151.101.1.75
The problem is that "abc.mydomain.com" is redirecting to "mydomain.com" with a 301 response.
Is the problem in how the domain is setup or on the firebase end?
EDIT reply from the firebase support is:
"Unfortunately, since you've already connected your domain mydomain.com your firebase app, all redirects will go through that URL. and not to your firebase app.
"
This reply is so confusing and makes no sense IMO.
Update 2020-03-30
For several years now it's actually been entirely possible to have a subdomain pointing to a different Firebase Hosting site than the apex domain. This answer has been out of date. Happy Hosting!
Firebase Hosting presently only allows one canonical domain for your project -- if you specified mydomain.com and then point abc.mydomain.com to Firebase Hosting, it will redirect, as you saw.
We're considering some improvements in this area for the future, but at present all non-canonical domains will redirect.

Openshift : getting rid of HTTP"S" for good

I wanted to get help on this issue of mine.
Openshift is using https by default on its free applications,
whereas Heroku is using http
Whenever a visitor visits my website, he is presented with an Unsecure Connection warning.
How can we get rid of this warning or https altogether once and for all.
I am fine with http alone as
I am not willing to upgrade to silver for SSL thing only.
Nor do i have an SSL cert with me, am not planning on buying one.
Any thoughts?
strange thing I am also deploying my applications on openshift and they all are on http server. What ate the cartridges you are using??
OpenShift does not use https by default, we allow both http & https for free accounts and paid accounts. it may be something in your framework that you are using that is causing the redirect to https, it could also be that you visited the app before it was completely setup, and got redirected to https://app-domain.rhcloud.com/app, and now your browser is stuck on the https redirect. Try clearing your cache, test with another browser, or check the framework you are using to make sure it's not redirecting to https.

Resources