Domains & SSL
Put the panels and the landing page on your own domains with HTTPS, then tell Firebase and Google about the new addresses.
After deploying, your websites work on addresses such as your-project-id.web.app. Now give them your own names. A common layout:
| Website | Example address |
|---|---|
| Landing page (privacy policy, terms) | https://www.yourdomain.com |
| Admin panel | https://admin.yourdomain.com |
| Dispatcher panel | https://dispatch.yourdomain.com |
1. Point the domains#
Add the custom domain#
Open Firebase consoleHosting. Each site you created has its own card. On the admin site's card click Add custom domain and type admin.yourdomain.com.
Add the DNS records Firebase shows#
Firebase shows one or two records (usually a TXT record to prove you own the domain, and A records that point the name at Firebase). Sign in at your domain provider (GoDaddy, Namecheap, Cloudflare, Hostinger…), open the DNS settings of your domain and add each record exactly as shown.
Type: TXT Host: admin Value: hosting-site=your-project-id
Type: A Host: admin Value: (the IP address Firebase shows)
The values above are examples; always copy the ones Firebase shows you.
Wait for "Connected"#
Back in Firebase click Verify. DNS changes take from a few minutes to a few hours. When the status says Connected, Firebase issues a free SSL certificate by itself; the padlock can take up to a day to appear the first time.
Repeat for the other sites#
Add dispatch.yourdomain.com on the dispatcher site's card and www.yourdomain.com (and, if you like, the bare yourdomain.com) on the landing page site's card.
Using Cloudflare?
Set the records Firebase gives you to DNS only (grey cloud) until Firebase says Connected. With the orange cloud on, Firebase cannot check the domain or issue the certificate.
Point each name at the server#
At your domain provider, add an A record for each subdomain, pointing to your server's IP address:
Type: A Host: admin Value: 203.0.113.10
Type: A Host: dispatch Value: 203.0.113.10
Type: A Host: www Value: 203.0.113.10
Get free certificates#
With Nginx and Certbot:
sudo certbot --nginx -d admin.yourdomain.com -d dispatch.yourdomain.com -d www.yourdomain.com
Use --apache for Apache. Certbot renews the certificates by itself.
Create the subdomains#
Open cPanelDomains (or Subdomains on older versions) and create admin and dispatch. Upload each panel's files and its .htaccess to the new document root, as in Deploy the panels.
Turn on SSL#
Open cPanelSecuritySSL/TLS Status and click Run AutoSSL. Then turn on "Force HTTPS redirect" for each domain in Domains.
HTTPS is required
Browsers allow notifications only on https:// pages (and on localhost while testing). Without HTTPS, the admin panel cannot receive new-ticket, document and SOS alerts. Always open the panels with https://.
2. Tell Firebase and Google#
A new address is a new "origin" for Firebase and Google. Add it in these places.
Firebase Authentication: Authorized domains#
Open Firebase consoleAuthenticationSettingsAuthorized domains and click Add domain for each panel domain (admin.yourdomain.com, dispatch.yourdomain.com). Firebase only allows its sign-in screens and links to work on domains in this list. Your web.app and firebaseapp.com addresses are already there.
Google Maps key (only if you restricted it to websites)#
If you limited your Google Maps key to certain websites in the Google Cloud console, add the new panel addresses, for example https://admin.yourdomain.com/* and https://dispatch.yourdomain.com/*. The admin panel loads Google Maps with the key from SettingsMap Settings; see Map settings › Protect the key.
Storage CORS (only if you limited it)#
The CORS setting from Verify & Storage CORS uses "origin": ["*"], which allows every website to show your pictures. If you changed it to list only your own domains, add the new ones and apply it again, for example:
[{
"origin": ["https://admin.yourdomain.com", "https://dispatch.yourdomain.com", "https://www.yourdomain.com"],
"method": ["GET"],
"maxAgeSeconds": 3600,
"responseHeader": ["Content-Type"]
}]
gsutil cors set cors-config.json gs://YOUR_BUCKET_NAME
A domain missing here shows as blank pictures in the panels or on the landing page.
App store listings#
Use your new landing page address as the privacy policy URL in Google Play Console and App Store Connect: https://www.yourdomain.com/privacy-policy.html (and ?type=driver for the driver app). See The landing page.
3. Check every website#
- Each website opens on
https://with a padlock, andhttp://moves tohttps://. - Open a deeper page such as
admin.yourdomain.com/dashboardand press F5. It reloads, with no 404. - You can sign in to the admin panel and to the dispatcher panel on the new domains.
- Logos, vehicle pictures and driver documents show in the panels.
- Zones show a map in the admin panel, and address search works in the dispatcher panel.
- The admin panel asks to allow notifications, and the bell receives a test alert (see Push keys & templates).
- The landing page shows your logo and texts, and the privacy policy and terms open.
- The favicons, names and logos are yours (see Prepare & build).
Blank page or old version?
A blank page or a 404 on refresh is a missing rewrite rule (see Deploy the panels). An old version is the browser cache: press Ctrl+Shift+R (Cmd+Shift+R on a Mac), and purge your host's CDN cache if you use one.