Possibility to test Cadyfile

Is any possibility to check if Caddyfile has proper syntax? Something like key ‘-t’ for nginx.

If there is no such option for now and someone feeling able to develop it would be nice to consider mechanism for pass ACME challenge and obtaining certificates from let’sencrypt staging environment.

With the way that the Caddyfile is currently parsed, this isn’t entirely possible. Only very basic checks would be possible, such as matching curly brackets. This is because the way the Caddyfile is parsed is determined by the extensions, not a specification. Extensions get access to the parser, and just continually ask for the next value, and then the extension can choose to do anything with the parsed data, including executing operations you might not want when just parsing.

Validation would only be possible if a breaking change was made to have a parsing only stage which extension developers must abide by to only parse and validate values from the Caddyfile.

1 Like