fix: handle local node execution without SSH in blockchain health check
Some checks failed
Blockchain Synchronization Verification / sync-verification (push) Failing after 2s
Multi-Node Blockchain Health Monitoring / health-check (push) Has been cancelled
P2P Network Verification / p2p-verification (push) Has been cancelled

- Detect when node is localhost or current hostname
- Execute commands directly on local node instead of using SSH
- Fixes SSH permission denied errors when checking services on local node
- gitea-runner runs the workflow, so it should check aitbc services directly
This commit is contained in:
aitbc
2026-04-20 20:26:04 +02:00
parent 5c8e2b379c
commit 717fd4cb7c

View File

@@ -57,7 +57,13 @@ log_warning() {
ssh_exec() {
local node="$1"
local command="$2"
ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no "$node" "$command" 2>&1 || return 1
# If node is localhost, execute directly without SSH
if [ "$node" = "localhost" ] || [ "$node" = "$(hostname)" ]; then
bash -c "$command" 2>&1 || return 1
else
ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no "$node" "$command" 2>&1 || return 1
fi
}
# Check RPC endpoint health