summaryrefslogtreecommitdiff
path: root/lib/config
diff options
context:
space:
mode:
authorChristoph (Sheogorath) Kern2018-03-21 14:13:32 +0100
committerGitHub2018-03-21 14:13:32 +0100
commit6485f9665976adfc3dc17233c1922efb89e5d43a (patch)
tree9b5356ada5cda0e1a5cf0a1eb7e81398622e139b /lib/config
parent6e6a98b392f78567e98a9b49ff0dd193f885e242 (diff)
parent1756e76dc31495d03c8792fa672ae6bb94d24ea8 (diff)
Merge pull request #771 from SISheogorath/refactor/imageRouter
Refactoring imageRouter to modularity
Diffstat (limited to 'lib/config')
-rw-r--r--lib/config/index.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/config/index.js b/lib/config/index.js
index 0051e485..abcd2b3e 100644
--- a/lib/config/index.js
+++ b/lib/config/index.js
@@ -6,6 +6,7 @@ const path = require('path')
const {merge} = require('lodash')
const deepFreeze = require('deep-freeze')
const {Environment, Permission} = require('./enum')
+const logger = require('../logger')
const appRootPath = path.join(__dirname, '../../')
const env = process.env.NODE_ENV || Environment.development
@@ -103,6 +104,12 @@ if (config.imageUploadType && !config.imageuploadtype) {
config.imageuploadtype = config.imageUploadType
}
+// Validate upload upload providers
+if (['filesystem', 's3', 'minio', 'imgur'].indexOf(config.imageuploadtype) === -1) {
+ logger.error('"imageuploadtype" is not correctly set. Please use "filesystem", "s3", "minio" or "imgur". Defaulting to "imgur"')
+ config.imageuploadtype = 'imgur'
+}
+
// figure out mime types for image uploads
switch (config.imageuploadtype) {
case 'imgur':