code wiki / _hdl_build / nx_sites_reconciled.nx
nx_sites_reconciled.nx
buildroot/runtime/_hdl_build/nx_sites_reconciled.nx
about
nx_sites_reconciled.nx -- the ONE reconciled sovereign sites daemon (R3-assembly): cleanly LAYERED + fully
DATA-DRIVEN, replacing the two divergent F-level daemons. Composes the PROVEN TLS primitives (handshake/recv/
send, reused unchanged) with the GATED data-driven cores:
io: accept (fork-per-conn) -> MSG_PEEK ClientHello -> scs_pick_from_clienthello -> SNI host
data: cl_load(certs_generated.conf, sni) -> chain+key bytes (default-cert fallback) ; tables read at startup
TLS: nx_tls13_server_session_run(cfd, rnd, priv, chain, len, key) [proven]
logic: sh_handle(request, proxy_routes.conf, sites_generated.conf) -> PROXY-signal | static-200 | 404
io: PROXY -> buffered reverse-proxy relay to the backend ; else app_send the response
NO hardcoded routes/certs/hosts -- routes/certs/vhosts are the 3 data tables nx_domain_forge emits. Operator:
"fix the hardcoding, s-class exceed; append a domain -> the builders emit it." (Buffered proxy; streaming large
media = a later perf rung.) license_tier: ORIGINAL
dependencies 10 imports · 0 importers
imports: nx_syscalls.nxnx_connect.nxnx_csprng.nxnx_tls13_server_session.nxnx_tls13_server_session_run.nxnx_tls13_server_session_app_data.nxnx_sni_cert_select.nxnx_cert_loader.nxnx_site_handler.nxnx_tls13_read_record_from_fd.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
| 22 | const RD_MAGIC_20480: i64 = 20480 |
| 24 | const RD_PORT: i64 = 8443 |
| 25 | const RD_MSG_PEEK: i64 = 2 |
| 26 | const RD_PEEK_CAP: i64 = 8192 |
| 27 | const RD_OUTCAP: i64 = 4194304 |
| 28 | const RD_RELAYCAP: i64 = 4194304 |
| 29 | const RD_BUDGET: i64 = 1000000000 |
| 30 | const RD_MAXCHILD: i64 = 64 |
| 32 | const RD_REG: *u8 = "/volume1/homes/elderwesto/nishihost/certs_generated.conf" as *u8 |
| 33 | const RD_RT: *u8 = "/volume1/homes/elderwesto/nishihost/proxy_routes.conf" as *u8 |
| 34 | const RD_VT: *u8 = "/volume1/homes/elderwesto/nishihost/sites_generated.conf" as *u8 |
| 35 | const RD_DEF_CHAIN: *u8 = "/volume1/homes/elderwesto/nishihost/certs/le_fullchain.der" as *u8 |
| 36 | const RD_DEF_KEY: *u8 = "/volume1/homes/elderwesto/nishihost/certs/le_ecdsa_key.bin" as *u8 |
| 46 | const RD_RECCAP: i64 = 20480 // one TLS record (16384 payload + header/tag slack) |
| 47 | const RD_PLAINCAP: i64 = 65536 // full-request reassembly cap: headers + up to a ~63KB chunked-upload chunk |
functions
| 38 | func rd_readfile(path: *u8, szbox: *i64) -> *u8 { szbox[0] = 0; return sys_read_file(path, szbox) } |
| 49 | func rd_lower(c: u8) -> u8 called by 1: rd_content_length |
| 54 | func rd_contains(hay: *u8, hlen: i64, needle: *u8, nlen: i64) -> i64 called by 1: rd_recv_request |
| 71 | func rd_body_start(hay: *u8, hlen: i64) -> i64 called by 1: rd_recv_request |
| 84 | func rd_content_length(req: *u8, reqn: i64) -> i64 |
| 118 | func rd_recv_request(s: *Tls13ServerSession, cfd: i64, rec_buf: *u8, plain: *u8, plain_cap: i64) -> i64 |
| 148 | func rd_relay(s: *Tls13ServerSession, port: i64, plain: *u8, plain_n: i64, out_rec: *u8, cfd: i64) -> i64 called by 1: main calls 8: sys_socketsys_set_socket_timeoutsys_mmapnx_connect_boundedsys_closesys_write+2 |
| 175 | func main() -> i64 |