An adapter for reading config in YAML
Writing JSON, that too nested, by hand is hard and error prone. I think YAML would be a better option for writing config by hand. Also YAML supports comments. Even though JSON-C and JSON5 does support comments, YAML would be more familiar to people since it's used to configure lot of things now.
Writing config using other options like a Caddyfile, JSON-C and JSON5.
Good idea -- thanks for raising an issue about it.
This should be easy! I bet this can be done in like 10 lines of code. Just take the YAML input, deserialize it, then re-serialize as JSON. If anyone wants to build this, go ahead -- link to it here when you're ready to show it off!
(This isn't something that has to be added to the core repo, at least until #2780 is figured out.)
This should be easy! I bet this can be done in like 10 lines of code. Just take the YAML input, deserialize it, then re-serialize as JSON. If anyone wants to build this, go ahead -- link to it here when you're ready to show it off!
One could use https://github.com/ghodss/yaml - yaml.YAMLToJSON. It handles all the caveats...
I have made an adapter here: https://github.com/iamd3vil/caddy_yaml_adapter
Nice!! Thanks for making that. I'm working on the new website and once it's done we'll be able to add all the modules there for people to find.
@iamd3vil Linked on our new docs page: https://caddyserver.com/docs/config-adapters
Thanks! When the new site is finished, there will probably be a way for you to log in and register its listing.
Most helpful comment
I have made an adapter here: https://github.com/iamd3vil/caddy_yaml_adapter