mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +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()
|
||||
}
|
||||
|
||||
if c.Val() == "dotfiles" {
|
||||
cCfg.Rules = append(cCfg.Rules, &Rule{
|
||||
Regex: true,
|
||||
Allow: true,
|
||||
Regexp: regexp.MustCompile("\\/\\..+"),
|
||||
})
|
||||
} else {
|
||||
cCfg.Rules = append(cCfg.Rules, &Rule{
|
||||
Regex: false,
|
||||
Allow: true,
|
||||
Path: c.Val(),
|
||||
Regexp: nil,
|
||||
})
|
||||
}
|
||||
case "allow_r":
|
||||
if !c.NextArg() {
|
||||
return configs, c.ArgErr()
|
||||
@ -175,12 +183,20 @@ func Parse(c *caddy.Controller) ([]Config, error) {
|
||||
return configs, c.ArgErr()
|
||||
}
|
||||
|
||||
if c.Val() == "dotfiles" {
|
||||
cCfg.Rules = append(cCfg.Rules, &Rule{
|
||||
Regex: true,
|
||||
Allow: false,
|
||||
Regexp: regexp.MustCompile("\\/\\..+"),
|
||||
})
|
||||
} else {
|
||||
cCfg.Rules = append(cCfg.Rules, &Rule{
|
||||
Regex: false,
|
||||
Allow: false,
|
||||
Path: c.Val(),
|
||||
Regexp: nil,
|
||||
})
|
||||
}
|
||||
case "block_r":
|
||||
if !c.NextArg() {
|
||||
return configs, c.ArgErr()
|
||||
|
Loading…
Reference in New Issue
Block a user