Welcome Guest to Defaut site!

Cloudflare Domain Synchronization Feature

Date: 2025-07-15

Author: System Administrator

Status: Implemented

Overview

The Cloudflare Domain Synchronization feature allows administrators to update the local configuration with domains from Cloudflare. 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.

Features

Usage

  1. Log in as an administrator
  2. Navigate to the Cloudflare DNS Management page (via Admin menu or directly at /cloudflareapi)
  3. Click the "Update Domains from Cloudflare" button at the top of the page
  4. Confirm the action when prompted

Technical Implementation

Controller Endpoint

The feature is implemented as an endpoint in the CloudflareAPI controller:

sub update_domains :Path('update_domains') :Args(0) { ... }

This endpoint is accessible at /cloudflareapi/update_domains and handles:

CloudflareManager Method

The core functionality is implemented in the CloudflareManager module:

sub update_user_domains_from_cloudflare { ... }

This method:

IP Restriction Handling

If your Cloudflare API token has IP restrictions that don't include your server's IP address, the system will:

  1. Detect the IP restriction
  2. Log informational messages instead of errors
  3. Fall back to using existing configuration data
  4. Display a helpful message with your server's IP address

Resolving IP Restrictions

To allow direct API access, you can:

  1. Log in to your Cloudflare dashboard
  2. Go to "My Profile" > "API Tokens"
  3. Edit your API token
  4. Under "IP Address Filtering", add your server's IP address
  5. Save the changes

Alternatively, you can create a new API token without IP restrictions, but this is less secure.

Security Considerations