From 841e5ae8ad20d9d698e9ed4758adf337e28e4a07 Mon Sep 17 00:00:00 2001 From: Artur Wierzbicki Date: Mon, 18 Jul 2022 19:37:22 +0400 Subject: [PATCH] Storage: `system/branding` storage (#51987) * Storage: add `system` branding storage root, expose `system/branding` subfolder * Storage: merge --- pkg/services/store/service.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkg/services/store/service.go b/pkg/services/store/service.go index 50ab7da657d..f251484956b 100644 --- a/pkg/services/store/service.go +++ b/pkg/services/store/service.go @@ -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 }