coquibot/coqui-toolkit-cloudflare 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

coquibot/coqui-toolkit-cloudflare

Composer 安装命令:

composer require coquibot/coqui-toolkit-cloudflare

包简介

Cloudflare management toolkit for Coqui — DNS records, tunnels, zones, security, and analytics via the Cloudflare REST API v4.

README 文档

README

Comprehensive Cloudflare management toolkit for Coqui. Provides full API v4 access for DNS records, tunnels, zones, security (firewall/WAF), page rules, and analytics.

Requirements

  • PHP 8.4+
  • Coqui Bot with carmelosantana/php-agents ^0.7

Installation

composer require coquibot/coqui-toolkit-cloudflare

The toolkit is auto-discovered by Coqui via extra.php-agents.toolkits in composer.json.

Configuration

Required Credentials

Credential Description
CLOUDFLARE_API_TOKEN API token with appropriate permissions. Create one at Cloudflare Dashboard.

Optional Credentials

Credential Description
CLOUDFLARE_ACCOUNT_ID Account ID for tunnel and account-scoped operations. Found on the dashboard overview page.

Set credentials via the Coqui credentials tool:

credentials(action: "set", key: "CLOUDFLARE_API_TOKEN", value: "your-token")
credentials(action: "set", key: "CLOUDFLARE_ACCOUNT_ID", value: "your-account-id")

API Token Permissions

Create a custom API token at Cloudflare API Tokens with the permissions you need:

Permission Required For
Zone: Read cf_zone list/get, cf_analytics
Zone: Edit cf_zone create/delete/purge
DNS: Read cf_dns list/get/export
DNS: Edit cf_dns create/update/delete/import
Cloudflare Tunnel: Read cf_tunnel list/get
Cloudflare Tunnel: Edit cf_tunnel create/delete, cf_tunnel_config
Firewall Services: Read cf_firewall list, cf_waf list
Firewall Services: Edit cf_firewall create/update/delete, cf_waf update
Zone: Page Rules: Read cf_page_rule list/get
Zone: Page Rules: Edit cf_page_rule create/update/delete
Analytics: Read cf_analytics
Account Settings: Read cf_account

Tools

cf_account

List accounts or get details for a specific account.

Actions: list, get

cf_zone

Manage zones — list, get details, create, delete, or purge cache.

Actions: list, get, create, delete, purge_cache

cf_dns

Full CRUD for DNS records (A, AAAA, CNAME, MX, TXT, NS, SRV, CAA, and more), plus BIND export/import.

Actions: list, get, create, update, delete, export, import

cf_tunnel

Manage Cloudflare Tunnels. Requires CLOUDFLARE_ACCOUNT_ID.

Actions: list, create, get, delete, connections

cf_tunnel_config

Get and update tunnel configurations — ingress rules and origin settings. Supports both full JSON config and single-rule updates with automatic merge.

Actions: get, update

cf_firewall

Manage firewall access rules — block/challenge IPs, IP ranges, ASNs, or countries.

Actions: list_rules, create_rule, update_rule, delete_rule

cf_waf

List and manage WAF managed rule packages and individual rule overrides.

Actions: list_packages, get_package, list_rules, get_rule, update

cf_page_rule

Create, list, update, and delete Page Rules for URL pattern matching with actions.

Actions: list, get, create, update, delete

cf_analytics

Retrieve zone analytics — dashboard totals (traffic, bandwidth, threats) and DNS query analytics.

Actions: dashboard, dns

Gated Operations

The following operations require user confirmation (or --auto-approve):

Tool Gated Actions
cf_zone delete, purge_cache
cf_dns delete, import
cf_tunnel delete
cf_tunnel_config update
cf_firewall create_rule, update_rule, delete_rule
cf_waf update
cf_page_rule create, update, delete

Usage Examples

# List all zones
cf_zone(action: "list")

# Find DNS records for a zone
cf_dns(action: "list", zone_id: "abc123")

# Create an A record
cf_dns(action: "create", zone_id: "abc123", type: "A", name: "app.example.com", content: "192.0.2.1", proxied: true)

# Create a tunnel
cf_tunnel(action: "create", name: "my-tunnel")

# Configure tunnel ingress
cf_tunnel_config(action: "update", tunnel_id: "def456", hostname: "app.example.com", service: "http://localhost:8080")

# Get zone analytics for the last 7 days
cf_analytics(action: "dashboard", zone_id: "abc123", since: "-10080")

Development

# Install dependencies
composer install

# Run tests
composer test

# Static analysis
composer analyse

License

MIT

coquibot/coqui-toolkit-cloudflare 适用场景与选型建议

coquibot/coqui-toolkit-cloudflare 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「toolkit」 「analytics」 「firewall」 「dns」 「cloudflare」 「waf」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 coquibot/coqui-toolkit-cloudflare 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 coquibot/coqui-toolkit-cloudflare 我们能提供哪些服务?
定制开发 / 二次开发

基于 coquibot/coqui-toolkit-cloudflare 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 44
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-08