code wiki / _hdl_build / nx_vroom_nas_sync.nx
nx_vroom_nas_sync.nx
buildroot/runtime/_hdl_build/nx_vroom_nas_sync.nx
about
nx_vroom_nas_sync.nx -- deploy the /video/ camera-fix to the LIVE served dir, SAFELY, as elderwesto
(operator 2026-06-23 "find it + auto-deploy hook ... don't crash with direct touches"). Investigation
proved: nginx serves nishifamily.com/video/ from /volume1/homes/elderwesto/nishihost/sites/nishifamily/
video/ (owned by elderwesto uid 1026 = our SSH login), and a Gitea post-receive hook (uid 1000) CANNOT
write that dir -- so the deploy runs as elderwesto instead.
THE NO-CRASH GUARANTEE: the new files are pulled from the local Gitea bare repo (the EXACT pushed
commit, source of truth) into /tmp, then swapped into the served dir with ATOMIC mv (rename) -- nginx
never sees a partially-written file, and the daemon is never touched/restarted. Current files are
backed up first (reversible), and `set -e` aborts BEFORE any swap if the pull fails (live stays intact).
Stages the credential (vault) to /tmp/nxpw + the deploy command to /tmp/nxcmd; nx_ssh_cmd runs it as
elderwesto. Run AFTER: nx_machine_key + _offc/nx_vault.elf open nas.nv. Then nx_ssh_cmd, then
nx_live_verify must find scaleX(-1) in the SERVED bytes. license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| 17 | const DEPLOY_CMD: *u8 = "set -e; DST=/volume1/homes/elderwesto/nishihost/sites/nishifamily/video; BARE=/volume1/docker/gitea/git/repositories/elderwesto/nishi-core.git; W=/tmp/nxvid; rm -rf $W; mkdir -p $W; git -c safe.directory='*' --git-dir=$BARE archive agents/invention-engine nxc2/sites/nishifamily/video/index.html nxc2/sites/nishifamily/video/app.js | tar -x -C $W; echo PULLED:; ls -l $W/nxc2/sites/nishifamily/video/; T=$(date +%s); cp -p $DST/index.html $DST/index.html.bak-$T; cp -p $DST/app.js $DST/app.js.bak-$T; cp $W/nxc2/sites/nishifamily/video/index.html $DST/.index.html.new; mv -f $DST/.index.html.new $DST/index.html; cp $W/nxc2/sites/nishifamily/video/app.js $DST/.app.js.new; mv -f $DST/.app.js.new $DST/app.js; echo DEPLOYED:; ls -l $DST/index.html $DST/app.js; echo MARKERS:; grep -c 'scaleX(-1)' $DST/index.html || true; grep -c 'tile self' $DST/app.js || true; rm -rf $W; echo SYNC_DONE\n" |
functions
| 19 | func slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 20 | func pw(s: *u8) -> i64 { sys_write(1,s,slen(s)); return 0 } |
| 21 | func 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 } |
| 23 | func main() -> i64 |