code wiki / (root) / nx_archive_server.nx

nx_archive_server.nx

buildroot/runtime/nx_archive_server.nx

10011 B141 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind servicetopic archive
docsdependenciesstructsconstsfunctions

about

nx_archive_server.nx -- sovereign localhost HTTP server for the time machine (R5 serve side). Binds 0.0.0.0:8080, serves files under web_assets/ (path-traversal rejected), Content-Type by extension. "/" -> a landing page. Also hosts the SUPERVISED do-not-recover blocklist: GET /blocklist renders it live from seg_store (justification + per-entry action), GET /blocklist/approve?id=N and /blocklist/retract?id=N are the operator ACTIONS (flip status on seg_store, then 303 back to /blocklist). Pending entries never block until approved here. Fetch stack. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_blocklist_view.nx nx_archive_server.nx

imports: nx_syscalls.nxnx_blocklist_view.nx

imported by: nobody (leaf or entry point)

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

main sys_socket sw sys_write sys_mmap sys_bind sys_listen

structs

none

consts

8const K_MAGIC_8080: i64 = 8080
9const K_MAGIC_8192: i64 = 8192
10const K_MAGIC_2048: i64 = 2048
11const K_MAGIC_2097152: i64 = 2097152

functions

13func sw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
14func ap(buf: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8) { buf[off+i]=s[i]; i=i+1 } return off+i }
15func apn(buf: *u8, off: i64, v: i64) -> i64 { if v==0 { buf[off]=0x30 as u8; return off+1 } var m: i64=v; let t: *u8=sys_mmap(24); var k: i64=0; while m>0 { t[k]=(48+(m%10)) as u8; m=m/10; k=k+1 } var o: i64=off; var q: i64=k-1; while q>=0 { buf[o]=t[q]; o=o+1; q=q-1 } return o }
calls 1: sys_mmap
16func endswith(path: *u8, plen: i64, ext: *u8, elen: i64) -> i64 { if plen<elen { return 0 } var i: i64=0; while i<elen { if (path[plen-elen+i] as i64) != (ext[i] as i64) { return 0 } i=i+1 } return 1 }
called by 1: ctype
17func ctype(path: *u8, plen: i64) -> *u8
calls 1: endswith
26func has_dotdot(buf: *u8, off: i64, len: i64) -> i64 { var i: i64=off; while i+1<off+len { if (buf[i] as i64)==0x2e { if (buf[i+1] as i64)==0x2e { return 1 } } i=i+1 } return 0 }
28func path_eq(req: *u8, pst: i64, plen: i64, lit: *u8, litlen: i64) -> i64 { if plen!=litlen { return 0 } var i: i64=0; while i<litlen { if (req[pst+i] as i64)!=(lit[i] as i64) { return 0 } i=i+1 } return 1 }
29func path_starts(req: *u8, pst: i64, plen: i64, lit: *u8, litlen: i64) -> i64 { if plen<litlen { return 0 } var i: i64=0; while i<litlen { if (req[pst+i] as i64)!=(lit[i] as i64) { return 0 } i=i+1 } return 1 }
31func qid(req: *u8, qst: i64, qen: i64, idbuf: *u8) -> i64
43func main() -> i64