tourze / cloudflare-dns-bundle
Cloudflare DNS Manage
Installs: 22
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.1
- doctrine/collections: ^2.3
- doctrine/dbal: ^4.0
- doctrine/doctrine-bundle: ^2.13
- doctrine/orm: ^3.0
- doctrine/persistence: ^3.1 || ^4
- psr/log: ^3|^2|^1
- symfony/config: ^6.4
- symfony/console: ^6.4
- symfony/dependency-injection: ^6.4
- symfony/framework-bundle: ^6.4
- symfony/http-client: ^6.4
- symfony/http-client-contracts: ^2.5 | ^3.0
- symfony/http-kernel: ^6.4
- symfony/yaml: ^6.4 || ^7.1
- tourze/doctrine-indexed-bundle: 0.0.*
- tourze/doctrine-track-bundle: 0.0.*
- tourze/easy-admin-attribute: 0.1.*
- tourze/enum-extra: ~0.0.5
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2025-05-11 17:47:51 UTC
README
Cloudflare DNS Bundle is a Symfony bundle for managing Cloudflare DNS, domains, analytics, and IAM keys with full ORM support, CLI tools, and advanced admin features.
Features
- Manage Cloudflare DNS records and domains via ORM entities
- Sync DNS/domain/analytics data between Cloudflare and local DB
- Full CRUD and admin UI support (EasyAdmin attributes)
- Command-line tools for batch sync, analytics, and import/export
- IAM key management for multi-account support
- Extensible service layer for custom business logic
- Comprehensive test coverage
Installation
composer require tourze/cloudflare-dns-bundle
Requirements
- PHP >= 8.1
- Symfony >= 6.4
- Doctrine ORM >= 2.20
- Cloudflare account and API credentials
Quick Start
- Register the bundle in your Symfony config (if not auto-discovered):
// config/bundles.php return [ CloudflareDnsBundle\CloudflareDnsBundle::class => ['all' => true], ];
-
Configure your database and run migrations for the provided entities.
-
Add your IAM keys and domains via admin UI or directly in the database.
-
Use CLI commands to sync and manage DNS:
php bin/console cloudflare:sync-domain-info php bin/console cloudflare:sync-domain-record-to-local [domainId] php bin/console cloudflare:sync-dns-domain-record <dnsRecordId> php bin/console cloudflare:sync-dns-analytics [--since -24h] [--until now] [--time-delta 1h]
- Use the service layer in your own code:
use CloudflareDnsBundle\Service\DnsRecordService; // Inject DnsRecordService and use its methods $service->listRecords($domain, ['type' => 'A']);
Documentation
- Entities: DnsDomain, DnsRecord, IamKey, DnsAnalytics (see
docs/Entity.md
) - CLI Commands: See
src/Command/
for all available commands - Service Layer: See
src/Service/
for extensible business logic - Enum Types: DnsRecordType (A, MX, TXT, CNAME, NS, URI)
- Testing: PHPUnit tests in
tests/Service/
Advanced Features
- Batch import/export DNS records (BIND format)
- Analytics sync and reporting
- Full audit and tracking (created/updated by, timestamps)
- Admin UI integration (EasyAdmin attributes)
- Extensible with your own services and event subscribers
Contributing
Feel free to submit issues or pull requests. Please follow PSR-12 and project code style. Run tests with:
phpunit
License
MIT License. See LICENSE.
Changelog
See CHANGELOG.md for release notes and upgrade guide.