Skip to content
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

Deploying a caddy+cloudflare image #43

Closed
aTable opened this issue Jul 18, 2022 · 4 comments
Closed

Deploying a caddy+cloudflare image #43

aTable opened this issue Jul 18, 2022 · 4 comments

Comments

@aTable
Copy link

aTable commented Jul 18, 2022

As mentioned in issue 24 it's simple enough to create a custom build of caddy including the cloudflare module. Is there any interest to also ship an official version as part of the range of caddy?

It would be convenient if you only had to do a docker pull docker.io/caddy:cloudflare

@mholt
Copy link
Contributor

mholt commented Jul 18, 2022

Thanks for the question/interest! You're welcome to publish such an image for people to use, but we are not planning on it.

@mholt mholt closed this as completed Jul 18, 2022
@aTable
Copy link
Author

aTable commented Jul 18, 2022

Happy to raise the PR, are you saying it wont happen in this repo and to do it in my own?

@mholt
Copy link
Contributor

mholt commented Jul 18, 2022

Yep. There are too many DNS providers and it doesn't make much sense for us to try to officially favor one (or especially all of them equally) and publish singular images with just that plugin. But the community is welcome to contribute whatever they'd like for others to use!

@aTable
Copy link
Author

aTable commented Jul 18, 2022

for any future readers: I have forked this repo to deploy an image for convenience. I have only briefly tested so far but its working fine for wildcard certs. To use:

Example Caddyfile thanks to reinhardt

{
    debug
    email {env.CLOUDFLARE_EMAIL}
}

*.mydomain.com
 {
    tls {
        dns cloudflare {env.CLOUDFLARE_API_TOKEN}
    }  
    @home host home.mydomain.com
	handle @home {
		root * /sites/home_site
                file_server
	}
     @jellyfin host jellyfin.mydomain.com
	handle @jellyfin {
	      reverse_proxy jellyfin:8096 
	}
}

Sample run command docker run --name caddy --volume /path/to/Caddyfile:/etc/Caddy/Caddyfile -e CLOUDFLARE_EMAIL='youremail@example.com' -e CLOUDFLARE_API_TOKEN='your_api_token_with_correct_zone_and_dns_permissions' ghcr.io/atable/cloudflare:master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants