summaryrefslogtreecommitdiff
path: root/lib/config/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/config/index.js')
-rw-r--r--lib/config/index.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/config/index.js b/lib/config/index.js
index 79330443..8705b10b 100644
--- a/lib/config/index.js
+++ b/lib/config/index.js
@@ -33,6 +33,7 @@ merge(config, debugConfig)
merge(config, packageConfig)
merge(config, fileConfig)
merge(config, require('./oldEnvironment'))
+merge(config, require('./hackmdEnvironment'))
merge(config, require('./environment'))
merge(config, require('./dockerSecret'))
@@ -122,6 +123,11 @@ for (let i = keys.length; i--;) {
}
}
+// Notify users about the prefix change and inform them they use legacy prefix for environment variables
+if (Object.keys(process.env).toString().indexOf('HMD_') !== -1) {
+ logger.warn('Using legacy HMD prefix for environment variables. Please change your variables in future. For details see: https://github.com/hackmdio/codimd#environment-variables-will-overwrite-other-server-configs')
+}
+
// Generate session secret if it stays on default values
if (config.sessionSecret === 'secret') {
logger.warn('Session secret not set. Using random generated one. Please set `sessionSecret` in your config.js file. All users will be logged out.')
@@ -169,7 +175,7 @@ config.tmpPath = path.join(appRootPath, config.tmpPath)
config.defaultNotePath = path.join(appRootPath, config.defaultNotePath)
config.docsPath = path.join(appRootPath, config.docsPath)
config.indexPath = path.join(appRootPath, config.indexPath)
-config.hackmdPath = path.join(appRootPath, config.hackmdPath)
+config.codimdPath = path.join(appRootPath, config.codimdPath)
config.errorPath = path.join(appRootPath, config.errorPath)
config.prettyPath = path.join(appRootPath, config.prettyPath)
config.slidePath = path.join(appRootPath, config.slidePath)