support test usecase to not put logs in /var/log

This commit is contained in:
Johannes Zellner
2018-06-04 11:48:22 +02:00
parent 372a17dc37
commit e9400e5dce
4 changed files with 11 additions and 7 deletions

View File

@@ -2,6 +2,7 @@
exports = module.exports = {
baseDir: baseDir,
logDir: logDir,
// values set here will be lost after a upgrade/update. use the sqlite database
// for persistent values that need to be backed up
@@ -61,6 +62,11 @@ function baseDir() {
if (exports.TEST) return path.join(homeDir, '.cloudron_test');
}
function logDir() {
if (exports.CLOUDRON) return '/var/log';
if (exports.TEST) return path.join(homeDir, '.cloudron_test', 'log');
}
var cloudronConfigFileName = path.join(baseDir(), 'configs/cloudron.conf');
// only tests can run without a config file on disk, they use the defaults with runtime overrides