Caddy Multi Dyna Config
A Caddy 2 config adapter allowing the use of multiple merged configs with dynamic updates automatically picked up by watching file system changes.
Basically:
caddy run -c dyna.json --adapter cmdc
where dyna.json
is something like:
{
"files": ["/etc/caddy/main.caddyfile"],
"dirs": ["/etc/caddy/sites-enabled"]
}
will result in a merge of that main.caddyfile
with all supported files (.json
and .caddyfile
by default, extensible by including more config adapters in your build) under sites-enabled
getting applied as the config,
automatically reloaded upon any change to main.caddyfile
or to sites-enabled
.
Merge happens according to the default rules of go-jsons on the Caddy JSON structure.
Probably don't run this in Very Serious Production Environments :)
License
This is free and unencumbered software released into the public domain.
For more information, please refer to the UNLICENSE
file or unlicense.org.