Storage: system/branding storage (#51987)

* Storage: add `system` branding storage root, expose `system/branding` subfolder

* Storage: merge
This commit is contained in:
Artur Wierzbicki
2022-07-18 19:37:22 +04:00
committed by GitHub
parent e7feff6d99
commit 841e5ae8ad

View File

@@ -28,6 +28,9 @@ var ErrAccessDenied = errors.New("access denied")
const RootPublicStatic = "public-static"
const RootResources = "resources"
const RootDevenv = "devenv"
const RootSystem = "system"
const SystemBrandingStorage = "system/branding"
const MAX_UPLOAD_SIZE = 1 * 1024 * 1024 // 3MB
@@ -114,6 +117,13 @@ func ProvideService(sql *sqlstore.SQLStore, features featuremgmt.FeatureToggles,
setDescription("Upload custom resource files"))
}
storages = append(storages,
newSQLStorage(RootSystem,
"System",
&StorageSQLConfig{orgId: orgId},
sql,
).setBuiltin(true).setDescription("Grafana system storage"))
return storages
}
@@ -141,6 +151,12 @@ func ProvideService(sql *sqlstore.SQLStore, features featuremgmt.FeatureToggles,
ActionFilesWrite: allowAllPathFilter,
ActionFilesDelete: allowAllPathFilter,
}
case RootSystem:
return map[string]filestorage.PathFilter{
ActionFilesRead: allowAllPathFilter,
ActionFilesWrite: allowAllPathFilter,
ActionFilesDelete: allowAllPathFilter,
}
default:
return nil
}