Giter Club home page Giter Club logo

Comments (6)

mholt avatar mholt commented on June 14, 2024 1

Oh, I see. That'd be kind of cool, you just provide your DNS credentials, and Caddy will set the A/AAAA records automatically and then try to get a certificate. Hmmmm.

from caddy-dynamicdns.

francislavoie avatar francislavoie commented on June 14, 2024 1

@mholt this can be closed, the PR was merged!

from caddy-dynamicdns.

mholt avatar mholt commented on June 14, 2024

Can you clarify this:

And this middleware could pick up the domains has dynamic_dns in its config and start to config dns for them

What do you mean by this?

Your config is currently set to manage DNS for on_demand.example.com (that's not even a valid DNS name).

from caddy-dynamicdns.

caiych avatar caiych commented on June 14, 2024

Sorry I wasn't clear(and the on_demand part is probably a bad idea).

The above Caddyfile is meant to be equivalent of:

{
	dynamic_dns {
		provider cloudflare {env.CLOUDFLARE_API_TOKEN}
		domains {
			example.com yo hi
		}
		check_interval 5m
	}
}

yo.example.com {
  reverse_proxy 127.0.0.1:10000
}

hi.example.com {
  file_server
}

from caddy-dynamicdns.

francislavoie avatar francislavoie commented on June 14, 2024

@mholt I think on_demand was meant as a constant here to indicate "read a list of subdomains dynamically from the ones Caddy is managing".

It's an interesting idea, but I'm not sure what the best approach to extracting that information would be. I don't think Caddy has a good API for fetching a list of domains that are currently being managed by it.

That might be something that can be done by reading from the configured storage and listing the domains that Caddy has in storage, and filter that list by only including those matching the base domain that dynamic_dns has configured.

Note that care needs to be taken for this to be efficient though, because List() calls can be expensive on certain storage drivers (e.g. DynamoDB) but I think it's unlikely that this would be paired with any storage driver other than filesystem since dynamic DNS is most likely used by "self hosted" type environments which generally strive for simplicity.

from caddy-dynamicdns.

caiych avatar caiych commented on June 14, 2024

Noticed this https://github.com/tiredofit/docker-traefik-cloudflare-companion which shares the same idea but doing it from the outside -- makes sense since it's traefik and there's no centralized list of domain.

from caddy-dynamicdns.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.