code wiki / _hdl_build / nx_vroom_deploy.nx

nx_vroom_deploy.nx

buildroot/runtime/_hdl_build/nx_vroom_deploy.nx

6400 B95 linesdepth 10pulls 22 transitivereach 0 importersview sourcekind tooltopic vroom
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_ssh_lib.nx nx_vroom_deploy.nx

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

main sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ssh_puts sys_write ssh_open_session sys_socket sys_mmap ↻ ssh_sockaddr nx_connect_bounded nx_fcntl sys_connect sys_mmap ↻ sys_poll ssh_kex sys_write ↻ sys_mmap ↻ ssh_read_line sys_read ↻ ssh_read_packet sys_mmap ↻ ssh_read_full sys_read ↻ ssh_u32be ssh_put_bytes ssh_put_byte ssh_put_bytes ↻ ssh_put_str ssh_put_u32 ssh_put_bytes ↻ ssh_put_u32 ↻ ssh_send_packet sys_mmap ↻ ssh_put_u32 ↻ ssh_put_bytes ↻

structs

none

consts

9const VR_MAGIC_1048576: i64 = 1048576
10const VR_MAGIC_16384: i64 = 16384
11const VR_MAGIC_65536: i64 = 65536
12const VR_MAGIC_1024: i64 = 1024
14const VR_WCMD: *u8 = "cat > /volume1/homes/elderwesto/nishihost/nx_vroom_daemon.elf.new" as *u8
17const 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
21const 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
22const 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
23const 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
24const VR_HTML_SRC: *u8 = "web_assets/vroom_client.html" as *u8
25const VR_HTML_WCMD: *u8 = "cat > /volume1/homes/elderwesto/nishihost/vroom_client.html" as *u8

functions

27func slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=0 as u8 { n=n+1 } return n }
31func ssh_put_file(st: *SshState, wcmd: *u8, wcmdlen: i64, data: *u8, datalen: i64) -> i64
67func main() -> i64