2. Cloudflare account & login¶
Cloudflare is the company that will host the app, run its database, and guard sign-in. Everything here fits in their free tier.
Create (or sign in to) a Cloudflare account¶
- Go to https://dash.cloudflare.com/sign-up.
- Sign up with a work email and a strong password, or sign in if TOTLCOM already has an account.
- Verify your email if prompted.
Use a shared/admin account
Because this hosts a company app, use an account the right people at TOTLCOM can access — not a personal one tied to a single individual.
Add the totlcom.com domain (if it isn't already there)¶
The app uses oncall.totlcom.com, so Cloudflare needs to manage DNS for totlcom.com. This may already be done. To check, look at the Cloudflare dashboard home page — if totlcom.com is listed, you're set; skip to the next page's later steps as needed.
If totlcom.com is not there:
- In the dashboard, click Add a site (or Add a domain).
- Type
totlcom.comand follow the wizard. - Cloudflare gives you two nameservers. Whoever manages TOTLCOM's domain registrar must set the domain's nameservers to those values.
- Wait for Cloudflare to show the domain as Active (can take minutes to a day).
Warning
Changing nameservers affects all of totlcom.com (email, website, everything). If totlcom.com already works elsewhere, coordinate with whoever runs it before changing nameservers. If the domain is already on Cloudflare, you don't need to touch this at all.
Log the command-line tool into Cloudflare¶
Some steps (creating the database, applying migrations) run from your terminal and need to be logged in. In the oncall-scheduler folder, run:
This opens your web browser and asks you to Allow Wrangler to access your Cloudflare account. Click Allow. When the browser says it succeeded, return to the terminal.
Confirm it worked:
You should see your Cloudflare account email and account ID.
Which commands need login?
Anything that touches your live Cloudflare account: creating the D1 database, applying migrations to the remote database, and (optionally) setting secrets. Building the app locally does not need login.