Is there a simple existing script for the ask endpoint for on_demand_tls?

We’re looking for something for on_demand_tls configs to use with a machine. This machine is a very basic Debian essentially serving only static content for a number of DNS records. There’s no Apache or PHP there like in other web services we have. So, the Caddyfile has the domains hardcoded on it. But for ease of handling (adding and removing records and the like) we were considering setting it up with on_demand_tls as we have on a couple other places already. Of course, those have Apache+PHP with a script on a dedicated endpoint listening for the ask requests, and i for one would like to do this on this server without adding much stuff.

So, do we have somewhere, on a Github repo or something, a simple script in Python, Perl or something else that comes included in your typical Debian server, that listens on Localhost on some port to HTTP requests, checks a file for the domain names and responds with what Caddy expects? Because if that exists already then all the better, no need to make one.

No, not really. The requirements are extremely simple (literally cannot be simpler).

Every setup is different, it entirely depends how you plan on storing your list of allowed domains. Generally we recommend using some database so that lookups are fast etc.

But all Caddy does is make a GET request to your configured endpoint with the query ?domain= with the value being the domain in question. Respond with a 200 status and Caddy will continue with issuance. Respond with 4xx or 5xx and it’ll give up. That’s it. No response body expected.

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.