c = CF()
c.verify(){'result': True}
Thin wrapper around the official cloudflare Python SDK. Token is read from the CLOUDFLARE_API_TOKEN environment variable by default.
One-liner for VPS hosting. Creates (or reuses) a tunnel, sets up the CNAME subdomain, and returns (tunnel_id, token) ready for cloudflared_svc() in your docker-compose.
Usage in fastops: tid, token = setup_tunnel(“example.com”, “app”) # → app.example.com # then in Compose: # .svc(“cloudflared”, **cloudflared_svc(token_env=…)) with CF_TUNNEL_TOKEN=token
Cloudflare API wrapper using the official cloudflare Python SDK
Create a Custom Token in the Cloudflare dashboard (My Profile → API Tokens → Create Token):
| Capability | Required permission |
|---|---|
dns_read / DNS ops |
Zone → DNS → Edit (scope to specific zone) |
account_read / tunnel ops |
Account → Account Settings → Read |
tunnel_read / tunnel ops |
Account → Cloudflare Tunnel → Edit |
Use CF().verify() to confirm your token has the permissions it needs before running ops.