From b50dba577ff453ad4c20800e897f64eb671e996b Mon Sep 17 00:00:00 2001 From: rcourtman Date: Thu, 6 Nov 2025 17:44:46 +0000 Subject: [PATCH] Fix demo server workflow verification by adding authentication The workflow was failing because /api/state requires authentication, but the verification step was making an unauthenticated request. Changes: - Authenticate with demo/demo credentials before checking node count - Use jq for cleaner JSON parsing instead of grep/cut - Check total node count from API response instead of regex pattern matching Related to user report about demo server not updating to 4.26.3. The demo server was actually updated successfully, but the workflow marked itself as failed due to the verification check failing. --- .github/workflows/update-demo-server.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-demo-server.yml b/.github/workflows/update-demo-server.yml index f5591c4..d6bfe1c 100644 --- a/.github/workflows/update-demo-server.yml +++ b/.github/workflows/update-demo-server.yml @@ -36,13 +36,13 @@ jobs: # Check version endpoint VERSION=$(ssh -i ~/.ssh/id_ed25519 ${{ secrets.DEMO_SERVER_USER }}@${{ secrets.DEMO_SERVER_HOST }} \ - "curl -s http://localhost:7655/api/version | grep -o '\"version\":\"[^\"]*' | cut -d'\"' -f4") + "curl -s http://localhost:7655/api/version | jq -r .version") echo "Demo server is now running version: $VERSION" - # Verify mock mode is active + # Verify mock mode is active by authenticating and checking node count NODES=$(ssh -i ~/.ssh/id_ed25519 ${{ secrets.DEMO_SERVER_USER }}@${{ secrets.DEMO_SERVER_HOST }} \ - "curl -s http://localhost:7655/api/state | grep -o '\"nodes\":\[[^]]*\]' | grep -o 'pve[0-9]' | wc -l") + 'curl -s -c /tmp/demo-cookies.txt http://localhost:7655/api/login -X POST -H "Content-Type: application/json" -d "{\"username\":\"demo\",\"password\":\"demo\"}" > /dev/null && curl -s -b /tmp/demo-cookies.txt http://localhost:7655/api/state | jq -r ".nodes | length" && rm -f /tmp/demo-cookies.txt') echo "Mock nodes detected: $NODES"