diff --git a/README.md b/README.md index 3e08668..94b776a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,74 @@ # Caddy -Caddy with Crowdsec +Custom Caddy Builds -![Build](https://git.ryuu.in/ryuupendragon/docker-caddy/actions/workflows/docker-publish.yml/badge.svg?branch=main) -[Caddy](https://github.com/caddyserver/caddy) built with [Crowdsec Modules](https://github.com/hslatman/caddy-crowdsec-bouncer). \ No newline at end of file +Create CLOUDFLARE_API_TOKEN with below permissions. + * Zone.Zone:Read + * Zone.DNS:Edit + +## [Cloudflare ACME](https://github.com/caddy-dns/cloudflare) + +```Caddyfile +{ + acme_dns cloudflare {env.CLOUDFLARE_API_TOKEN} +} +``` + +## [Dynamic DNS](https://github.com/mholt/caddy-dynamicdns) + +```Caddyfile +{ + dynamic_dns { + provider cloudflare {env.CLOUDFLARE_API_TOKEN} + domains { + example.com + } + versions ipv4 + } +} +``` + +## [CrowdSec](https://github.com/hslatman/caddy-crowdsec-bouncer) + +```Caddyfile +{ + crowdsec { + api_url http://crowdsec:8080 + api_key {$CROWDSEC_API_KEY} + ticker_interval 3s + appsec_url http://crowdsec:7422 + #disable_streaming + #enable_hard_fails + } +} + +#Add Logging to Caddy +(logging) { + log { + output file /logs/access.log { + roll_size 10MB # Create new file when size exceeds 10MB + roll_keep 5 # Keep at most 5 rolled files + roll_keep_for 168h # Delete files older than 14 days + roll_uncompressed + } + } +} + +ryuu.in www.ryuu.in { + route { + crowdsec + } + redir https://git.ryuu.in/ryuupendragon permanent + import logging +} + +example.ryuu.in { + route { + crowdsec + } + reverse_proxy ip:port + import logging +} + +```