diff options
author | WilliButz | 2018-09-05 19:56:41 +0200 |
---|---|---|
committer | WilliButz | 2018-09-26 16:56:37 +0200 |
commit | 556783ffad2e26c490c0d9d9520d7ee13a750dbb (patch) | |
tree | 088600923e087be24af640c8f01e1a4857fba06d | |
parent | e48852e0e2de4441b5ef84dc9bb16be8ba9c01d8 (diff) |
lib/config: use `path.resolve` instead of `path.join`
While paths like `tmpPath` could previously be configured,
they were all interpreted relative to `appRootPath` because
of `path.join`.
Now the configurable paths can be canonical and therefore
independent of the `appRootPath`.
Signed-off-by: WilliButz <wbutz@cyberfnord.de>
Diffstat (limited to '')
-rw-r--r-- | lib/config/index.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/config/index.js b/lib/config/index.js index 76c8bbf1..59db8612 100644 --- a/lib/config/index.js +++ b/lib/config/index.js @@ -174,20 +174,20 @@ config.sslCAPath.forEach(function (capath, i, array) { array[i] = path.resolve(appRootPath, capath) }) -config.sslCertPath = path.join(appRootPath, config.sslCertPath) -config.sslKeyPath = path.join(appRootPath, config.sslKeyPath) -config.dhParamPath = path.join(appRootPath, config.dhParamPath) - -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.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) -config.constantsPath = path.join(appRootPath, config.constantsPath) -config.uploadsPath = path.join(appRootPath, config.uploadsPath) +config.sslCertPath = path.resolve(appRootPath, config.sslCertPath) +config.sslKeyPath = path.resolve(appRootPath, config.sslKeyPath) +config.dhParamPath = path.resolve(appRootPath, config.dhParamPath) + +config.tmpPath = path.resolve(appRootPath, config.tmpPath) +config.defaultNotePath = path.resolve(appRootPath, config.defaultNotePath) +config.docsPath = path.resolve(appRootPath, config.docsPath) +config.indexPath = path.resolve(appRootPath, config.indexPath) +config.codimdPath = path.resolve(appRootPath, config.codimdPath) +config.errorPath = path.resolve(appRootPath, config.errorPath) +config.prettyPath = path.resolve(appRootPath, config.prettyPath) +config.slidePath = path.resolve(appRootPath, config.slidePath) +config.constantsPath = path.resolve(appRootPath, config.constantsPath) +config.uploadsPath = path.resolve(appRootPath, config.uploadsPath) // make config readonly config = deepFreeze(config) |