mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-05-09 19:52:58 +00:00
close #21 - still a bit unstable and not revised
This commit is contained in:
parent
a74393619f
commit
e606af4eae
@ -153,12 +153,20 @@ func Parse(c *caddy.Controller) ([]Config, error) {
|
|||||||
return configs, c.ArgErr()
|
return configs, c.ArgErr()
|
||||||
}
|
}
|
||||||
|
|
||||||
cCfg.Rules = append(cCfg.Rules, &Rule{
|
if c.Val() == "dotfiles" {
|
||||||
Regex: false,
|
cCfg.Rules = append(cCfg.Rules, &Rule{
|
||||||
Allow: true,
|
Regex: true,
|
||||||
Path: c.Val(),
|
Allow: true,
|
||||||
Regexp: nil,
|
Regexp: regexp.MustCompile("\\/\\..+"),
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
cCfg.Rules = append(cCfg.Rules, &Rule{
|
||||||
|
Regex: false,
|
||||||
|
Allow: true,
|
||||||
|
Path: c.Val(),
|
||||||
|
Regexp: nil,
|
||||||
|
})
|
||||||
|
}
|
||||||
case "allow_r":
|
case "allow_r":
|
||||||
if !c.NextArg() {
|
if !c.NextArg() {
|
||||||
return configs, c.ArgErr()
|
return configs, c.ArgErr()
|
||||||
@ -175,12 +183,20 @@ func Parse(c *caddy.Controller) ([]Config, error) {
|
|||||||
return configs, c.ArgErr()
|
return configs, c.ArgErr()
|
||||||
}
|
}
|
||||||
|
|
||||||
cCfg.Rules = append(cCfg.Rules, &Rule{
|
if c.Val() == "dotfiles" {
|
||||||
Regex: false,
|
cCfg.Rules = append(cCfg.Rules, &Rule{
|
||||||
Allow: false,
|
Regex: true,
|
||||||
Path: c.Val(),
|
Allow: false,
|
||||||
Regexp: nil,
|
Regexp: regexp.MustCompile("\\/\\..+"),
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
cCfg.Rules = append(cCfg.Rules, &Rule{
|
||||||
|
Regex: false,
|
||||||
|
Allow: false,
|
||||||
|
Path: c.Val(),
|
||||||
|
Regexp: nil,
|
||||||
|
})
|
||||||
|
}
|
||||||
case "block_r":
|
case "block_r":
|
||||||
if !c.NextArg() {
|
if !c.NextArg() {
|
||||||
return configs, c.ArgErr()
|
return configs, c.ArgErr()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user