Appearance
Cloudflare Pages + Access Deployment
This runbook publishes the Lurnet docs as a Cloudflare Pages static site and restricts access to allowed users with Cloudflare Zero Trust Access.
Local Commands
bash
npm ci
npm run verify
npm run docs:devThe docs build output is docs/.vitepress/dist.
Cloudflare Pages Setup
- In Cloudflare, open Workers & Pages.
- Create a Pages application from the Git repository.
- Use these build settings:
| Setting | Value |
|---|---|
| Framework preset | VitePress |
| Production branch | main |
| Root directory | / |
| Build command | npm run docs:build |
| Build output directory | docs/.vitepress/dist |
| Node.js version | 22.16.0 from .node-version |
Cloudflare Pages installs dependencies before running the build command. The build must pass npm run verify locally before pushing changes.
Custom Domain
Attach the docs hostname you want to protect, for example docs.example.com, to the Pages project.
Use the custom domain as the canonical docs URL. Do not share the generated *.pages.dev production URL with users unless you have also protected or redirected it.
Zero Trust Access Setup
- In Cloudflare Zero Trust, open Access controls > Applications.
- Add an application and choose Self-hosted.
- Name it
Lurnet Docs. - Add the public hostname that points to the Pages custom domain, for example
docs.example.com. - Add an Allow policy for the allowed users. Start with explicit email addresses or your identity provider group.
- Keep the application deny by default. Users who do not match an Allow policy should be blocked.
- Choose the identity provider users should authenticate with. For a single provider, enable Instant Auth.
- Save the application and test in a private browser session with one allowed account and one blocked account.
Preview Deployment Access
Cloudflare Pages preview deployment URLs on <hash>.<project>.pages.dev are public unless protected separately.
Enable preview protection in the Pages project:
- Open the Pages project.
- Go to Settings > General.
- Enable Access policy for preview deployments.
This protects preview deployment URLs, but it does not protect the production <project>.pages.dev URL or the custom domain. The custom domain is protected by the self-hosted Access application above.
Production pages.dev URL
The production <project>.pages.dev URL can bypass the custom-domain Access application if it remains reachable. Use one of these controls before treating the docs as private:
- Configure the Pages project to redirect
*.pages.devtraffic to the protected custom domain, or - Create an additional Access application for the production
<project>.pages.devhostname, or - Avoid distributing the
pages.devURL and validate that it is not discoverable enough for your risk profile.
Prefer option 1 or 2 for private planning docs.
Deployment Checklist
npm run verifypasses locally.- Pages build command is
npm run docs:build. - Pages output directory is
docs/.vitepress/dist. - Custom domain is attached to the Pages project.
- Zero Trust Access self-hosted application protects the custom domain.
- Access policy allows only approved users or groups.
- Preview deployment Access policy is enabled.
- Production
pages.devbypass risk is handled.