Merge pull request #624 from trheyi/main
[add] fs allows access to the app root directory ( it's an dangerous …
This commit is contained in:
commit
10bbfccc8b
1 changed files with 4 additions and 1 deletions
5
fs/fs.go
5
fs/fs.go
|
|
@ -15,8 +15,11 @@ func Load(cfg config.Config) error {
|
||||||
scriptRoot := filepath.Join(cfg.AppSource, "scripts")
|
scriptRoot := filepath.Join(cfg.AppSource, "scripts")
|
||||||
dslDenyList := []string{scriptRoot, cfg.DataRoot}
|
dslDenyList := []string{scriptRoot, cfg.DataRoot}
|
||||||
|
|
||||||
fs.Register("system", system.New(cfg.DataRoot))
|
fs.Register("system", system.New(cfg.DataRoot)) // alias Data
|
||||||
fs.RootRegister("dsl", dsl.New(cfg.AppSource).DenyAbs(dslDenyList...)) // DSL
|
fs.RootRegister("dsl", dsl.New(cfg.AppSource).DenyAbs(dslDenyList...)) // DSL
|
||||||
fs.RootRegister("script", system.New(scriptRoot)) // Script
|
fs.RootRegister("script", system.New(scriptRoot)) // Script
|
||||||
|
|
||||||
|
fs.Register("app", system.New(cfg.AppSource)) // App Soruce root path, it's an dangerous operation, be careful to use it.
|
||||||
|
fs.Register("data", system.New(cfg.DataRoot)) // Data root
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue