Setup Firebase deep link when using Akamai CDN with a CNAME - firebase

How do I validate the Firebase TXT token for my website to configure deep linking for an app, when my site is using Akamai Content Delivery Network (CDN) that has an existing CNAME record. How can I achieve deep linking?
I checked and found CNAME and TXT records cannot co-exist. Also, for a domain there can be only one CNAME record. I want to use Firebase for enabling deep linking on my website for a mobile app. I am already using CDN for that site.

Related

How to add a subdomain using Firebase and Namecheap?

I am trying to add a subdomain for my firebase app but it is not working. I've looked at Firebase site's Subdomain setup and this other SO post How do I make a custom subdomain on Firebase? but they didn't really help me.
I have a firebase app that is currently running: myawesomesite.com. I have another firebase app that I want to create the subdomain for awesome.myawesomesite.com.
I own the domain name myawesomesite.com via Namecheap. myawesomesite.com has been up for over a year.
Here is what it looks like on Firebase Hosting for the awesome app:
It has been showing "Needs setup" for the past 4 days.
Went I went through "Add custom domain", Firebase verified myawesomesite.com domain. Then I told Firebase that I wanted awesome.myawesomesite.com. Firebase then gave me two A Record values:
I also noticed that the A Record values for my subdomain request (awesome.myawesomesite.com), 123.456.7.890, are exactly the same A Record values for my domain myawesomesite.com.
This is what it looks like on my Namecheap dashboard:
I am pretty sure I did something wrong because Firebase give the same A Record values for both my domain (myawesomesite.com) and my subdomain (awesome.myawesomesite.com). I expected them to have different values. But Firebase gave me those values when I'm on my awesome project requesting for "Add custom domain". It has been 4 days and awesome.myawesomesite.com hasn't been active yet.
How can I correctly add a subdomain awesome.myawesomesite.com using namecheap and firebase hosting? Is this even possible on Firebase in 2021?
I had the same task at hand and proceeded as follows:
In Firebase console, click to add a new custom domain to your hosting project and enter the subdomain with main-domain. E.g. 'sub.domain.com'.
Copy the value ("google-site-verification=something").
In Namecheap, go to the advanced DNS menu and add a new TXT record.
Host*: #
Value: google-site-verification=something
Save and wait for 5~15 minutes.
Back in Firebase Hosting, click to verify your domain. (If not ready yet, try again until verified).
After this, Firebase gave me one A record. Not two as normally stated in the docs! Might be because it is the year 2023, or because it is a subdomain, or both.
Enter this record in Namecheap.
Host: the subdomain name you want to use (e.g. sub)
Value: the address Firebase gave you (e.g. 111.222.333.444).
I did not(!) delete any other A or AAAA record as stated in the docs or the Firebase console.
Save and wait for 1~24 hours. Your subdomain should now be verified and activated.
*I usually saw docs and help desk entries that state, that for a subdomain, the TXT record's Host value should include the subdomain (e.g. only "sub", or "sub.domain.com", etc.), but that didn't work for me, so I changed it to "#" and got verified shortly after.

Using Microsoft nameservers, Google Domains, and Firebase hosting

I have a client who is using Office 365 for email and has changed the nameservers on Google Domains to point to Microsoft nameservers (ns1.bdm.microsoftonline.com, etc), so he can utilize the #domainname.com email extension (and other Office products). Unfortunately, this is messing with my normal groove on how to link my Firebase React projects with Google Domains via adding resource values (i.e. # A record with a value of 111.111.1.111) because as Google warns me right there:
It looks like you've changed your name servers. All settings for your domain (including website, email, synthetic records and resource records) are currently disabled. To enable these settings, you will need to restore the Google Domains name servers.
I can't restore these nameservers to Google, because it will mess/disable his emails. So what to do? I have exhausted my Google searches for an answer, and unsure of what direction to look for an answer. How do I link up my app with Firebase hosting with my Google Domain's domain while still maintaining Office 365 #domainname.com email extension for my client? Maybe I need to add the records on Microsoft's side? Do I need him to transition to GSuite? I'd prefer not to tell him he needs to, but maybe that's the only solution!
It's a bit misleading. The domain is with Google Domains, and Google is saying "All settings for your domain that you might expect us to manage via Google Domains" are disabled - meaning you can't manage them in Google Domains. Instead, they have to be managed in Office 365 (or wherever the nameservers are).
You can get the ip addresses Firebase gives you, send them to your client, and instruct them to update the domain's main A record and www A record (or CNAME) to point to the Firebase ip addresses.
Everything will work just fine - it's just Google telling you that it no longer manages the DNS for the domain.

