What I mean is something like twig. Features I would use would be define the template to use (a single level of extending would be enough for me), including snippets (define variables to pass), using variables in conditions and "echo" them in the template.
I see, so like config generation. Yeah, we can do this. Do you think you could find a few minutes to
open an issue with this proposal, esp. if you can create a full config that you'd like to have? It can be small, but should demonstrate the setup you're looking for.
Caddy 2 has first-class support for "config adapters". In other words, you can "bring your own config" as long as there's an adapter for it. So an adapter in your case might look like deserializing the YAML, executing the template, then outputting Caddy 2's native JSON config.
If a certificate is not available yet, the other service will show it as „in progress“. In my case it would be a Laravel job that checks if the cert is available and how long it‘s valid. It will be used as part of the setup process status that will be shown to the user. This would also be possible by querying the webserver every few seconds under the specific domain but what if eg. the user hasn‘t pointed the domain to the server yet.
Hmm, wouldn't it be better for the two (Caddy + Laravel) to communicate directly, rather than one polling constantly? (Sometimes it can take hours to procure a certificate.)
Using Caddy as a certificate manager is a pretty good idea too. So Caddy would habdle the web traffic and create the certs and store them in a key-value store like redis and other services could use the certs too.
It can already do this, but the issue is getting the other services/apps to properly use and serve those certificates, including reloading them when they've changed. Generally I recommend -- strongly -- that the apps have embedded certificate management (like, using a library) for best reliability.
As @Gummibeer already pointed out, I would like a config file in yaml or toml.
Cool -- tell me more about this. Why do you like YAML/TOML? Is it to integrate with existing tooling? Or hand-written appeal? Are you automating the management or generation of these configs or doing it by hand?
Caddy 2's native config format is JSON, which I believe is equivalent to TOML and a subset of YAML, so the translation between the three can be done really easily thanks to Caddy's config adapters. But the native JSON exposes a lot of control surface for power users who need it. Are you looking for a watered-down version of this that you can alter by hand?