This guide explains how to create a Cloudflare API token with the correct permissions for use with the Comserv2 application.
The current API token has IP address restrictions and cannot be used from the server where Comserv2 is running. This results in 403 Forbidden errors with the message "Cannot use the access token from location: [IP address]".
Create a new Cloudflare API token without IP restrictions and with the correct permissions.
If creating a custom token, use these settings:
Token name: Comserv2 DNS Management
Permissions:
Zone Resources:
Client IP Address Filtering:
After creating the new token, update the cloudflare_config.json file with the new token:
{
"cloudflare": {
"api_token": "your-new-token-here",
"email": "[email protected]",
"application_id": "comserv2"
},
...
}
You can test the new token using the provided test script:
perl /home/shanta/PycharmProjects/comserv2/Comserv/script/test_cloudflare_domain.pl
This script will verify that the token is valid and has the correct permissions to access your domains.
If you continue to experience issues with the new token:
For more information on Cloudflare API tokens, see the Cloudflare API documentation.