3 ms·
I wrote a config adapter for Caddy so you can write your Caddy configs with Pkl: https://github.com/caddyserver/pkl-adapter https://github.com/caddyserver/pkl-a
by mholt 3y ago
I wrote a config adapter for Caddy so you can write your Caddy configs with Pkl: https://github.com/caddyserver/pkl-adapter https://github.com/caddyserver/pkl-adapter
The big gotcha is it's only implemented in Java. So any language bindings have to shell out to a subprocess to actually do any work.
- bioballer 3y agoVery cool! You might want to consider also publishing a schema for it too, as a Pkl package. The package can simply be published as a GitHub release (see details in this post here: https://github.com/apple/pkl/discussions/85#discussioncomment-8394334 https://github.com/apple/pkl/discussions/85#discussioncommen...) Also, despite being written in Java, Pkl is distributed as a native executable for macOS and Linux (Windows coming soon). But yeah, you do need the executable installed on your system in order for our pkl-go bindings to work.
- bbkane 3y agoNeeding the pkl CLI adds a runtime dependency I'd rather not have. Is there any way to use pkl from Go without needing to shell out? Maybe Go library that calls a wasm blob or something?
- parhamn 3y agoThats awesome, look forward to trying it. If you really forced me to say anything negative about caddy (it's such a delightful tool), would be the config and the configs docs/validation. Relatedly, I feel like just having some cargo cultable config examples for basic setups would be great.
- mholt 3y agoThanks for the feedback - we're working on new docs this year actually :)