Static website I am hosting cannot be reached and the server IP cannot be found

I recently used Google Domains to register a domain and have connected it to Google Cloud Console to manage a static website. I followed the Google Codelabs guide to set it up and faced no issues. However, when refreshing my website, it still doesn't load and my browser (Chrome) gives me the following error message:
This site can’t be reached
carbonfootprint.dev’s server IP address could not be found."
As well, going to www.carbonfootprint.dev gives me another error message:
Your connection is not private
Attackers might be trying to steal your information from www.carbonfootprint.dev (for example, passwords, messages, or credit cards).
NET::ERR_CERT_COMMON_NAME_INVALID
...Which is confusing, because I was under the impression that a .dev domain suffix gives SSL certification by default.
However, in my Google Domains settings, the website content appears as it should in the minimized preview that exists in both the Domain Overview panel and Website panel. It has been over 48 hours, so it should have updated by now if it were just a delay issue.
For reference, this is what my Custom resource records look like, this is what my synthetic records look like, and these are my bucket details in Google Cloud Console. As well, here is a preview of the website, as shown in the Google Domains console.
Any help is much appreciated!
Ended up finding the answer thanks to #IshRaj on ServerFault.
For future reference to anyone else viewing, Google Cloud Storage only supports HTTP connections when hosting a static website through CNAME resource records. To serve content through a custom domain over SSL, you will need to either:
Set up an external HTTPS load balancer (instructions here),
potentially with Google Cloud CDN (set-up documentation here)
Connect a third-party Content Delivery Network to your Google Cloud
Storage (guide here)
Host your static website on Google App Engine with Python (guide
here)
Serve static website content through Google Firebase rather than
Google Cloud Platform (tutorial here/additional support)
Personally, I went with Google Firebase (the last option), which automatically upgrades websites to https. It was simple and quick to set up and content is now directly deployable from my files. As well, with Firestore's automatic scalability and powerful queries, Firebase becomes a viable alternative, especially with its other features (user authentication, realtime data synchronization, machine-learning, extensions).

Where to find DNS A records information in Firebase Hosting for a previously connected custom domain?

When you add a custom domain in Firebae Hosting, at the end of the process you see two DNS A records that you should add to your DNS configuration.
https://firebase.google.com/docs/hosting/custom-domain#go-live
QUESTION
But after you're done with the process of adding the new custom domain, where in the Firebase Console can you find the information about those DNS A records again?
I didn't find it in the Firebase Hosting section nor in my Project Settings.
I haven't seen anything within the Firebase console that shows the record information, but the A records are outlined in their per-provider docs lower in the documentation you provided:
https://firebase.google.com/docs/hosting/custom-domain#dns-records-cloudfare
I just found out that if the DNS A records have already been detected by Firebase, they will no longer be accessible from the Firebase Console.
But if the records haven't been detected by Firebase yet, you be able to see them by clicking on your custom domain on your console's Firebase Hosting section. It will be marked with "View Setup" or something like that (don't remember the exact phrase).
If it's marked as "pending", it's because the records have already been detected and it's waiting for propagation across the DNS network.
It it's marked as "conected", it's because it's already up an running.

Setting up HTTPS for a Google Cloud instance?

I recently purchased a domain with Google Domains and linked it with Google Cloud - specifically Compute Engine. My website is up and running but I noticed that the connection is not secure, and I'm not sure why. Another domain that I set up with Google Firebase was automatically made secure (https by default, right when I set it up), but the new domain that I purchased is not. I have tried to search around on ways to make the domain secure but I have had no luck.

Resources