deniom3/caddy-cloudflare-transform

By deniom3

Updated about 1 month ago

Caddy v2 includes modules cloudflare, transform-encoder and caddy-exec

Image
Networking
Web servers
0

1.2K

deniom3/caddy-cloudflare-transform repository overview

The image includes 3 modules for Caddy: cloudflare, transform-encoder and caddy-exec.

The image is designed to obtain a TLS certificate using dns challenge api cloudflare, and using a log converter based on a desired pattern.

Build repository Deniom3/caddy-cloudflare-transform

Please see the official Caddy Docker Image for deployment instructions.

For start you should add CLOUDFLARE_EMAIL and CLOUDFLARE_API_TOKEN as environment variables to your docker run command. Example:

  docker run -it --name caddy \
    -p 80:80 \
    -p 443:443 \
    -v caddy_data:/data \
    -v caddy_config:/config \
    -v $PWD/Caddyfile:/etc/caddy/Caddyfile \
    -e [email protected] \
    -e CLOUDFLARE_API_TOKEN=12345 \
    -e ACME_AGREE=true \
    deniom3/caddy-cloudflare-transform:latest
       

You can obtain your Cloudflare API token via the Cloudflare Portal. To create a API token with minimal scope, the following steps are needed:

  1. Log into your dashboard, go to account settings, create API token

  2. grant the following permissions:

    • Zone / Zone / Read
    • Zone / DNS / Edit

For use you should add the following to your Caddyfile as the tls directive.

tls {$CLOUDFLARE_EMAIL} { 
  dns cloudflare {$CLOUDFLARE_API_TOKEN}
}

To use the log converter you need to add to your Caddyfile conversion rule.

log {
   output file /logs/access.log 
   format transform `{ts} {request>headers>X-Forwarded-For>[0]:request>remote_ip} {request>host} {request>method} {request>uri} {status}` {
         time_format "02/Jan/2006:15:04:05"
   }
}

This image supports tagging See available tags here. To select a specific version of caddy, set your Docker image tag to the caddy version you'd like to use.

Example: deniom3/caddy-cloudflare-transform:2.8.1

Tag summary

Content type

Image

Digest

sha256:e7fd4b375

Size

39.3 MB

Last updated

about 1 month ago

docker pull deniom3/caddy-cloudflare-transform