Fix: Use JSON config files for ESM compatibility
- Replace @simpleworkjs/conf with simple custom loader - Use JSON config files (base, development, production, secrets) - Add config.js with ESM-compatible deep merge - Support env var overrides for critical settings - Auth disabled in dev mode via development.json
This commit is contained in:
@@ -18,11 +18,11 @@ import { join, dirname } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
import ldap from 'ldapjs';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import conf from '@simpleworkjs/conf';
|
||||
import conf from './config.js';
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
// Configuration via @simpleworkjs/conf
|
||||
// Configuration
|
||||
const CONFIG = {
|
||||
port: conf.server?.port || 3000,
|
||||
gatewayUrl: conf.gateway?.url || 'http://127.0.0.1:18789',
|
||||
@@ -38,7 +38,8 @@ const CONFIG = {
|
||||
bindPassword: conf.auth?.ldap?.bindPassword || '',
|
||||
searchFilter: conf.auth?.ldap?.searchFilter || '(uid={{username}})'
|
||||
},
|
||||
dataDir: conf.data?.dir || join(__dirname, '../data')
|
||||
dataDir: conf.data?.dir || join(__dirname, '../data'),
|
||||
environment: conf.environment
|
||||
};
|
||||
|
||||
// Ensure data directory exists
|
||||
|
||||
Reference in New Issue
Block a user