Deployment & Internal Access¶
1. Repository¶
Create a GitHub repository named bot-operations-hub with visibility Private. Upload this starter project and set default branch to main.
2. Cloudflare Pages¶
- Open Workers & Pages → Create application → Pages → Connect to Git.
- Authorize the GitHub integration for only the needed repository.
- Select
bot-operations-hub, production branchmain. - Set build command:
pip install -r requirements.txt && zensical build. - Set output directory:
site. - Deploy only the non-sensitive starter content; do not upload internal secrets.
Cloudflare's first deployment may make the default PROJECT.pages.dev site publicly accessible until Access is configured. A private GitHub repo does not protect the hosted content.
3. Protect every public entrypoint (mandatory)¶
Use Cloudflare Zero Trust → Access controls → Applications to require authentication with an explicit Allow policy for named employee email addresses or approved identity groups. Avoid any public Bypass or broad Everyone policy.
Protect each of these, not merely one of them:
- The production
PROJECT.pages.devhostname. - Every preview deployment, including
*.PROJECT.pages.dev. - Any custom domain, e.g.
docs.example.com, if one is configured.
Cloudflare-specific caveat: Pages Settings → General → Enable access policy initially protects preview deployments only, not the main PROJECT.pages.dev hostname or custom domain. See the Cloudflare Pages known-issues guidance for adjusting the Access application to cover the main hostname and then re-enabling the preview wildcard policy. Custom domains need their own Access application/policy. The exact dashboard labels may change.
References:
- https://developers.cloudflare.com/pages/get-started/git-integration/
- https://developers.cloudflare.com/pages/configuration/preview-deployments/
- https://developers.cloudflare.com/pages/platform/known-issues/
- https://developers.cloudflare.com/cloudflare-one/access-controls/applications/http-apps/self-hosted-public-app/
4. Authentication¶
- Configure a supported identity provider (e.g. email one-time PIN or corporate SSO).
- Allow only approved office staff; test an approved account and an unapproved account.
- Set reasonable session expiry and remove access when staff leave.
- Use explicit access policy review for new employees.
5. Verify before publishing sensitive docs¶
Run the following tests using a browser signed out of Cloudflare Access:
| URL | Unauthorized expected | Authorized expected |
|---|---|---|
https://PROJECT.pages.dev/ |
Access login / denied | Site loads |
https://PREVIEW.PROJECT.pages.dev/ |
Access login / denied | Preview loads |
| Custom domain, if used | Access login / denied | Site loads |
Also test direct access to CSS, JS, and search-index/static files via every hostname. If any URL serves content to an unauthorized visitor, stop rollout and fix the policy.
6. Operational workflow¶
Commit Markdown updates to GitHub, review a pull request, merge to main, and confirm Cloudflare Pages build status. Store only sanitized documentation; Git history is persistent and deleting a secret from one commit does not erase it from older commits.