mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-08-05 06:45:35 +02:00
Merge 1108c2eb63
into f2f06fcf3f
This commit is contained in:
commit
22f0d15482
1 changed files with 15 additions and 0 deletions
15
settings.js
15
settings.js
|
@ -48,6 +48,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