code wiki / _hdl_build / nx_video_diag_stage.nx

nx_video_diag_stage.nx

buildroot/runtime/_hdl_build/nx_video_diag_stage.nx

2914 B27 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind orphan librarytopic video
docsdependenciesstructsconstsfunctions

about

nx_video_diag_stage.nx -- READ-ONLY stage step for a /video-backend diagnostic over the sovereign SSH path. Sibling of nx_edge_recon_stage.nx, but the staged remote command is STRICTLY READ-ONLY (curl-read/sed/grep/ss/netstat/tail only -- no kill/start/mv/deploy/cron/sudo-write). Reads the decrypted secret from /tmp/nxsecret.out (produced by nx_machine_key + _offc/nx_vault.elf open), copies it to /tmp/nxpw, and writes the read-only diagnostic to /tmp/nxcmd. Then nx_ssh_cmd consumes both. Nothing is mutated on the NAS. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_video_diag_stage.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

structs

none

consts

9const DIAG_CMD: *u8 = "for P in 7443 443; do echo \"=== PORT $P /video ===\"; curl -sk --max-time 8 -i --resolve nishifamily.com:$P:127.0.0.1 https://nishifamily.com:$P/video 2>&1 | sed -n '1,20p'; echo \"--- markers ---\"; curl -sk --max-time 8 --resolve nishifamily.com:$P:127.0.0.1 https://nishifamily.com:$P/video 2>&1 | grep -ioE 'app.js|vroom|WebSocket|/signal|getUserMedia|Nishi Family Video' | sort -u; echo \"=== PORT $P /signal WS-UPGRADE ===\"; curl -sk --max-time 8 -i --resolve nishifamily.com:$P:127.0.0.1 -H \"Connection: Upgrade\" -H \"Upgrade: websocket\" -H \"Sec-WebSocket-Version: 13\" -H \"Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\" \"https://nishifamily.com:$P/signal/testroom\" 2>&1 | sed -n '1,20p'; done; echo \"=== SIGNALING BACKEND :8445 ===\"; (ss -tlnp 2>/dev/null||netstat -tlnp 2>/dev/null) | grep 8445; echo \"--- signaling.log tail ---\"; tail -15 /volume1/homes/elderwesto/nishihost/signaling.log 2>/dev/null; echo \"=== sites.elf /signal impl check ===\"; grep -c \"/signal\" /volume1/homes/elderwesto/nishihost/sites.elf 2>/dev/null\n"

functions

11func slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
12func pw(s: *u8) -> i64 { sys_write(1,s,slen(s)); return 0 }
13func pn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(1,bb,k); return 0 }
15func main() -> i64