[add] fs allows access to the app root directory ( it's an dangerous operation, be careful to use it)

This commit is contained in:
Max 2024-06-25 17:08:54 +08:00
parent 7bee60c67c
commit 00f10cd630

View file

@ -15,8 +15,11 @@ func Load(cfg config.Config) error {
scriptRoot := filepath.Join(cfg.AppSource, "scripts")
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("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
}