Search by

cengizkemec / cloudflare

cengizkemec

Cloudflare API integration for Flarum 2.0

Package info

github.com/cengizkemec/flarum-cloudflare

Type:flarum-extension

pkg:composer/cengizkemec/cloudflare

Statistics

Installs: 20

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.2.7 2026-10-23 18:41 UTC

This package is auto-updated.

Last update: 2026-10-24 07:00:47 UTC


README

Cloudflare API integration for Flarum 2.0. Configure your Cloudflare zone settings, purge the cache, and manage common Cloudflare features directly from the Flarum admin panel.

Features

  • Enable or disable Cloudflare integration
  • Configure API token, account ID, zone ID, and zone name
  • Verify the Cloudflare API connection
  • Purge the Cloudflare cache manually
  • Automatically purge the cache when discussions or posts are created
  • Toggle development mode
  • Toggle Bot Fight Mode
  • Toggle Always Online
  • Toggle Brotli compression
  • Toggle Rocket Loader
  • Toggle Mirage
  • Minify JavaScript, CSS, and HTML
  • Set security level
  • Set Polish image optimization
  • Set browser cache TTL
  • Apply all saved settings to Cloudflare with one click
  • English and Turkish localization

Requirements

  • Flarum 2.0
  • PHP with Guzzle HTTP client (installed via Composer)

Installation

composer require cengizkemec/cloudflare

Then enable the extension in the Flarum admin panel and configure your Cloudflare credentials.

Cloudflare API token permissions

Create an API token in Cloudflare with at least:

  • Zone:Cache Purge
  • Zone:Read
  • Zone:Edit (for zone settings)

Admin settings

Open Admin Panel → Extensions → Cloudflare → Settings and configure:

  • Enable Cloudflare integration
  • API Token
  • Account ID
  • Zone ID
  • Zone name
  • Development mode
  • Bot Fight Mode
  • Always Online
  • Brotli
  • Rocket Loader
  • Mirage
  • Minify JavaScript
  • Minify CSS
  • Minify HTML
  • Security Level
  • Polish
  • Browser Cache TTL
  • Purge cache automatically

Use Apply Settings to Cloudflare to push the saved settings to your zone, and Purge Cache to clear the cache immediately.

Documentation

See the full user guide: docs/GUIDE.md

API endpoints

All endpoints require an admin user.

  • POST /cloudflare/test - Verify the Cloudflare API token and zone configuration.
  • POST /cloudflare/purge - Purge the zone cache, optionally for specific files.
  • POST /cloudflare/apply - Apply all saved zone settings to Cloudflare.