code wiki / _hdl_build / nx_aw_hostctl.nx

nx_aw_hostctl.nx

buildroot/runtime/_hdl_build/nx_aw_hostctl.nx

22860 B290 linesdepth 10pulls 26 transitivereach 0 importersview sourcekind tooltopic aw
docsdependenciesstructsconstsfunctions

about

nx_aw_hostctl.nx -- SOVEREIGN deploy/supervision TRIGGER for the NAS control plane. Retires the nascmd.txt + nx_aw_nasfix "run arbitrary shell" escape hatch for the deploy path (operator: "no .txt and other bullshit... nishi ecosystem all the way up from the hardware rung, each rung"). It gets the NAS password from the sovereign vault (composes _offc/nx_machine_key.elf + _offc/nx_vault.elf, exactly as nx_aw_nasfix/nx_secret_cli do), opens the team's OWN sovereign SSH (nx_ssh_lib), and runs EXACTLY ONE thing remotely: the sovereign control-plane binary nx_hostctl with an ALLOWLISTED subcommand. The remote payload is an absolute binary path + one validated arg -- NO command file, NO cd/&&, NO tar/kill/setsid/ fuser/dev-tcp coreutils. All real lifecycle work (atomic binary swap, kill, respawn, health) is done by nx_hostctl's own syscalls. This is the "named sovereign op-organ" the sovereignty memo specified. nx_aw_hostctl selfswap -> run nx_hostctl.new selfswap : install+adopt the NEW supervisor (wiki-aware) nx_aw_hostctl deploy -> run nx_hostctl deploy : atomic-swap sites.elf + respawn (/wiki route) nx_aw_hostctl wikideploy -> run nx_hostctl wikideploy : atomic-swap the wiki gateway + respawn nx_aw_hostctl galxdeploy -> run nx_hostctl galxdeploy : atomic-swap the gallery gateway + respawn nx_aw_hostctl reconcile -> run nx_hostctl reconcile : one-supervisor reconcile (adopt sites.elf) license_tier: ORIGINAL (vault+SSH spine reused from nx_aw_nasfix; the shell escape hatch removed)

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_ssh_lib.nx nx_arbiter.nx nx_receipt.nx nx_aw_hostctl.nx

imports: nx_syscalls.nxnx_ssh_lib.nxnx_arbiter.nxnx_receipt.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main ssh_puts sys_write ah_allowed ah_streq fl_acquire fl_try fl_mkdir sys_mmap fl_path sys_openat_wr sys_flock sys_close fl_nap sys_mmap ↻ ah_run sys_fork sys_mmap ↻ sys_execve sys_exit sys_wait4 ah_unlink sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ↻ ssh_open_session sys_socket sys_mmap ↻ ssh_sockaddr nx_connect_bounded nx_fcntl sys_connect sys_mmap ↻ sys_poll ssh_kex sys_write ↻

structs

none

consts

20const AH_MAGIC_8095: i64 = 8095
21const AH_MAGIC_18190: i64 = 18190
22const AH_MAGIC_18794: i64 = 18794
23const AH_MAGIC_18795: i64 = 18795
24const AH_MAGIC_18099: i64 = 18099
25const AH_MAGIC_9099: i64 = 9099
26const AH_MAGIC_9091: i64 = 9091
27const AH_MAGIC_9444: i64 = 9444
28const AH_MAGIC_8453: i64 = 8453
29const AH_MAGIC_8444: i64 = 8444
30const AH_MAGIC_8791: i64 = 8791
31const AH_MAGIC_8097: i64 = 8097
32const AH_MAGIC_18797: i64 = 18797
33const AH_MAGIC_18793: i64 = 18793
34const AH_MAGIC_6881: i64 = 6881
35const AH_MAGIC_18090: i64 = 18090
36const AH_MAGIC_18796: i64 = 18796
37const AH_MAGIC_18456: i64 = 18456
38const AH_MAGIC_65536: i64 = 65536
39const AH_MAGIC_1048576: i64 = 1048576
40const AH_MAGIC_16384: i64 = 16384
41const AH_MAGIC_1024: i64 = 1024
42const AH_MAGIC_1800: i64 = 1800
44const AH_SECRET_OUT: *u8 = "/tmp/nxsecret.out" as *u8
45const AH_VAULT_NV: *u8 = "/home/elderwesto/.nishi/secrets/nas.nv" as *u8
46const AH_HOSTCTL: *u8 = "/volume1/homes/elderwesto/nishihost/nx_hostctl" as *u8
47const AH_HOSTCTL_NEW: *u8 = "/volume1/homes/elderwesto/nishihost/nx_hostctl.new" as *u8

functions

49func ah_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: main
50func ah_streq(a: *u8, b: *u8) -> i64 { var i: i64=0; while a[i]!=(0 as u8) { if a[i]!=b[i] { return 0 } i=i+1 } if b[i]!=(0 as u8) { return 0 } return 1 }
called by 2: ah_allowedmain
53func ah_run(path: *u8, a1: *u8, a2: *u8) -> i64
76func ah_allowed(sub: *u8) -> i64
called by 1: main calls 1: ah_streq
151func ah_drain(st: *SshState) -> i64
164func ah_sudo_put(st: *SshState, wcmd: *u8, wcmdlen: i64, data: *u8, datalen: i64, quiet_max: i64) -> i64
206func main(argc: i64, argv: *i64) -> i64