From b3bafa4ba8b63dff7adb53f31060a4421af13c68 Mon Sep 17 00:00:00 2001 From: kirrg001 Date: Tue, 13 Sep 2016 18:20:44 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=20=F0=9F=94=A6=20=20restrict=20?= =?UTF-8?q?themes=20storage=20to=20local-file-store?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs #6982 - this was handled before by the old ConfigManager - this logic belongs into the storage logic itself - for now we only allow uploading themes via the local-file-store [ci skip] --- core/server/storage/index.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/server/storage/index.js b/core/server/storage/index.js index 49d868cd19d..2fa85d91774 100644 --- a/core/server/storage/index.js +++ b/core/server/storage/index.js @@ -11,7 +11,15 @@ function getStorage(type) { type = type || 'images'; var storageChoice = config.get('storage').active[type], - storageConfig = config.get('storage')[storageChoice]; + storageConfig; + + // CASE: we only allow local-file-storage for themes + // @TODO: https://github.com/TryGhost/Ghost/issues/7246 + if (type === 'themes') { + storageChoice = 'local-file-store'; + } + + storageConfig = config.get('storage')[storageChoice]; // CASE: type does not exist if (!storageChoice) {