mirror of
https://github.com/caddyserver/caddy.git
synced 2025-03-09 07:29:03 -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)
|
||||
}
|
||||
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