fix: use $HOME for cookie file in demo server workflow

The /tmp directory on the demo server isn't writable by the relay
user, causing the verification step's cookie file to silently fail.
This meant the /api/state request had no session cookie and returned
401, making the node count check report 0 nodes.

Use $HOME instead of /tmp for the cookie file path.
This commit is contained in:
rcourtman 2026-02-04 17:57:51 +00:00
parent ed1ec49a71
commit b501820899

View file

@ -143,8 +143,9 @@ jobs:
fi
# Verify mock mode is active by authenticating and checking node count
# Uses $HOME for cookie file since /tmp may not be writable by all users
NODES=$(ssh -i ~/.ssh/id_ed25519 ${{ secrets.DEMO_SERVER_USER }}@${{ secrets.DEMO_SERVER_HOST }} \
'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')
'curl -s -c $HOME/.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 $HOME/.demo-cookies.txt http://localhost:7655/api/state | jq -r ".nodes | length" && rm -f $HOME/.demo-cookies.txt')
echo "Mock nodes detected: $NODES"