code wiki / _hdl_build / nx_vroom_deploy.nx
nx_vroom_deploy.nx
buildroot/runtime/_hdl_build/nx_vroom_deploy.nx
about
nx_vroom_deploy.nx -- SOVEREIGN deploy of the video daemon to the live NAS: streams
/tmp/nx_vroom_daemon.sov.elf over the team's own SSH (ssh_put_file, no scp/3rd party),
then chmod + (re)start on :8444 + verifies endpoints locally on the box. New port =
zero impact on nginx/8443/8282 or the working Synology services. pw from /tmp/nxpw.
Long command strings live as file-scope consts (keeps main small -> no empty-.s).
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_ssh_lib.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 9 | const VR_MAGIC_1048576: i64 = 1048576 |
| 10 | const VR_MAGIC_16384: i64 = 16384 |
| 11 | const VR_MAGIC_65536: i64 = 65536 |
| 12 | const VR_MAGIC_1024: i64 = 1024 |
| 14 | const VR_WCMD: *u8 = "cat > /volume1/homes/elderwesto/nishihost/nx_vroom_daemon.elf.new" as *u8 |
| 17 | const VR_KILL: *u8 = "for pid in /proc/[0-9]*; do if grep -qa nx_vroom_daemon \"$pid/cmdline\" 2>/dev/null; then kill -9 \"$(basename $pid)\" 2>/dev/null; fi; done; sleep 1; echo killed-old" as *u8 |
| 21 | const VR_START: *u8 = "cd /volume1/homes/elderwesto/nishihost; for pid in /proc/[0-9]*; do if grep -qa nx_vroom_daemon \"$pid/cmdline\" 2>/dev/null; then kill -9 \"$(basename $pid)\" 2>/dev/null; fi; done; sleep 1; mv -f nx_vroom_daemon.elf.new nx_vroom_daemon.elf; chmod +x nx_vroom_daemon.elf; setsid ./nx_vroom_daemon.elf >vroom.log 2>&1 </dev/null & sleep 2; echo started; tail -2 vroom.log" as *u8 |
| 22 | const VR_V1: *u8 = "echo ===PORTS===; (ss -tln 2>/dev/null || netstat -tln 2>/dev/null) | grep 8444; echo ===PAGE===; curl -sk --max-time 6 https://localhost:8444/video/ -H 'Host: nishifamily.com' | head -c 70; echo" as *u8 |
| 23 | const VR_V2: *u8 = "echo ===POST===; printf NASFRAME | curl -sk --max-time 6 -X POST --data-binary @- 'https://localhost:8444/post?room=fam&id=100' -H 'Host: nishifamily.com'; echo; echo ===FRAMES101BYTES===; curl -sk --max-time 6 'https://localhost:8444/frames?room=fam&id=101' -H 'Host: nishifamily.com' | wc -c; echo; echo ===PAGE_HAS_CLIENT===; curl -sk --max-time 6 https://localhost:8444/video/ -H 'Host: nishifamily.com' | grep -ioE 'Nishi Family Video|getUserMedia|daemon live' | head -3" as *u8 |
| 24 | const VR_HTML_SRC: *u8 = "web_assets/vroom_client.html" as *u8 |
| 25 | const VR_HTML_WCMD: *u8 = "cat > /volume1/homes/elderwesto/nishihost/vroom_client.html" as *u8 |
functions
| 27 | func slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=0 as u8 { n=n+1 } return n } |
| 31 | func ssh_put_file(st: *SshState, wcmd: *u8, wcmdlen: i64, data: *u8, datalen: i64) -> i64 |
| 67 | func main() -> i64 |