Allowing data dir to be overridden (#480)

* allowing data dir to be overridden

* release notes

* Update load-config.js
This commit is contained in:
Michael Clark
2024-10-15 20:20:42 +01:00
committed by GitHub
parent a8c4c5fa23
commit c30981638e
2 changed files with 11 additions and 1 deletions

View File

@@ -11,6 +11,11 @@ debug(`project root: '${projectRoot}'`);
export const sqlDir = path.join(projectRoot, 'src', 'sql');
let defaultDataDir = fs.existsSync('/data') ? '/data' : projectRoot;
if (process.env.ACTUAL_DATA_DIR) {
defaultDataDir = process.env.ACTUAL_DATA_DIR;
}
debug(`default data directory: '${defaultDataDir}'`);
function parseJSON(path, allowMissing = false) {
@@ -135,7 +140,6 @@ const finalConfig = {
}
: config.upload,
};
debug(`using port ${finalConfig.port}`);
debug(`using hostname ${finalConfig.hostname}`);
debug(`using data directory ${finalConfig.dataDir}`);

View File

@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [MikesGlitch]
---
Allow data directory to be overridden by env variable