この紹介文は現在英語版のみです。
Caddy DNS Cloudflare is a DNS provider module for Caddy that enables automatic DNS record management with Cloudflare. It’s particularly useful for automating SSL certificate management through ACME DNS challenges.
Key Features
- Automatic DNS record management for Cloudflare
- Support for ACME DNS challenges
- Flexible authentication options
- Secure API token management
- Easy integration with Caddy server
Configuration Options
This module provides two ways to configure API tokens:
-
Separate Zone and DNS Tokens
- Zone Token:
Zone.Zone:Readpermission forAll zones - DNS Token:
Zone.DNS:Editpermission for specific domains
- Zone Token:
-
Single API Token
- API Token:
Zone.Zone:ReadandZone.DNS:Editpermissions forAll zones
- API Token:
Quick Start
JSON Configuration
{
"module": "acme",
"challenges": {
"dns": {
"provider": {
"name": "cloudflare",
"api_token": "{env.CF_API_TOKEN}"
}
}
}
}
Caddyfile Configuration
Using Dual Keys
tls {
dns cloudflare {
zone_token {env.CF_ZONE_TOKEN}
api_token {env.CF_API_TOKEN}
}
}
Using Single Key
tls {
dns cloudflare {env.CF_API_TOKEN}
}
Troubleshooting
Common Issues
-
Invalid request headers
- Ensure your API token is properly set in the environment variables
- Verify the token has the correct permissions
-
DNS propagation timeout
- Check if the
_acme-challengeTXT record is created in Cloudflare - Consider using Cloudflare’s DNS resolver (1.1.1.1)
{ "resolvers": ["1.1.1.1"] } - Check if the
Documentation
For more detailed information, please refer to the Caddy Documentation.
Contributing
Contributions are welcome! Please ensure:
- Code follows Go standard formatting
- Tests are added for new features
- Documentation is updated accordingly
License
This project is licensed under the Apache License 2.0.