Appearance
Cloudflare Rollout
This page documents the recommended rollout order for this repository:
- Deploy the VitePress site to Cloudflare Pages.
- Verify public and internal routes on the Pages domain.
- Protect
/internal/*with Cloudflare Access. - Add a Worker later only if Access is not enough.
This keeps the initial deployment simple and reduces the chance of mixing content problems with access-control problems.
1. Deploy To Cloudflare Pages First
Use Cloudflare Pages as the hosting target for the static VitePress output.
Recommended Pages settings:
- Framework preset:
None - Production branch:
main - Build command:
pnpm docs:build - Build output directory:
docs/.vitepress/dist - Root directory: repository root
- Node.js version:
20or newer
Deployment flow:
- Push the repository to GitHub.
- In the Cloudflare dashboard, open
Workers & Pages. - Create a new Pages project from the Git repository.
- Enter the build settings above.
- Trigger the first production deploy.
After the first deploy, verify the generated *.pages.dev domain:
/loads the homepage/public/is reachable/internal/is reachable before Access is enabled- page navigation and clean URLs work as expected
2. Keep The First Deploy Static
Do not add a Worker during the first rollout unless there is a real routing or request-processing requirement.
For this repository:
- VitePress already generates the full static site
- Pages already serves the static output globally
- Access can protect the internal path without adding application code
This is the simplest production shape and the easiest one to debug.
3. Protect /internal/* With Cloudflare Access
After Pages is live, create an Access application for the Pages hostname and protect the internal path.
Recommended approach:
- Open Cloudflare Zero Trust.
- Go to
Access controls->Applications. - Create a self-hosted application for the Pages hostname.
- Set the protected path to
/internal/*. - Add an
Allowpolicy for the team identities that should read internal docs. - Leave
/and/public/*outside that protected path.
Notes:
- Cloudflare Access supports protecting specific application paths, not only whole hostnames.
- More specific application paths take precedence over broader ones.
- Avoid an
Allowpolicy that effectively grants access to everyone.
4. Optional Hardening After Access Works
Once the path-level Access rule is confirmed, you can decide whether to turn on the account-level setting Require Cloudflare Access Protection.
Use this only after reviewing the impact carefully.
Why:
- it changes the account behavior to deny hostnames without an Access application
- public hostnames need an explicit Access application with an allow or bypass path strategy if required
- a careless rollout can block traffic unexpectedly
For this docs project, this setting is optional hardening, not part of the first deployment.
5. When To Add A Worker
Add a Worker only if the site needs logic that Pages plus Access does not cover.
Typical reasons:
- custom edge routing
- request transformation
- route-specific logic before serving assets
- future API endpoints or custom auth flows
If a Worker is added later, keep the responsibility narrow. It should not replace VitePress or duplicate Access unless there is a clear need.
6. Release Checklist
Before each rollout:
- run
pnpm install - run
pnpm docs:build - verify all new pages are in the correct
publicorinternaldirectory - verify navigation links match the actual pages
- verify no sensitive material leaked into
public
After deployment:
- verify the
*.pages.devdomain - verify
/internal/*requires login after Access is enabled - verify
/public/*remains publicly reachable - verify denied users cannot open internal pages