Fix NanoLimbo port not applying to an existing settings.yml (#4201)

This commit is contained in:
OowhitecatoO
2026-07-31 07:56:18 -05:00
committed by GitHub
parent 8fde0cac2a
commit 749f8f635f
5 changed files with 45 additions and 10 deletions
+12 -8
View File
@@ -1,12 +1,16 @@
{
"file": "/data/settings.yml",
"ops": [
"patches": [
{
"$set": {
"path": "$.bind.port",
"value": "${SERVER_PORT}",
"value-type": "int"
}
"file": "/data/settings.yml",
"ops": [
{
"$set": {
"path": "$.bind.port",
"value": "${SERVER_PORT}",
"value-type": "int"
}
}
]
}
]
}
}
+2 -2
View File
@@ -158,10 +158,10 @@ traffic:
# Ignored if -1.0
maxPacketBytesRate: 2048.0
EOF
else
mc-image-helper patch --patch-env-prefix "" /image/nanolimbo-settings-patch.json
fi
mc-image-helper patch --patch-env-prefix "" /image/nanolimbo-settings-patch.json
export SERVER
export FAMILY=LIMBO
@@ -0,0 +1,23 @@
services:
# copies seed/ into /data before mc starts, so the NanoLimbo setup takes its
# "settings.yml already exists" path instead of writing the template
seed:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
entrypoint: ["bash", "-c", "cp /seed/settings.yml /data/ && chown -R 1000:1000 /data"]
volumes:
- ./seed:/seed
- ./data:/data
mc:
restart: "no"
image: ${IMAGE_TO_TEST:-itzg/minecraft-server}
depends_on:
seed:
condition: service_completed_successfully
environment:
EULA: "TRUE"
TYPE: NANOLIMBO
SERVER_PORT: "25599"
volumes:
- ./data:/data
@@ -0,0 +1,4 @@
bind:
ip: '0.0.0.0'
port: 25565
maxPlayers: 100
@@ -0,0 +1,4 @@
set -e
# SERVER_PORT must have been applied to the settings.yml that was already there
port=$(mc-image-helper yaml-path --file /data/settings.yml .bind.port)
[ "$port" = 25599 ] || { echo "expected bind.port 25599 but was '$port'"; exit 1; }