The caddy-ct
module for Caddy allows to transpile YAML based configuration into a JSON ignition
to be used with
Flatcar or
Fedora CoreOS.
It targets to replace Matchbox with an open and flexible approach of templating,
matching and providing metadata using Caddy's templates
for static configurations (no API for terraform).
ct [<matcher>] {
strict
mime <MIMEType> [<MIMEType...>]
platform <platformName>
}
All options are optional:
matcher
according to matcherstrict
fail on non critical errors (default: false)mime
only transpile specific MIME types (default: all)platform
only for dynamic data must be one of those (default: none)
The module is unordered by default and needs to be ordered using the global option
{
order ct before templates
}
or be used inside a route block.
The following example allows files with specific MIME types to be templated and transpiled after to ignition
config.
{
order ct before templates
}
:8080 {
log
respond / "OK"
file_server
templates {
mime text/html text/plain application/json application/x-yaml
between [[ ]]
}
ct {
strict
mime application/x-yaml
}
}
See xcaddy, short:
xcaddy build \
--with github.com/cubic3d/caddy-ct
or download from https://caddyserver.com/download by selecting this module.