From 904faf183241f94ea941b12d17e98e383aa3349e Mon Sep 17 00:00:00 2001 From: Dylan Garvis Date: Tue, 11 Aug 2026 18:25:23 -0400 Subject: [PATCH] fix(docker): use WindMagi offline operator UUID --- README.md | 2 +- compose.test.yml | 4 +++- design/log.md | 7 +++++++ .../us-010-run-local-docker-test-server.md | 2 +- docker/test-ops.json | 8 ++++++++ scripts/start-test-server.sh | 11 +++++++++-- 6 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 docker/test-ops.json diff --git a/README.md b/README.md index 7ac7afa..e12f384 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Build the current plugin and start it on an isolated Spigot 26.2 server: ./scripts/start-test-server.sh ``` -Connect to `localhost:25565` as `WindMagi`, which the harness configures as an operator. The server uses offline mode for local convenience and binds only to the loopback interface. +Connect to `localhost:25565` as `WindMagi`, which the harness configures as a level-4 operator using its deterministic offline-mode UUID. The committed `docker/test-ops.json` fixture replaces local operator state on every startup so the offline UUID remains deterministic. The server uses offline mode for local convenience and binds only to the loopback interface. The first startup may take several minutes while the image downloads and Spigot is prepared. Override the 15-minute wait or local RCON password when needed: diff --git a/compose.test.yml b/compose.test.yml index 4e1b42f..eae5319 100644 --- a/compose.test.yml +++ b/compose.test.yml @@ -11,8 +11,9 @@ services: TYPE: SPIGOT VERSION: "26.2" MEMORY: 2G - OPS: WindMagi ONLINE_MODE: "false" + OPS_FILE: /config/tree-feller-ops.json + OVERRIDE_OPS: "true" ENABLE_RCON: "true" RCON_PASSWORD: "${TREE_FELLER_RCON_PASSWORD:-tree-feller-local-test}" VIEW_DISTANCE: "6" @@ -21,6 +22,7 @@ services: volumes: - ./.docker/minecraft:/data - ./build/libs/tree-feller-0.1.0-SNAPSHOT.jar:/plugins/TreeFeller.jar:ro + - ./docker/test-ops.json:/config/tree-feller-ops.json:ro healthcheck: test: ["CMD", "mc-health"] start_period: 15m diff --git a/design/log.md b/design/log.md index 37bad1e..ff88a3c 100644 --- a/design/log.md +++ b/design/log.md @@ -2,6 +2,13 @@ ## 2026-08-11 +### US-010 offline operator identity corrected + +- Reproduced WindMagi's missing operator privileges and found that name-based image setup stored the online account UUID while offline-mode login assigned deterministic UUID `6a3b6e9f-1a2f-380c-8a75-7a7ca6392c0e`. +- Replaced name-based setup with a synchronized, committed operator fixture containing the exact offline UUID; synchronization intentionally makes WindMagi the sole operator in this isolated test harness. +- Removed the misleading post-start `op WindMagi` check and made startup verify the exact name and UUID in the generated `ops.json`. +- Live restart verification passed: Spigot was healthy, RCON reported TreeFeller, `ops.json` contained only WindMagi at level 4 with the offline UUID, and the server remains available at `localhost:25565`. + ### US-010 local Docker test server completed - Added a repository-local Docker Compose harness using `itzg/minecraft-server:java25` with Spigot 26.2, persistent ignored state, offline local testing, and loopback-only port binding. diff --git a/design/user-stories/us-010-run-local-docker-test-server.md b/design/user-stories/us-010-run-local-docker-test-server.md index 9568480..9983ae0 100644 --- a/design/user-stories/us-010-run-local-docker-test-server.md +++ b/design/user-stories/us-010-run-local-docker-test-server.md @@ -13,7 +13,7 @@ As a **plugin developer**, I want one command to run the current Tree Feller bui - [x] One repository script builds and verifies the plugin before starting an isolated Spigot 26.2 server through Docker Compose. - [x] The current Tree Feller JAR is mounted into the server automatically whenever the container is recreated. -- [x] `WindMagi` is configured and verified as a server operator. +- [x] `WindMagi` is configured and verified at operator level 4 using the deterministic offline-mode UUID `6a3b6e9f-1a2f-380c-8a75-7a7ca6392c0e`. - [x] The Minecraft port binds only to `127.0.0.1:25565` by default. - [x] Startup waits for server health and verifies Tree Feller through RCON. - [x] Generated worlds, logs, configuration, and downloaded server artifacts are stored under `.docker/minecraft/` and excluded from Git. diff --git a/docker/test-ops.json b/docker/test-ops.json new file mode 100644 index 0000000..b475b3b --- /dev/null +++ b/docker/test-ops.json @@ -0,0 +1,8 @@ +[ + { + "uuid": "6a3b6e9f-1a2f-380c-8a75-7a7ca6392c0e", + "name": "WindMagi", + "level": 4, + "bypassesPlayerLimit": false + } +] diff --git a/scripts/start-test-server.sh b/scripts/start-test-server.sh index 1f7093d..729d731 100755 --- a/scripts/start-test-server.sh +++ b/scripts/start-test-server.sh @@ -62,8 +62,15 @@ if [[ "$plugins" != *"TreeFeller"* ]]; then exit 1 fi -# This is idempotent and confirms the requested local test account is an operator. -docker compose -f "$compose_file" exec -T minecraft rcon-cli 'op WindMagi' >/dev/null +# Offline mode assigns a deterministic UUID that differs from the account's online UUID. +# Verify the exact identity instead of issuing `op WindMagi`, which can resolve online identity. +offline_uuid="6a3b6e9f-1a2f-380c-8a75-7a7ca6392c0e" +ops_json="$(docker compose -f "$compose_file" exec -T minecraft sh -lc 'cat /data/ops.json')" +if [[ "$ops_json" != *'"name": "WindMagi"'* || "$ops_json" != *"\"uuid\": \"${offline_uuid}\""* ]]; then + echo "$ops_json" >&2 + echo "WindMagi's offline-mode UUID was not installed as an operator." >&2 + exit 1 +fi cat <<'MESSAGE' Tree Feller test server is ready at localhost:25565.