add import script

This commit is contained in:
2026-08-10 17:36:10 +02:00
parent 66386213a1
commit 8cdd4fa69a
4 changed files with 546 additions and 2 deletions

View File

@@ -16,6 +16,18 @@ if (process.env.NODE_ENV === 'production') {
config.main.development = false;
}
if (config.main.development) {
if (!process.env.DB_HOST && (config.sql.host === 'f0ckm-db' || !config.sql.host)) {
config.sql.host = 'localhost';
}
if (!process.env.DB_PORT && config.sql.port === 5432) {
config.sql.port = 5454;
}
if (!process.env.STORAGE_DIR) {
process.env.STORAGE_DIR = 'f0ckm-data';
}
}
// Set timezone from config if not already set via environment variable
if (!process.env.TZ && config.main.timezone) {
process.env.TZ = config.main.timezone;
@@ -57,7 +69,8 @@ config.paths = {
pending: resolvePath('pending'),
deleted: resolvePath('deleted'),
logs: resolvePath('logs'),
tmp: resolvePath('tmp')
tmp: resolvePath('tmp'),
import: storage ? path.resolve(path.join(path.resolve(storage), 'import')) : path.resolve(path.join(base, 'f0ckm-data/import'))
};
export default config;