mirror of
https://github.com/caddyserver/caddy.git
synced 2025-03-09 15:39:02 -04:00
Compare commits
8 Commits
0070a8a810
...
b3aaf5d54b
Author | SHA1 | Date | |
---|---|---|---|
|
b3aaf5d54b | ||
|
07a21a8d5b | ||
|
cf637dbaa6 | ||
|
98ad0a1fd2 | ||
|
447066e7c2 | ||
|
6e3abf388e | ||
|
e94663b866 | ||
|
06ed6fcf99 |
@ -289,7 +289,7 @@ func (st ServerType) Setup(
|
|||||||
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["filesystem"].(caddy.Module); ok {
|
||||||
cfg.AppsRaw["caddy.filesystems"] = caddyconfig.JSON(
|
cfg.AppsRaw["file_systems"] = caddyconfig.JSON(
|
||||||
filesystems,
|
filesystems,
|
||||||
&warnings)
|
&warnings)
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,10 @@ type wrapperFs struct {
|
|||||||
fs.FS
|
fs.FS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (w *wrapperFs) Unwrap() fs.FS {
|
||||||
|
return w.FS
|
||||||
|
}
|
||||||
|
|
||||||
// FilesystemMap stores a map of filesystems
|
// FilesystemMap stores a map of filesystems
|
||||||
// the empty key will be overwritten to be the default key
|
// the empty key will be overwritten to be the default key
|
||||||
// it includes a default filesystem, based off the os fs
|
// it includes a default filesystem, based off the os fs
|
||||||
|
@ -20,13 +20,13 @@ func init() {
|
|||||||
|
|
||||||
type moduleEntry struct {
|
type moduleEntry struct {
|
||||||
Key string `json:"name,omitempty"`
|
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
|
fileSystem fs.FS
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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: "caddy.filesystems",
|
ID: "file_systems",
|
||||||
New: func() caddy.Module { return new(Filesystems) },
|
New: func() caddy.Module { return new(Filesystems) },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user