mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-09-10 12:02:59 +02:00
refactor environment variable settings overrides
This commit is contained in:
parent
2f7d0fac12
commit
2015667b2e
1 changed files with 16 additions and 5 deletions
21
settings.js
21
settings.js
|
@ -1,18 +1,17 @@
|
||||||
export default
|
const settings = {
|
||||||
{
|
|
||||||
"minecraft_version": "1.21.1", // supports up to 1.21.1
|
"minecraft_version": "1.21.1", // supports up to 1.21.1
|
||||||
"host": "127.0.0.1", // or "localhost", "your.ip.address.here"
|
"host": "127.0.0.1", // or "localhost", "your.ip.address.here"
|
||||||
"port": process.env.MINECRAFT_PORT || 55916,
|
"port": 55916,
|
||||||
"auth": "offline", // or "microsoft"
|
"auth": "offline", // or "microsoft"
|
||||||
|
|
||||||
// the mindserver manages all agents and hosts the UI
|
// the mindserver manages all agents and hosts the UI
|
||||||
"host_mindserver": true, // if true, the mindserver will be hosted on this machine. otherwise, specify a public IP address
|
"host_mindserver": true, // if true, the mindserver will be hosted on this machine. otherwise, specify a public IP address
|
||||||
"mindserver_host": "localhost",
|
"mindserver_host": "localhost",
|
||||||
"mindserver_port": process.env.MINDSERVER_PORT || 8080,
|
"mindserver_port": 8080,
|
||||||
|
|
||||||
// the base profile is shared by all bots for default prompts/examples/modes
|
// the base profile is shared by all bots for default prompts/examples/modes
|
||||||
"base_profile": "./profiles/defaults/survival.json", // also see creative.json, god_mode.json
|
"base_profile": "./profiles/defaults/survival.json", // also see creative.json, god_mode.json
|
||||||
"profiles": ((process.env.PROFILES) && JSON.parse(process.env.PROFILES)) || [
|
"profiles": [
|
||||||
"./andy.json",
|
"./andy.json",
|
||||||
// "./profiles/gpt.json",
|
// "./profiles/gpt.json",
|
||||||
// "./profiles/claude.json",
|
// "./profiles/claude.json",
|
||||||
|
@ -46,3 +45,15 @@ export default
|
||||||
"narrate_behavior": true, // chat simple automatic actions ('Picking up item!')
|
"narrate_behavior": true, // chat simple automatic actions ('Picking up item!')
|
||||||
"chat_bot_messages": true, // publicly chat messages to other bots
|
"chat_bot_messages": true, // publicly chat messages to other bots
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// these environment variables override certain settings
|
||||||
|
if (process.env.MINECRAFT_PORT) {
|
||||||
|
settings.port = process.env.MINECRAFT_PORT;
|
||||||
|
}
|
||||||
|
if (process.env.MINDSERVER_PORT) {
|
||||||
|
settings.mindserver_port = process.env.MINDSERVER_PORT;
|
||||||
|
}
|
||||||
|
if (process.env.PROFILES && JSON.parse(process.env.PROFILES).length > 0) {
|
||||||
|
settings.profiles = JSON.parse(process.env.PROFILES);
|
||||||
|
}
|
||||||
|
export default settings;
|
||||||
|
|
Loading…
Add table
Reference in a new issue