This update adds functionality to synchronize domains from Cloudflare to the local configuration file. This ensures that the application always has an up-to-date list of domains managed by Cloudflare, even if changes were made directly in the Cloudflare dashboard.
Added a new method to the CloudflareManager module:
Added a new endpoint to the CloudflareAPI controller:
/cloudflareapi/update_domainsUpdated the Cloudflare management UI to include:
The implementation uses the existing list_zones method to fetch domains from Cloudflare, then updates the configuration file with the retrieved data. This ensures that any domains added or removed directly in Cloudflare are reflected in the application.
The update process preserves the structure of the configuration file while replacing the domain-related sections with fresh data from the Cloudflare API.
If the Cloudflare API cannot be accessed due to IP restrictions, the system will fall back to using the existing configuration data, ensuring that the functionality still works even when direct API access is not available.
/cloudflareapi)After synchronization, the updated domain list will be used for all Cloudflare-related operations in the application.
If you encounter an error message about IP restrictions, it means your Cloudflare API token is configured to only allow access from specific IP addresses, and your server's IP address is not on the allowed list. In this case, the system will fall back to using the existing configuration data.
To resolve this issue, you can either: