Skip to content

services-external-check #126

services-external-check

services-external-check #126

Workflow file for this run

name: services-external-check
on:
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Probe every public service from the public internet
run: |
set -uo pipefail
echo "runner IP $(curl -s --max-time 10 https://api.ipify.org)"
echo
printf '%-14s %-6s %-6s %-9s %s\n' SERVICE PORT SCHEME CONNECT RESULT
fails=0
# check <name> <url> — full URL (jd-plex.com via Cloudflare Tunnel).
check() {
name="$1"; url="$2"
scheme=$(echo "$url" | sed -E 's#^(https?)://.*#\1#')
port=$(echo "$url" | sed -E 's#^https?://[^:/]+:?([0-9]*)/?.*#\1#'); [ -z "$port" ] && { [ "$scheme" = https ] && port=443 || port=80; }
out=$(curl -sS -o /dev/null -w '%{http_code} %{time_connect}' --max-time 20 "$url" 2>/dev/null) || out="000 0"
code=$(echo "$out" | awk '{print $1}'); ct=$(echo "$out" | awk '{print $2}')
if [ "${code:-000}" = "000" ]; then verdict="UNREACHABLE"; fails=$((fails+1))
else verdict="reachable (HTTP $code)"; fi
printf '%-14s %-6s %-6s %-9s %s\n' "$name" "$port" "$scheme" "${ct}s" "$verdict"
}
echo "-- jd-plex.com (Cloudflare Tunnel) --"
check Requests https://requests.jd-plex.com/
check Join https://join.jd-plex.com/
check Books https://books.jd-plex.com/
check Archives https://archives.jd-plex.com/
check Stackarr https://stackarr.jd-plex.com/
check Sonarr https://sonarr.jd-plex.com/
check Radarr https://radarr.jd-plex.com/
echo
echo "-- Plex (direct WAN + plex.tv) --"
check Plex http://jdplex3.asuscomm.com:32400/identity
echo
if [ "$fails" -gt 0 ]; then echo "SUMMARY: $fails service(s) UNREACHABLE from outside"; else echo "SUMMARY: all services reachable from outside"; fi