nx_sites_daemon.nx
buildroot/runtime/bin/nx_sites_daemon.nx
about
nx_sites_daemon.nx -- sovereign multi-vhost HTTPS daemon (pure Nishi,
silicon-up). Serves andelinwest.com + nishifamily.com (+ /wiki) by
Host-header / path dispatch over the PROVEN TLS 1.3 + Ed25519 path.
Operator 2026-05-28 (full autonomy): "get andelinwest.com and
nishifamily.com/wiki up ... near hundred percent site uptime."
Reuses only the proven primitives (run_ed25519 handshake + app_recv +
app_send) the ed25519 test daemon validated end-to-end. Avoids the
mv daemon's nx_wiki_route_dispatch (which returns empty on the NAS).
Dispatch is simple substring matching on the decrypted request --
reliable for placeholders. Real wiki engine swaps in later behind
the same vhost routing.
M6 anti-pretend-stub: each page SELF-LABELS as a launch placeholder
and shows real structure (andelinwest names its compliance blockers;
the wiki lists the actual shipped substrate components).
dependencies 13 imports · 0 importers
diagram shows first 10 each side; +3 more imports, +0 more importers in the complete lists below.
imports: nx_syscalls.nxnx_csprng.nxnx_http_server.nxnx_tls13_server_session.nxnx_tls13_server_session_run.nxnx_tls13_server_session_app_data.nxnx_sites_telemetry.nxnx_wiki_status.nxnx_wiki_article.nxnx_wiki_queue.nxnx_host_router.nxnx_sni_cert_select.nxnx_http_proxy.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
| 35 | const NX_SD_PORT: i64 = 8443 |
| 36 | const NX_SD_BUDGET: i64 = 100000000 |
| 40 | const NX_SD_MAX_CHILDREN: i64 = 64 |
| 48 | const NX_SD_CERT_PATH: *u8 = "/volume1/homes/elderwesto/nishihost/certs/le_fullchain.der" as *u8 |
| 49 | const NX_SD_PRIV_PATH: *u8 = "/volume1/homes/elderwesto/nishihost/certs/le_ecdsa_key.bin" as *u8 |
| 56 | const NX_SD_CERT_NISHI: *u8 = "/volume1/homes/elderwesto/nishihost/certs/le_nishifamily_fullchain.der" as *u8 |
| 57 | const NX_SD_PRIV_NISHI: *u8 = "/volume1/homes/elderwesto/nishihost/certs/le_nishifamily_ecdsa_key.bin" as *u8 |
| 58 | const NX_SD_CERT_ANDELIN: *u8 = "/volume1/homes/elderwesto/nishihost/certs/le_andelinwest_fullchain.der" as *u8 |
| 59 | const NX_SD_PRIV_ANDELIN: *u8 = "/volume1/homes/elderwesto/nishihost/certs/le_andelinwest_ecdsa_key.bin" as *u8 |
| 62 | const NX_SD_MSG_PEEK: i64 = 2 |
| 63 | const NX_SD_SNI_PEEK_CAP: i64 = 8192 |
| 65 | const NX_SD_SITES_CONF: *u8 = "/volume1/homes/elderwesto/nishihost/sites.conf" as *u8 |
| 68 | const NX_SD_TELEMETRY_PATH: *u8 = "/volume1/homes/elderwesto/nishihost/sites_telemetry.log" as *u8 |
| 71 | const NX_SD_MAX_REQ_PER_CONN: i64 = 64 |
| 72 | const NX_SD_OUTCAP: i64 = 16384 |
| 75 | const NX_SD_STATUS_CAP: i64 = 65536 |
| 77 | const NX_SD_ART_CAP: i64 = 65536 |
| 79 | const NX_SD_DYN_CAP: i64 = 65536 |
| 82 | const RESP_FAVICON: *u8 = "HTTP/1.1 204 No Content\r\nConnection: keep-alive\r\n\r\n" as *u8 |
| 84 | const BODY_ANDELIN: *u8 = "<!DOCTYPE html>\n<html lang=\"en\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>Andelin West Law - Coming Soon</title><style>body{font-family:Georgia,serif;max-width:680px;margin:8vh auto;padding:0 24px;color:#1a1a2e;line-height:1.6}h1{font-size:2rem}.tag{color:#555}.note{margin-top:2rem;padding:16px 20px;background:#f4f4f8;border-left:4px solid #2a4d8f;font-size:.95rem}.foot{margin-top:3rem;font-size:.8rem;color:#888}</style></head><body><h1>Andelin West Law</h1><p class=\"tag\">A modern legal practice. Site launching soon.</p><div class=\"note\"><strong>Placeholder page.</strong> Served by the sovereign Nishi substrate. The full site is pending attorney review of state-bar advertising rules, ADA accessibility conformance, and the privacy notice before any client-facing or intake content goes live.</div><p class=\"foot\">Served bits-up by the Nishi stack — TLS 1.3 + Ed25519, no third-party web server.</p></body></html>\n" as *u8 |
| 86 | const BODY_WIKI: *u8 = "<!DOCTYPE html>\n<html lang=\"en\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>Nishi Ecosystem Wiki</title><style>body{font-family:-apple-system,Segoe UI,Roboto,sans-serif;max-width:760px;margin:6vh auto;padding:0 24px;color:#161622;line-height:1.65}h1{font-size:2.1rem}h2{font-size:1.1rem;margin-top:2rem;color:#2a4d8f}ul{padding-left:1.2rem}li{margin:.35rem 0}.note{padding:14px 18px;background:#eef2fb;border-left:4px solid #2a4d8f;border-radius:4px;font-size:.95rem}code{background:#f0f0f4;padding:1px 5px;border-radius:3px;font-size:.9em}.foot{margin-top:3rem;font-size:.8rem;color:#888}</style></head><body><h1>Nishi Ecosystem Wiki</h1><p class=\"note\"><strong>Launch placeholder — the live wiki engine is coming online.</strong> What you are reading is itself served bits-up by the substrate below: no nginx, no OpenSSL, no libc.</p><p style=\"margin:1.2rem 0\"><a href=\"/wiki/status\"><strong>▸ Live stack scorecard →</strong></a> <a href=\"/wiki/components\"><strong>▸ Component articles (Gitea×Wikipedia) →</strong></a></p><h2>Shipped substrate</h2><ul><li>Self-hosting NishiLang compiler (RV64 + x86_64), bits-up from C bootstrap</li><li>TLS 1.3 server + Ed25519 signatures (RFC 8446 / 8032) — serving this page now</li><li>SHA-256/512, ChaCha20-Poly1305, AES-GCM, HKDF, Argon2id — all KAT-verified</li><li>Sovereign secrets vault (HashiCorp-class, ChaCha20-Poly1305 at rest)</li><li>Multi-vhost HTTPS daemon with DHCP-stable routing + auto-healing watchdog</li></ul><h2>In progress</h2><ul><li>Full wiki engine (search index, doc store, markdown render)</li><li>Modern auth (OPAQUE PAKE + BIP39 recovery, no cookies)</li><li>Multi-agent concurrent editing (CRDT, sovereign)</li></ul><p class=\"foot\">nishifamily.com/wiki — bits-up sovereign hosting on the west NAS.</p></body></html>\n" as *u8 |
| 88 | const BODY_FAMILY: *u8 = "<!DOCTYPE html>\n<html lang=\"en\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>Nishi Family</title><style>body{font-family:-apple-system,Segoe UI,Roboto,sans-serif;max-width:680px;margin:8vh auto;padding:0 24px;color:#161622;line-height:1.65;text-align:center}h1{font-size:2.3rem}.tag{color:#555;font-size:1.05rem}a{color:#2a4d8f}.foot{margin-top:3rem;font-size:.8rem;color:#888}</style></head><body><h1>Nishi Family</h1><p class=\"tag\">The family hub — home of the Nishi sovereign ecosystem.</p><p><a href=\"/wiki\">Explore the Nishi Ecosystem Wiki →</a></p><p class=\"foot\">Served bits-up by the Nishi stack — TLS 1.3 + Ed25519, no third-party web server.</p></body></html>\n" as *u8 |
| 195 | const NX_SD_CERT_MANIFEST: *u8 = "/volume1/homes/elderwesto/nishihost/certs/sni_certs.manifest" as *u8 |
| 196 | const NX_SD_CERT_MAX: i64 = 32 |
functions
| 90 | func sd_strlen(s: *u8) -> i64 |
| 97 | func sd_contains(hay: *u8, hlen: i64, needle: *u8, nlen: i64) -> i64 called by 1: main |
| 116 | func sd_body_start(hay: *u8, hlen: i64) -> i64 called by 1: main |
| 131 | func sd_u64_to_dec(n: i64, buf: *u8) -> i64 |
| 146 | func sd_append(dst: *u8, off: i64, src: *u8, n: i64) -> i64 |
| 152 | func sd_append_str(dst: *u8, off: i64, s: *u8) -> i64 |
| 159 | func sd_build_resp(out: *u8, ctype: *u8, body: *u8, body_len: i64) -> i64 |
| 174 | func sd_load_chain(path: *u8, len_box: *i64) -> *u8 |
| 183 | func sd_load_key(path: *u8) -> *u8 |
| 199 | func sd_atoi(s: *u8) -> i64 called by 1: main |
| 214 | func sd_field(buf: *u8, pos: i64, end: i64, out: *u8, out_cap: i64) -> i64 called by 1: sd_load_cert_table |
| 251 | func sd_next_line(buf: *u8, pos: i64, end: i64) -> i64 called by 1: sd_load_cert_table |
| 263 | func sd_load_cert_table(man: *u8, man_n: i64, |
| 309 | func main(argc: i64, argv: *i64) -> i64 |