From b242b59db4b27bac345d98f982def7c54955c84c Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Sun, 24 Jun 2018 13:22:51 +0200 Subject: Rename environment variables and add legacy support. As we are no longer HackMD the short tag `HMD` doesn't match anymore. We move it to the matching prefix `CMD` and inform our users about the change. Signed-off-by: Sheogorath --- lib/config/index.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/config/index.js') diff --git a/lib/config/index.js b/lib/config/index.js index 79330443..760d94a1 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.') -- cgit v1.2.3 From 23c33c0c046a9a27b2a31d334f6f818d8b1b3459 Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Sun, 24 Jun 2018 13:37:46 +0200 Subject: Rename HackMD view to CodiMD Even when it looks a bit weird in first place to rename all internals step by step, it makes sense to do so, because we run into confusion afterwards. Signed-off-by: Sheogorath --- lib/config/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/config/index.js') diff --git a/lib/config/index.js b/lib/config/index.js index 760d94a1..8705b10b 100644 --- a/lib/config/index.js +++ b/lib/config/index.js @@ -175,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) -- cgit v1.2.3