Skip to main content

Host this site behind auth

Get ops-docs onto Cloudflare Pages with Cloudflare Access in front, so it's readable from a phone but not by anyone else.

Auth is not a Docusaurus concern. The site builds to static HTML either way, the login happens at the hosting layer in front of the files.

Steps

#StepDetailWho
1Decide the hostnameops-docs.pages.dev free, or docs.codeaddicts.io. Domain is already on CloudflareMe
2Create the Pages projectFrom nathan-roberts/ops-docs. Build npm run build, output build, Node 20+Me, needs browser
3Set the real urlIn docusaurus.config.js, currently a placeholderClaude
4Verify the first deployBuilds clean on Cloudflare, sidebar and search workClaude
5Create the Access applicationSelf-hosted app in Zero Trust over the hostname. Free up to 50 usersClaude, via API
6Add the allow policyMy email onlyClaude, via API
7Cover preview deploymentsSee the trap belowClaude, via API
8Test anonymous accessPrivate window, production and a preview URLClaude
9Replace logo and faviconCosmetic, do last. Favicon idea: 🧠Claude

Step 2 is the handoff. Connecting a private repo needs the Cloudflare GitHub app authorized against it, which is a browser click-through I can't do.

The trap in step 7

Cloudflare Pages gives every branch and commit its own preview URL on *.pages.dev. An Access application covering only the production hostname leaves those wide open, and a preview serves the entire site.

Either add a wildcard Access application over *.ops-docs.pages.dev, or turn preview deployments off. Don't skip this.

Note

The same steps are mirrored in the session task list for execution.