From dcd108b44dff9654f01cac963fce4f65b52461ce Mon Sep 17 00:00:00 2001 From: "@permadeath.com" Date: Mon, 10 Aug 2026 19:40:57 -0400 Subject: [PATCH] fix(scripts): probe and print URLs that exist The per-DID client paths deleted /megamek, so arena_probe could never see ready and run.sh pointed players at a 404. Probe the container root - the one URL every match serves, and what headquarters' own probe checks - and print the root with a note about per-seat paths. --- scripts/arena.sh | 4 ++-- scripts/lib/common.sh | 4 +++- scripts/run.sh | 5 +++-- tests/shell/test-arena.sh | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/arena.sh b/scripts/arena.sh index ec008b3..9da7f9c 100755 --- a/scripts/arena.sh +++ b/scripts/arena.sh @@ -267,7 +267,7 @@ cmd_up() { say "image: $image" say "scenario: $scenario ($ARENA_HUMAN is human, Princess plays the rest)" arena_caps_line - say "url: http://localhost:$PORT_WS/megamek/" + say "url: http://localhost:$PORT_WS/ (one client app per seat, at /)" # Profiling is off unless ARENA_PROFILE is set in this shell, and the # container reads these four names. Passed with `-e NAME` rather than @@ -474,7 +474,7 @@ cmd_status() { jq -n \ --arg id "$id" --arg name "$name" --arg image "$image" --arg state "$state" \ - --arg started "$started" --arg url "http://localhost:$port/megamek/" \ + --arg started "$started" --arg url "http://localhost:$port/" \ --argjson ready "$ready" --argjson port "$port" --argjson uptime "$uptime" \ --argjson nanocpus "${nanocpus:-0}" --argjson memory "${memory:-0}" \ --argjson pids "${pids:-0}" \ diff --git a/scripts/lib/common.sh b/scripts/lib/common.sh index 46b986a..11d8e15 100644 --- a/scripts/lib/common.sh +++ b/scripts/lib/common.sh @@ -452,6 +452,8 @@ arena_free_port() { # before saying "ready". A caller that needs to explain a failure has the # container's logs, which is a better answer than the last curl error. arena_probe() { + # The container root, not a client path: clients are rendered per seat at + # / now, so the root is the one URL every match serves. curl -fs -o /dev/null --max-time "${ARENA_PROBE_TIMEOUT:-3}" \ - "http://localhost:${1}/megamek/" 2>/dev/null + "http://localhost:${1}/" 2>/dev/null } diff --git a/scripts/run.sh b/scripts/run.sh index 304ad02..c58bccf 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -5,7 +5,8 @@ # ./run.sh data/scenarios/TrainingScenarios/2-Ambush.mms # HUMAN=TraineeA ./run.sh # -# then open http://localhost:8080/megamek/ +# then open http://localhost:8080/ and pick the seat's client (one app per +# seat, at /) # # Ctrl-C stops the container. This runs the real image with a generated launch # manifest and no upload targets, so it exercises the same entrypoint, init, @@ -73,7 +74,7 @@ fi cat <