code wiki / _hdl_build / nx_wiki_lock_page.nx
nx_wiki_lock_page.nx source
↩ module page · 39 lines · 2096 B
1// nx_wiki_lock_page.nx -- the OPERATOR-GATED placeholder served at the PUBLIC board.html so the real
2// Work Board (delegation + backlog) is NOT exposed publicly. On the shared skin. The real board is
3// served only behind the OPAQUE login (the gated daemon / post-cutover path). Sovereign.
4// license_tier: ORIGINAL
5import "nx_syscalls.nx"
6import "nx_wiki_skin_lib.nx"
7const LP_MAGIC_131072: i64 = 131072
8
9const LP_OUT: *u8 = "/tmp/nx_wiki_lock.html"
10const LP_SRC: *u8 = "/tmp/nx_wiki_lock.src"
11const LP_DST: *u8 = "/tmp/nx_wiki_lock.dst"
12const LP_SRCVAL: *u8 = "/tmp/nx_wiki_lock.html\n"
13const LP_DSTVAL: *u8 = "cat > /volume1/homes/elderwesto/nishihost/sites/nishifamily/wiki/board.html\n"
14
15func lp_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
16func lp_write(path: *u8, content: *u8) -> i64 {
17 let fd: i64 = sys_openat_wr(path, 420)
18 if fd < 0 { return 0 - 1 }
19 sys_write(fd, content, lp_slen(content)); sys_close(fd); return 0
20}
21
22func main(argc: i64, argv: *i64) -> i64 {
23 let h: *u8 = sys_mmap(LP_MAGIC_131072)
24 var w: i64 = 0
25 w = skin_open(h, w, "Work Board" as *u8, "board" as *u8)
26 w = sk_cat(h, w, "<div class=\"lock\"><div class=\"ico\">🔒</div>\n" as *u8)
27 w = sk_cat(h, w, "<h1>Operator only</h1>\n" as *u8)
28 w = sk_cat(h, w, "<p class=\"sub\">The Work Board — delegation, the full workstream backlog, the live feed — is access-controlled and is not served on the public web.</p>\n" as *u8)
29 w = sk_cat(h, w, "<p>Sign in through the OPAQUE gateway to view it. No content is exposed here.</p></div>\n" as *u8)
30 w = skin_close(h, w, sys_now_realtime_sec())
31 let fd: i64 = sys_openat_wr(LP_OUT, 420)
32 if fd < 0 { sys_write(2, "LOCK-FAIL\n" as *u8, 10); sys_exit(1); return 1 }
33 sys_write(fd, h, w); sys_close(fd)
34 lp_write(LP_SRC, LP_SRCVAL); lp_write(LP_DST, LP_DSTVAL)
35 let r: *u8 = sys_mmap(64); var ro: i64 = 0
36 ro = sk_cat(r, ro, "LOCK-PAGE-OK bytes=" as *u8); ro = sk_catn(r, ro, w); ro = sk_cat(r, ro, "\n" as *u8)
37 sys_write(1, r, ro)
38 sys_exit(0); return 0
39}