mirror of
https://github.com/caddyserver/caddy.git
synced 2025-06-01 09:02:50 +08:00
Refactor for CertMagic v0.10; prepare for PKI app
This is a breaking change primarily in two areas: - Storage paths for certificates have changed - Slight changes to JSON config parameters Huge improvements in this commit, to be detailed more in the release notes. The upcoming PKI app will be powered by Smallstep libraries.
This commit is contained in:
10
context.go
10
context.go
@ -21,7 +21,7 @@ import (
|
||||
"log"
|
||||
"reflect"
|
||||
|
||||
"github.com/mholt/certmagic"
|
||||
"github.com/caddyserver/certmagic"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@ -384,9 +384,13 @@ func (ctx Context) App(name string) (interface{}, error) {
|
||||
if app, ok := ctx.cfg.apps[name]; ok {
|
||||
return app, nil
|
||||
}
|
||||
modVal, err := ctx.LoadModuleByID(name, nil)
|
||||
appRaw := ctx.cfg.AppsRaw[name]
|
||||
modVal, err := ctx.LoadModuleByID(name, appRaw)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("instantiating new module %s: %v", name, err)
|
||||
return nil, fmt.Errorf("loading %s app module: %v", name, err)
|
||||
}
|
||||
if appRaw != nil {
|
||||
ctx.cfg.AppsRaw[name] = nil // allow GC to deallocate
|
||||
}
|
||||
ctx.cfg.apps[name] = modVal.(App)
|
||||
return modVal, nil
|
||||
|
Reference in New Issue
Block a user