PetFolio Documentation with Cloudflare¶
PetFolio documentation is deployed as a static site, deployment and hosting is managed by Cloudflare Pages. Cloudflare handles automatic deployments and fine grained access controls.
- Repository:
petfolio-fe - Application:
petfolio-docs - Cloudflare configuration: PetFolio Docs Pages Config
- Cloudflare access controls: Cloudflare One Config
- Live URL: docs.petfolio.uk
- To enable use of the
petfolio.ukdomain, the Domain record was amended within Squarespace. A new custom record for CNAME was added, pointing to the Cloudflare Pages docs.
- To enable use of the
- Fallback URL: petfolio-fe.pages.dev
Helpful resources
- CloudFlare Pages: https://developers.cloudflare.com/pages/
- CloudFlare Access: https://developers.cloudflare.com/cloudflare-one/
Managing Access¶
Login Methods¶
Login Methods are configured in Cloudflare One. The following Login Methods have been assigned to the PetFolio Docs pages site:
- One-Time PIN (Email):
- Enabled for selected email addresses:
- Users receive login code via email
- No additional configuration needed
- Google Workspace login:
- All users within the PetFolio Google Workspace (ie.
email@petfolio.uk) will have access and can login via their Google Workspace account. - Identity Provider Integration configured with PetFolio Google Workspace
- All users within the PetFolio Google Workspace (ie.
Add/Remove Team Members¶
With the free tier, can give access to up to 50 team members.
- Go to Access → Applications
- Click Petfolio Documentation
- Go to Policies tab
- Edit Team Members policy
- Add/remove email addresses
- Click Save
Changes take effect immediately.
View Active Sessions¶
- Go to Access → Users
- See active sessions
- Revoke access if needed
Audit Logs¶
- Go to Logs → Access
- View authentication attempts and access logs
Automatic Deployments¶
Automatic deployments are handled by Cloudflare using the GitHub integration.
Cloudflare will watching for changes to the main branch within the petfolio-fe repository and will trigger a new deployment when changes are made within apps/petfolio-docs/*.
When you push to main branch:
- CloudFlare detects the push
- Runs build command in
apps/petfolio-docs - Deploys to
docs.petfolio.uk - Check CloudFlare Pages dashboard for build logs
Pull Request Previews¶
When you create a PR:
- CloudFlare builds a preview deployment
- Preview URL generated (visible in CloudFlare dashboard)
- Preview protected by same Access authentication
- Preview deleted when PR closed/merged
Troubleshooting¶
Custom domain not working
- Verify CNAME record in Squarespace points to
petfolio-docs.pages.dev - Check DNS propagation: https://dnschecker.org
- Wait up to 30 minutes for DNS changes
- Ensure SSL certificate is active in CloudFlare Pages
Build failures
- Check build logs in CloudFlare Pages dashboard
- Verify
requirements.txtis present - Ensure
PYTHON_VERSIONenvironment variable is set to3.12 - Check that
mkdocs.ymlis valid
Access denied errors
- Verify user email is in Access policy
- Check identity provider configuration
- Review audit logs for detailed errors
- Test with different email or incognito mode
Can't login
- Verify One-Time PIN is enabled (default)
- Check email spam folder for OTP codes
- Try clearing browser cookies
- Contact admin to verify email is in policy