This commit is contained in:
a 2024-09-17 16:28:33 -05:00
parent 6e3abf388e
commit 447066e7c2
No known key found for this signature in database
GPG Key ID: 374BC539FE795AF0
2 changed files with 5 additions and 5 deletions

View File

@ -274,8 +274,8 @@ func (st ServerType) Setup(
if !reflect.DeepEqual(pkiApp, &caddypki.PKI{CAs: make(map[string]*caddypki.CA)}) { if !reflect.DeepEqual(pkiApp, &caddypki.PKI{CAs: make(map[string]*caddypki.CA)}) {
cfg.AppsRaw["pki"] = caddyconfig.JSON(pkiApp, &warnings) cfg.AppsRaw["pki"] = caddyconfig.JSON(pkiApp, &warnings)
} }
if filesystems, ok := options["filesystem"].(caddy.Module); ok { if filesystems, ok := options["file_systems"].(caddy.Module); ok {
cfg.AppsRaw["filesystems"] = caddyconfig.JSON( cfg.AppsRaw["file_systems"] = caddyconfig.JSON(
filesystems, filesystems,
&warnings) &warnings)
} }

View File

@ -15,7 +15,7 @@ import (
func init() { func init() {
caddy.RegisterModule(Filesystems{}) caddy.RegisterModule(Filesystems{})
httpcaddyfile.RegisterGlobalOption("filesystem", parseFilesystems) httpcaddyfile.RegisterGlobalOption("file_systems", parseFilesystems)
} }
type moduleEntry struct { type moduleEntry struct {
@ -26,7 +26,7 @@ type moduleEntry struct {
// Filesystems loads caddy.fs modules into the global filesystem map // Filesystems loads caddy.fs modules into the global filesystem map
type Filesystems struct { type Filesystems struct {
Filesystems []*moduleEntry `json:"filesystems"` Filesystems []*moduleEntry `json:"file_systems"`
defers []func() defers []func()
} }
@ -49,7 +49,7 @@ func parseFilesystems(d *caddyfile.Dispenser, existingVal any) (any, error) {
// CaddyModule returns the Caddy module information. // CaddyModule returns the Caddy module information.
func (Filesystems) CaddyModule() caddy.ModuleInfo { func (Filesystems) CaddyModule() caddy.ModuleInfo {
return caddy.ModuleInfo{ return caddy.ModuleInfo{
ID: "filesystems", ID: "file_systems",
New: func() caddy.Module { return new(Filesystems) }, New: func() caddy.Module { return new(Filesystems) },
} }
} }