mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-08-05 06:45:35 +02:00
Update settings.js
This commit is contained in:
parent
7d45e37e3d
commit
e6529c17de
1 changed files with 15 additions and 0 deletions
15
settings.js
15
settings.js
|
@ -47,6 +47,21 @@ const settings = {
|
||||||
}
|
}
|
||||||
|
|
||||||
// these environment variables override certain settings
|
// these environment variables override certain settings
|
||||||
|
if (process.env.SETTINGS_PATH) {
|
||||||
|
try {
|
||||||
|
const cfgPath = path.resolve(process.env.SETTINGS_PATH);
|
||||||
|
if (fs.existsSync(cfgPath)) {
|
||||||
|
const raw = fs.readFileSync(cfgPath, 'utf-8');
|
||||||
|
const overrides = JSON.parse(raw);
|
||||||
|
Object.assign(settings, overrides);
|
||||||
|
console.log(`⚡️ Loaded overrides from ${cfgPath}`);
|
||||||
|
} else {
|
||||||
|
console.warn(`⚠️ SETTINGS_PATH file not found: ${cfgPath}`);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.error("🔴 Failed to load SETTINGS_PATH overrides:", err);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (process.env.MINECRAFT_PORT) {
|
if (process.env.MINECRAFT_PORT) {
|
||||||
settings.port = process.env.MINECRAFT_PORT;
|
settings.port = process.env.MINECRAFT_PORT;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue