summaryrefslogtreecommitdiff
path: root/lib/config
diff options
context:
space:
mode:
authorChristoph (Sheogorath) Kern2019-04-10 11:39:11 +0200
committerGitHub2019-04-10 11:39:11 +0200
commitef348fc49b01711aaea3c0b68cdd9fa77876c596 (patch)
tree496225cc71133387b3c6e51b899d9a91d204f420 /lib/config
parentf541c00bad561672c91bb0249acd8e6ce2f58a9e (diff)
parent208070d2e776c437154e6ead552364b3956adf1c (diff)
Merge pull request #33 from codimd/lutim-support
Add support for image hosting with lutim
Diffstat (limited to '')
-rw-r--r--lib/config/default.js5
-rw-r--r--lib/config/environment.js3
-rw-r--r--lib/config/index.js4
3 files changed, 9 insertions, 3 deletions
diff --git a/lib/config/default.js b/lib/config/default.js
index 98ccee91..c87beda3 100644
--- a/lib/config/default.js
+++ b/lib/config/default.js
@@ -58,8 +58,11 @@ module.exports = {
heartbeatTimeout: 10000,
// document
documentMaxLength: 100000,
- // image upload setting, available options are imgur/s3/filesystem/azure
+ // image upload setting, available options are imgur/s3/filesystem/azure/lutim
imageUploadType: 'filesystem',
+ lutim: {
+ url: 'https://framapic.org/'
+ },
imgur: {
clientID: undefined
},
diff --git a/lib/config/environment.js b/lib/config/environment.js
index 882df140..508c1ba6 100644
--- a/lib/config/environment.js
+++ b/lib/config/environment.js
@@ -49,6 +49,9 @@ module.exports = {
secure: toBooleanConfig(process.env.CMD_MINIO_SECURE),
port: toIntegerConfig(process.env.CMD_MINIO_PORT)
},
+ lutim: {
+ url: process.env.CMD_LUTIM_URL
+ },
s3bucket: process.env.CMD_S3_BUCKET,
azure: {
connectionString: process.env.CMD_AZURE_CONNECTION_STRING,
diff --git a/lib/config/index.js b/lib/config/index.js
index 4c28196e..e102dce9 100644
--- a/lib/config/index.js
+++ b/lib/config/index.js
@@ -164,8 +164,8 @@ if (config.sessionSecret === 'secret') {
}
// Validate upload upload providers
-if (['filesystem', 's3', 'minio', 'imgur', 'azure'].indexOf(config.imageUploadType) === -1) {
- logger.error('"imageuploadtype" is not correctly set. Please use "filesystem", "s3", "minio", "azure" or "imgur". Defaulting to "filesystem"')
+if (['filesystem', 's3', 'minio', 'imgur', 'azure', 'lutim'].indexOf(config.imageUploadType) === -1) {
+ logger.error('"imageuploadtype" is not correctly set. Please use "filesystem", "s3", "minio", "azure", "lutim" or "imgur". Defaulting to "filesystem"')
config.imageUploadType = 'filesystem'
}