Cloudflare Pages + MkDocs + Google Login (Zero Trust)¶
1. Repo prep¶
-
Create
requirements.txtat repo root containing: mkdocs mkdocs-material -
Ensure
mkdocs.ymland/docs/folder exist.
2. Deploy to Cloudflare Pages¶
- Cloudflare Dashboard → Pages → Create Project → connect GitHub repo.
- Build settings:
- Build command:
bash pip install -r requirements.txt && mkdocs build --strict - Output directory:
site - Environment variable:
PYTHON_VERSION=3.11 - Add custom domain:
skyll.docupreview.uk.
3. Enable Google login in Cloudflare Zero Trust¶
- Go to Zero Trust → Settings → Authentication → Login methods.
- Click Add new → Google.
4. Create OAuth credentials in Google Cloud¶
- Open Google Cloud Console.
- Create a new project.
- Go to APIs & Services → Credentials → Configure consent screen.
- Audience type: External
- Fill in required details → Save
- Create OAuth Client ID:
- Type: Web Application
- Authorized JavaScript origins:
https://zytx.cloudflareaccess.com - Authorized redirect URIs:
https://zytx.cloudflareaccess.com/cdn-cgi/access/callback - ⚠️ Use your Cloudflare Team Domain.
In this setup the team name iszytx. - Copy Client ID and Client Secret.
5. Add OAuth creds to Cloudflare¶
- In Cloudflare Zero Trust → Google login method.
- Paste:
- App ID = Google Client ID
- Client Secret = Google Client Secret
- Save.
6. Create Access Application¶
- Zero Trust → Access → Applications → Add application → Self-hosted
- Application name:
Skyll Docs - Domain:
skyll.docupreview.uk - Session duration:
24h - Save.
7. Add Access Policy¶
- Inside the app → Policies → Add a policy.
- Policy name:
Allowed users - Action: Allow
- Include:
- Emails →
alex@axiafutures.com - Emails →
friend@gmail.com - (Optional) Emails ending in →
axitradinggroup.com - Save.
8. Test¶
- Open
https://skyll.docupreview.ukin an incognito/private window. - Login with an allowed email → access granted.
- Login with any other email → access denied.
9. (Optional) Protect Pages.dev previews¶
- Add another Access Application for
<project>.pages.dev. - Add pattern:
*.<project>.pages.devto also cover branch previews. - Apply the same Allow policy.