Implement config adapters and beginning of Caddyfile adapter

Along with several other changes, such as renaming caddyhttp.ServerRoute
to caddyhttp.Route, exporting some types that were not exported before,
and tweaking the caddytls TLS values to be more consistent.

Notably, we also now disable automatic cert management for names which
already have a cert (manually) loaded into the cache. These names no
longer need to be specified in the "skip_certificates" field of the
automatic HTTPS config, because they will be skipped automatically.
This commit is contained in:
Matthew Holt
2019-08-09 12:05:47 -06:00
parent 4950ce485f
commit ab885f07b8
54 changed files with 4875 additions and 232 deletions

View File

@ -96,8 +96,10 @@ func StartAdmin(initialConfigJSON []byte) error {
///// END PPROF STUFF //////
for _, m := range GetModules("admin") {
route := m.New().(AdminRoute)
mux.Handle(route.Pattern, route)
routes := m.New().([]AdminRoute)
for _, route := range routes {
mux.Handle(route.Pattern, route)
}
}
handler := cors.Default().Handler(mux)