From c1cd32eeb5f452043d066f6d9a6e3ca8dacec68e Mon Sep 17 00:00:00 2001 From: SysAdmin Date: Thu, 23 Apr 2026 11:45:17 +0100 Subject: [PATCH] fix(compose): remove server.properties-aliased env vars so UI edits persist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The itzg/minecraft-bedrock-server entrypoint rewrites server.properties from env vars on every start. Any property edited via mc-manager's UI was being clobbered because those env vars were set here. Remove them so /data/server.properties (on the named volume) is the real source of truth: - SERVER_NAME, GAMEMODE, DIFFICULTY, ALLOW_CHEATS, ONLINE_MODE, MAX_PLAYERS, DEFAULT_PLAYER_PERMISSION_LEVEL - LEVEL_SEED (jamie) — world already generated - LEVEL_NAME — moved to docker-compose.override.yml, managed by mc-manager so UI Set Active survives future deploys Kept: EULA, SERVER_PORT (deploy-time wiring), OP_PERMISSION_LEVEL (not a server.properties key). Override file is gitignored so mc-manager's writes don't leak into git. Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitignore | 4 ++++ docker-compose.yml | 40 +++++++--------------------------------- 2 files changed, 11 insertions(+), 33 deletions(-) diff --git a/.gitignore b/.gitignore index 48b4aca..85a42b8 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,10 @@ addon/build/ # Environment .env +# docker-compose override, managed by mc-manager at runtime for per-service state +# (LEVEL_NAME, etc.) that must survive deploys. Never committed. +docker-compose.override.yml + # Server data (Docker volumes are external, but just in case) server-data/ diff --git a/docker-compose.yml b/docker-compose.yml index a265497..e3a1760 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,16 +4,13 @@ services: container_name: mc-lobby environment: EULA: "TRUE" - SERVER_NAME: "SilverLABS Hub" - GAMEMODE: adventure - DIFFICULTY: peaceful - ALLOW_CHEATS: "true" - ONLINE_MODE: "false" SERVER_PORT: "19132" - LEVEL_NAME: "Hub World" - MAX_PLAYERS: "10" - DEFAULT_PLAYER_PERMISSION_LEVEL: operator OP_PERMISSION_LEVEL: "4" + # Other server.properties-aliased env vars (SERVER_NAME, GAMEMODE, DIFFICULTY, + # ALLOW_CHEATS, ONLINE_MODE, MAX_PLAYERS, DEFAULT_PLAYER_PERMISSION_LEVEL) are + # intentionally not set here — they're owned by /data/server.properties inside + # the named volume and edited via mc-manager's UI. LEVEL_NAME lives in + # docker-compose.override.yml on the host (managed by mc-manager, gitignored). ports: - "${LOBBY_PORT:-19132}:19132/udp" volumes: @@ -44,17 +41,10 @@ services: container_name: mc-jamie environment: EULA: "TRUE" - SERVER_NAME: "Jamie's World" - GAMEMODE: survival - DIFFICULTY: normal - ALLOW_CHEATS: "true" - ONLINE_MODE: "false" SERVER_PORT: "19132" - LEVEL_NAME: "Jamie World" - LEVEL_SEED: "-6717666844935858147" - MAX_PLAYERS: "10" - DEFAULT_PLAYER_PERMISSION_LEVEL: operator OP_PERMISSION_LEVEL: "4" + # See lobby for rationale. LEVEL_SEED is dropped too — the world has long since + # been generated and the seed is ignored thereafter. ports: - "${JAMIE_PORT:-19133}:19132/udp" volumes: @@ -78,15 +68,7 @@ services: container_name: mc-lyla environment: EULA: "TRUE" - SERVER_NAME: "Lyla's World" - GAMEMODE: survival - DIFFICULTY: normal - ALLOW_CHEATS: "true" - ONLINE_MODE: "false" SERVER_PORT: "19132" - LEVEL_NAME: "Lyla World" - MAX_PLAYERS: "10" - DEFAULT_PLAYER_PERMISSION_LEVEL: operator OP_PERMISSION_LEVEL: "4" ports: - "${LYLA_PORT:-19134}:19132/udp" @@ -119,15 +101,7 @@ services: container_name: mc-mya environment: EULA: "TRUE" - SERVER_NAME: "Mya's World" - GAMEMODE: survival - DIFFICULTY: normal - ALLOW_CHEATS: "true" - ONLINE_MODE: "false" SERVER_PORT: "19132" - LEVEL_NAME: "Mya World" - MAX_PLAYERS: "10" - DEFAULT_PLAYER_PERMISSION_LEVEL: operator OP_PERMISSION_LEVEL: "4" ports: - "${MYA_PORT:-19135}:19132/udp"