-
Notifications
You must be signed in to change notification settings - Fork 0
Add Caddy with Cloudflare DNS plugin for PDS wildcard certificates #120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
- Create Dockerfile.caddy with Cloudflare DNS plugin support - Add GitHub Actions workflow for automated image publishing - Update Caddyfile to use Cloudflare DNS challenge for wildcard certificates - Update docker-compose.yml to use custom Caddy image - Add comprehensive documentation for Cloudflare setup - Update .env.example with Cloudflare API token configuration Co-authored-by: tsmarvin <[email protected]>
.env.example
Outdated
| # Cloudflare API Token for DNS challenges (required for wildcard certificates) | ||
| # Get this from: https://dash.cloudflare.com/profile/api-tokens | ||
| # Required permissions: Zone:DNS:Edit | ||
| CLOUDFLARE_API_TOKEN= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a secret not in the .env files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to use Docker secrets instead of environment variables. The Cloudflare API token is now stored in secrets/cloudflare_api_token.txt and mounted as a read-only secret, following the same pattern as other credentials in the project. (commit 3efa601)
|
@copilot back to you |
- Remove CLOUDFLARE_API_TOKEN from .env.example - Add cloudflare_api_token.txt to setup-secrets.sh script - Update docker-compose.yml to mount Cloudflare token as secret - Update Caddyfile to read token from file instead of env var - Update documentation to reflect secrets-based approach Co-authored-by: tsmarvin <[email protected]>
ATProto PDS requires wildcard DNS (
*.pds.tunebridge.media) for user-specific subdomains. Standard HTTP-01 ACME challenges cannot validate wildcard certificates, necessitating DNS-01 challenges via Cloudflare API.Implementation
Custom Caddy Image
Dockerfile.caddy: Multi-stage build withxcaddyintegratinggithub.com/caddy-dns/cloudflarecaddy:2-builder→caddy:2Automated Publishing
.github/workflows/publish-caddy-cloudflare-test.yml: Multi-arch builds (amd64/arm64)${DOCKERHUB_USERNAME}/caddy-cloudflare-test:latestConfiguration
Caddyfile: Added DNS-01 challenge block for PDS wildcard domaindocker-compose.yml: Updated Caddy service to use custom image, mounts Cloudflare API token as Docker secretsetup-secrets.sh: Addedcloudflare_api_token.txtto secrets setup scriptDocumentation
docs/CADDY_CLOUDFLARE.md: Cloudflare API token setup (Zone:DNS:Edit), troubleshooting, security considerationsREADME.md: Added documentation linkSecurity
Minimal GitHub Actions permissions (contents: read)
No hardcoded credentials
Cloudflare token stored as Docker secret (not environment variable) following project pattern
Cloudflare token scoped to Zone:DNS:Edit only
Secret mounted read-only at
/run/secrets/cloudflare_api_tokenPinned action versions with SHA256 hashes
CodeQL scan: no vulnerabilities
Fixes Add Caddy with Cloudflare DNS plugin for PDS wildcard certificates #119
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.