test(lifecycle): let the UI probes honour ARCHY_SCHEME

ui-coverage.bats and ui-probes.bash hardcoded https:// while the rest of
the harness builds URLs from ARCHY_SCHEME via lib/rpc.bash. That made the
suite unrunnable on a node serving the dashboard over http.

On archi-dev-box :443 is bound to the Tailscale / WireGuard / LAN
interface addresses but NOT to loopback, while :80 is bound on 0.0.0.0.
So five probes failed with "curl failed (network/timeout)" against
endpoints that were serving 200 the whole time — http://127.0.0.1/,
/catalog.json, /app/lnd/, /app/electrumx/ and /app/mempool/ all verified
200 by hand.

Default stays https, so nodes that already exercise the TLS path keep
doing so. Test titles drop the hardcoded scheme, since they no longer
describe which one ran.

Verified: ARCHY_SCHEME=http ./run.sh ui-coverage → 9/9 (1 skip),
previously 5 failures.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
archipelago
2026-08-08 20:52:46 -04:00
co-authored by Claude Opus 5
parent b05222a342
commit e6428afd76
2 changed files with 24 additions and 15 deletions
+22 -13
View File
@@ -27,6 +27,15 @@ setup_file() {
unset ARCHY_FORCE_LOGIN
HOST="${ARCHY_HOST:-127.0.0.1}"
export HOST
# Honour ARCHY_SCHEME like lib/rpc.bash does, defaulting to https so nodes
# that already pass keep testing the TLS path. These probes used to hardcode
# https, which made the whole suite unrunnable on a node that serves the
# dashboard over http: on archi-dev-box :443 is bound to the Tailscale /
# WireGuard / LAN interface addresses but NOT to loopback, while :80 is bound
# on 0.0.0.0 — so every proxy probe failed "curl failed (network/timeout)"
# against http-reachable endpoints that were in fact serving 200.
UI_BASE="${ARCHY_SCHEME:-https}://$HOST"
export UI_BASE
}
teardown_file() {
@@ -37,7 +46,7 @@ teardown_file() {
# Dashboard shell + catalog (always required)
# ────────────────────────────────────────────────────────────────────
@test "dashboard https://host/ returns the Vue SPA shell" {
@test "dashboard / returns the Vue SPA shell" {
run probe_dashboard_shell
[ "$status" -eq 0 ]
}
@@ -59,30 +68,30 @@ teardown_file() {
# HTTPS proxy paths — match HTTPS_PROXY_PATHS in appSessionConfig.ts
# ────────────────────────────────────────────────────────────────────
@test "lnd proxy https://host/app/lnd/ responds when lnd is running" {
probe_app_url lnd "https://$HOST/app/lnd/" "lnd (proxy /app/lnd/)"
@test "lnd proxy /app/lnd/ responds when lnd is running" {
probe_app_url lnd "$UI_BASE/app/lnd/" "lnd (proxy /app/lnd/)"
}
@test "electrumx proxy https://host/app/electrumx/ responds when electrumx is running" {
@test "electrumx proxy /app/electrumx/ responds when electrumx is running" {
# electrumx companion (archy-electrs-ui) is what serves the iframe HTML;
# the electrumx daemon is just the TCP backend.
probe_app_url archy-electrs-ui "https://$HOST/app/electrumx/" "electrumx (proxy /app/electrumx/)"
probe_app_url archy-electrs-ui "$UI_BASE/app/electrumx/" "electrumx (proxy /app/electrumx/)"
}
@test "mempool proxy https://host/app/mempool/ responds when mempool is running" {
probe_app_url mempool "https://$HOST/app/mempool/" "mempool (proxy /app/mempool/)"
@test "mempool proxy /app/mempool/ responds when mempool is running" {
probe_app_url mempool "$UI_BASE/app/mempool/" "mempool (proxy /app/mempool/)"
}
@test "fedimint proxy https://host/app/fedimint/ responds when fedimint is running" {
probe_app_url fedimint "https://$HOST/app/fedimint/" "fedimint (proxy /app/fedimint/)"
@test "fedimint proxy /app/fedimint/ responds when fedimint is running" {
probe_app_url fedimint "$UI_BASE/app/fedimint/" "fedimint (proxy /app/fedimint/)"
}
@test "btcpay proxy https://host/app/btcpay/ responds when btcpay-server is running" {
probe_app_url btcpay-server "https://$HOST/app/btcpay/" "btcpay (proxy /app/btcpay/)"
@test "btcpay proxy /app/btcpay/ responds when btcpay-server is running" {
probe_app_url btcpay-server "$UI_BASE/app/btcpay/" "btcpay (proxy /app/btcpay/)"
}
@test "filebrowser proxy https://host/app/filebrowser/ responds when filebrowser is running" {
probe_app_url filebrowser "https://$HOST/app/filebrowser/" "filebrowser (proxy /app/filebrowser/)"
@test "filebrowser proxy /app/filebrowser/ responds when filebrowser is running" {
probe_app_url filebrowser "$UI_BASE/app/filebrowser/" "filebrowser (proxy /app/filebrowser/)"
}
# ────────────────────────────────────────────────────────────────────
+2 -2
View File
@@ -85,7 +85,7 @@ probe_app_url() {
# layout" — see feedback_release_tarball_layout.md.
probe_dashboard_shell() {
local host="${ARCHY_HOST:-127.0.0.1}"
local url="https://$host/"
local url="${ARCHY_SCHEME:-https}://$host/"
local body
body=$(curl "${PROBE_CURL_OPTS[@]}" "$url" 2>/dev/null) || {
echo "probe_dashboard_shell: $url — curl failed" >&2
@@ -106,7 +106,7 @@ probe_dashboard_shell() {
probe_dashboard_catalog() {
local host="${ARCHY_HOST:-127.0.0.1}"
local body
body=$(curl "${PROBE_CURL_OPTS[@]}" "https://$host/catalog.json" 2>/dev/null) || {
body=$(curl "${PROBE_CURL_OPTS[@]}" "${ARCHY_SCHEME:-https}://$host/catalog.json" 2>/dev/null) || {
echo "probe_dashboard_catalog: /catalog.json fetch failed" >&2
return 1
}