#!/usr/bin/env bash # Access check of the DEV surfaces (docs/development/ENVIRONMENTS.md ยง3.3). # pnpm dev:net-check # expects the stack, pnpm dev and the gateway running # Part 1 probes the ALLOWED surfaces from a throwaway container on its own Docker network, # which reaches the host by its LAN address only. Part 2 cannot be proven from this machine: # with Docker rootless a container's traffic to the host's own address is delivered # locally, never through the LAN interface, so the firewall rules that close 54322-54324 # on that interface are invisible here. It prints the commands to run on another device. # Exit 1 when an allowed surface fails. set -euo pipefail cd "$(dirname "$0")/.." . scripts/dev-env.sh host="$FAUNOSTEO_DEV_HOST" net=faunosteo_net_check image=curlimages/curl:8.11.1 docker network create "$net" >/dev/null 2>&1 || true # shellcheck disable=SC2329 # invoked by the trap cleanup() { docker network rm "$net" >/dev/null 2>&1 || true; } trap cleanup EXIT failed=0 probe() { # probe