The Cloudflare integration provides role-based access control for managing DNS records and other Cloudflare features for domains managed by the Comserv2 system. It integrates with the existing site and user management system to ensure that users can only access domains they have permission to manage.
You can access the Cloudflare DNS Management interface directly from the Admin menu:
Admin → System Setup → System Configuration → Cloudflare DNS
Open Cloudflare DNS Management
The Cloudflare integration is configured using a JSON file located at Comserv/config/cloudflare_config.json.
This file contains API credentials, role permissions, and site-specific permission overrides.
{
"cloudflare": {
"api_token": "YOUR_TOKEN",
"account_id": "YOUR_ACCOUNT_ID",
"email": "[email protected]"
},
"roles": {
"admin": {
"permissions": ["dns:edit", "zone:edit", "ssl:edit", "cache:edit"]
},
"developer": {
"permissions": ["dns:edit", "cache:edit"]
},
"editor": {
"permissions": ["dns:edit"]
}
},
"site_specific_permissions": {
"beemaster.ca": {
"editor": ["dns:edit", "cache:edit"]
}
}
}
The Cloudflare integration consists of the following components:
The Cloudflare integration requires the following dependencies:
pip install cloudflare)Symptom: "Authentication error" or "Invalid API token" messages
Solution: Verify your API token in the cloudflare_config.json file. Ensure it has the correct permissions in the Cloudflare dashboard.
Symptom: "Permission denied" or "Access denied" messages
Solution: Check the user's role and the permissions defined in the cloudflare_config.json file. Ensure the user has the necessary permissions for the domain they're trying to access.
Symptom: DNS records don't appear or the interface shows an error
Solution: Verify the domain is correctly configured in Cloudflare and that the zone ID can be retrieved. Check the application logs for specific error messages.