From 6fbe63f787ec5ac08ea56e81e0778a510005cdce Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 14 Oct 2026 16:08:28 +0000 Subject: [PATCH] Fix carry-over on Pages: add 404.html and tolerate 200-with-HTML Pages serves index.html with 200 for unknown paths when there is no 404.html, so a never-published channel looked published and jq failed on the HTML. Add a real 404 page and treat a 200 without a latest.json as absent. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01JdMNbY5hLR7FjtfEE712xG --- .github/scripts/stage-pages-site.sh | 7 ++++++- site/404.html | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 site/404.html diff --git a/.github/scripts/stage-pages-site.sh b/.github/scripts/stage-pages-site.sh index f9947f4..4521fe9 100755 --- a/.github/scripts/stage-pages-site.sh +++ b/.github/scripts/stage-pages-site.sh @@ -17,7 +17,7 @@ case "$channel" in prod) other=dev ;; dev) other=prod ;; *) echo "bad channel: $ rm -rf "$out" mkdir -p "$out/$channel" "$out/$other" -cp site/index.html site/_headers "$out/" +cp site/index.html site/404.html site/_headers "$out/" name="$(basename "$apk")" cp "$apk" "$out/$channel/$name" @@ -47,6 +47,11 @@ fi if [ "$code" = 404 ]; then echo "No $other channel published yet; skipping." rm -rf "$out/$other" +elif [ "$code" = 200 ] && ! jq -e .apkName "$out/$other/latest.json" >/dev/null 2>&1; then + # A 200 that is not our JSON: Pages without a 404.html answers unknown paths + # with index.html. Nothing is published on that channel. + echo "No $other channel published yet (200 but no latest.json); skipping." + rm -rf "$out/$other" elif [ "$code" = 200 ]; then other_name="$(jq -er .apkName "$out/$other/latest.json")" curl -fsS -o "$out/$other/$other_name" "$base/$other/$other_name" diff --git a/site/404.html b/site/404.html new file mode 100644 index 0000000..356ca3b --- /dev/null +++ b/site/404.html @@ -0,0 +1,3 @@ + +Not found +

404

Not found. Pro Libertate Games downloads