Cloudflare Pages Setup for kb.costabile.com.au
Step-by-step deployment and authentication checklist for publishing this knowledge base to Cloudflare Pages.
Overview
The recommended deployment is:
GitHub repository -> Cloudflare Pages build -> kb.costabile.com.au -> Cloudflare Access login
This keeps the site static, fast, cheap, and secure.
Cloudflare Pages settings
When creating the Pages project:
| Setting | Value |
|---|---|
| Framework preset | Astro |
| Build command | npm run build |
| Build output directory | dist |
| Root directory | / |
| Node version | 22 |
If Cloudflare does not automatically use Node 22, add an environment variable:
NODE_VERSION=22
Custom domain
In Cloudflare Pages:
- Open the Pages project.
- Go to Custom domains.
- Add
kb.costabile.com.au. - If
costabile.com.auDNS is already managed by Cloudflare, Cloudflare will create the required DNS record automatically.
Expected DNS shape:
kb.costabile.com.au -> your-pages-project.pages.dev
Cloudflare usually manages this as a proxied CNAME.
Authentication with Cloudflare Access
Use Cloudflare Zero Trust Access to protect the site.
- Open Cloudflare dashboard.
- Go to Zero Trust.
- Go to Access → Applications.
- Add an application.
- Choose Self-hosted.
- Application domain:
kb.costabile.com.au. - Add an allow policy.
- Include your email address.
- Save and test in a private/incognito browser window.
Recommended Access policy
Start simple:
| Field | Value |
|---|---|
| Policy name | Allow John |
| Action | Allow |
| Include | Emails |
| John’s email address |
Later you can add family members or a trusted collaborator.
Security notes
- Cloudflare Access protects the static site before content is served.
- This is better than implementing custom authentication in a static app.
- Do not put secrets in the static site source code.
- Treat anything committed to GitHub as potentially visible to repository collaborators.
Deployment checklist
- Create GitHub repo
- Push local site source
- Create Cloudflare Pages project from repo
- Confirm first build succeeds
- Add
kb.costabile.com.aucustom domain - Add Cloudflare Access application
- Test unauthenticated access is blocked
- Test authenticated access works