fixing default configs

This commit is contained in:
orangecoding
2025-12-10 09:24:44 +01:00
parent 1e2476a375
commit cef9b5c8fc
4 changed files with 8 additions and 7 deletions

View File

@@ -3,6 +3,8 @@ import fs from 'fs';
import path from 'path';
import { nanoid } from 'nanoid';
import logger from '../../../logger.js';
import { DEFAULT_CONFIG } from '../../../../defaultConfig.js';
import { getDirName } from '../../../../utils.js';
export function up(db) {
db.exec(`
@@ -67,6 +69,10 @@ export function up(db) {
'analyticsEnabled',
config.analyticsEnabled != null ? config.analyticsEnabled : defaults.analyticsEnabled,
);
//now making sure only sqlite path remains in the config
const sqlitepath = config.sqlitepath || DEFAULT_CONFIG.sqlitepath;
fs.writeFileSync(`${getDirName()}/../conf/config.json`, JSON.stringify({ sqlitepath }));
} catch (e) {
logger.error(e);
}

View File

@@ -22,8 +22,8 @@ function compileSettings(rows, configValues) {
config[r.name] = parsed && typeof parsed === 'object' && 'value' in parsed ? parsed.value : parsed;
}
return {
...config,
...configValues,
...config,
};
}