patch config parsing

This commit is contained in:
A.Unger
2021-03-05 14:08:40 +01:00
parent bb2431839d
commit 277ccc8b82
12 changed files with 38 additions and 27 deletions
+3 -2
View File
@@ -70,7 +70,7 @@ func Groups(cfg *config.Config) *cli.Command {
// precreate folders
if cfg.Reva.Groups.Driver == "json" && cfg.Reva.Groups.JSON != "" {
if err := os.MkdirAll(filepath.Dir(cfg.Reva.Groups.JSON), os.ModeExclusive); err != nil {
if err := os.MkdirAll(filepath.Dir(cfg.Reva.Groups.JSON), os.FileMode(0700)); err != nil {
return err
}
}
@@ -222,8 +222,9 @@ type GroupsProvider struct {
}
// NewGroupsProvider creates a new storage.GroupsProvider
func NewGroupsProvider(ctx context.Context, cfg *config.Config) GroupsProvider {
func NewGroupsProvider(ctx context.Context) GroupsProvider {
sctx, cancel := context.WithCancel(ctx)
cfg := config.New()
cfg.Context = sctx
return GroupsProvider{
ctx: sctx,