mirror of
https://github.com/caddyserver/caddy.git
synced 2025-03-09 15:39:02 -04:00
Merge 07a21a8d5b2624eece752f68486f6a4189af830a into fd4de7e0ae4debd54e2a9a4aba10947cd4c3b178
This commit is contained in:
commit
b3aaf5d54b
@ -289,7 +289,7 @@ func (st ServerType) Setup(
|
||||
cfg.AppsRaw["pki"] = caddyconfig.JSON(pkiApp, &warnings)
|
||||
}
|
||||
if filesystems, ok := options["filesystem"].(caddy.Module); ok {
|
||||
cfg.AppsRaw["caddy.filesystems"] = caddyconfig.JSON(
|
||||
cfg.AppsRaw["file_systems"] = caddyconfig.JSON(
|
||||
filesystems,
|
||||
&warnings)
|
||||
}
|
||||
|
@ -18,6 +18,10 @@ type wrapperFs struct {
|
||||
fs.FS
|
||||
}
|
||||
|
||||
func (w *wrapperFs) Unwrap() fs.FS {
|
||||
return w.FS
|
||||
}
|
||||
|
||||
// FilesystemMap stores a map of filesystems
|
||||
// the empty key will be overwritten to be the default key
|
||||
// it includes a default filesystem, based off the os fs
|
||||
|
@ -20,13 +20,13 @@ func init() {
|
||||
|
||||
type moduleEntry struct {
|
||||
Key string `json:"name,omitempty"`
|
||||
FileSystemRaw json.RawMessage `json:"file_system,omitempty" caddy:"namespace=caddy.fs inline_key=backend"`
|
||||
FileSystemRaw json.RawMessage `json:"filesystem,omitempty" caddy:"namespace=caddy.fs inline_key=backend"`
|
||||
fileSystem fs.FS
|
||||
}
|
||||
|
||||
// Filesystems loads caddy.fs modules into the global filesystem map
|
||||
type Filesystems struct {
|
||||
Filesystems []*moduleEntry `json:"filesystems"`
|
||||
Filesystems []*moduleEntry `json:"file_systems"`
|
||||
|
||||
defers []func()
|
||||
}
|
||||
@ -49,7 +49,7 @@ func parseFilesystems(d *caddyfile.Dispenser, existingVal any) (any, error) {
|
||||
// CaddyModule returns the Caddy module information.
|
||||
func (Filesystems) CaddyModule() caddy.ModuleInfo {
|
||||
return caddy.ModuleInfo{
|
||||
ID: "caddy.filesystems",
|
||||
ID: "file_systems",
|
||||
New: func() caddy.Module { return new(Filesystems) },
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user