https://github.com/cubic3d/caddy-ct
Caddy module for Container Linux Config Transpiler.
https://github.com/cubic3d/caddy-ct
config-transpiler coreos coreos-container-linux fedora-coreos flatcar flatcar-linux
Last synced: 5 months ago
JSON representation
Caddy module for Container Linux Config Transpiler.
- Host: GitHub
- URL: https://github.com/cubic3d/caddy-ct
- Owner: cubic3d
- License: mit
- Created: 2021-08-22T13:08:21.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-03-07T01:57:51.000Z (over 3 years ago)
- Last Synced: 2025-11-30T05:16:52.969Z (7 months ago)
- Topics: config-transpiler, coreos, coreos-container-linux, fedora-coreos, flatcar, flatcar-linux
- Language: Go
- Homepage: https://caddyserver.com/docs/modules/http.handlers.ct
- Size: 509 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Container Linux Config Transpiler for Caddy
The `caddy-ct` module for Caddy allows to transpile YAML based configuration into a JSON `ignition` to be used with
[Flatcar](https://www.kinvolk.io/flatcar-container-linux/) or
[Fedora CoreOS](https://getfedora.org/en/coreos?stream=stable).
It targets to replace [Matchbox](https://matchbox.psdn.io/) with an open and flexible approach of templating,
matching and providing metadata using Caddy's `templates` for static configurations (no API for terraform).
## Configuration
```
ct [] {
strict
mime []
platform
}
```
All options are optional:
- `matcher` according to [matcher](https://caddyserver.com/docs/caddyfile/concepts#matchers)
- `strict` fail on non critical errors (default: false)
- `mime` only transpile specific MIME types (default: all)
- `platform` only for
[dynamic data](https://kinvolk.io/docs/flatcar-container-linux/latest/provisioning/config-transpiler/dynamic-data/)
must be one of
[those](https://github.com/kinvolk/container-linux-config-transpiler/blob/flatcar-master/config/platform/platform.go#L17)
(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](https://caddyserver.com/docs/caddyfile/directives/route) block.
## Example Caddyfile
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
}
}
```
## Building
See [xcaddy](https://github.com/caddyserver/xcaddy), short:
```
xcaddy build \
--with github.com/cubic3d/caddy-ct
```
or download from https://caddyserver.com/download by selecting this module.