code wiki / wiki / nx_wiki_https_daemon.nx

nx_wiki_https_daemon.nx

buildroot/runtime/wiki/nx_wiki_https_daemon.nx

12217 B288 linesdepth 18pulls 138 transitivereach 0 importersview sourcekind servicetopic wiki
docsdependenciesstructsconstsfunctions

about

nx_wiki_https_daemon.nx -- V-HOST-2: sovereign HTTPS wiki daemon. Composes existing TLS 1.3 handshake (sovereign Ed25519 OR ECDSA path) + wiki HTTP router into a single daemon serving sovereign HTTPS for the wiki at andelinwest.com / nishifamily.com / etc. FINAL substrate piece per NISHI_ANDELINWEST_DEPLOY_PLAYBOOK. After this ships, the deploy is operator-side ops only: 1. nx_cert_gen (V-HOST-4 SHIPPED) -> Ed25519 cert 2. Porkbun A records (operator panel; 5 min) 3. Router port-forward 443 -> substrate host 4. Boot this daemon 5. https://andelinwest.com/ LIVE COMPOSES (per "avoid duplicate primitives"): nx_http_server (TCP listen + accept; existing primitive) nx_tls13_server_session_run_ed25519 (V-HOST-2+1-2) OR nx_tls13_server_session_run (existing ECDSA path) nx_tls13_server_session_app_recv (decrypt request bytes) nx_tls13_server_session_app_send (encrypt response bytes) wiki/nx_wiki_routes.nx_wiki_route_dispatch (existing wiki router) nx_csprng (server_random + x25519 priv) nx_http_header_find (req parse; existing helper) V-HOST-2 SCOPE: - Single-vhost daemon (one cert + one wiki state); per-vhost dispatch is V-HOST-2.5 refactor when N > 1 sites need this daemon - Defaults to Ed25519 cert path (V-HOST-2+1 modern) - Reads cert + priv from operator-config paths - Accept loop: per connection runs TLS handshake + dispatches one HTTP request to wiki router + sends encrypted response - Per Cardinal 14 graceful degradation: per-conn errors don't kill the daemon V-HOST-2 NON-SCOPE (queued for V-HOST-2.5 + V-HOST-5): - Multi-vhost dispatch (one daemon serving N domains) - Keep-alive (single request per TLS session V1) - Session resumption (PSK / 0-RTT) - Unified per-vhost handler dispatch (currently wiki-only)

dependencies 16 imports · 0 importers

nx_syscalls.nx nx_csprng.nx nx_http_server.nx nx_http_io.nx nx_tls13_server_session.nx nx_tls13_server_session_run.nx nx_tls13_server_session_app_data.n nx_admin_login_flow.nx nx_search_handler_flow.nx nx_kv_store.nx nx_wiki_https_daemon.nx

diagram shows first 10 each side; +6 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_csprng.nxnx_http_server.nxnx_http_io.nxnx_tls13_server_session.nxnx_tls13_server_session_run.nxnx_tls13_server_session_app_data.nxnx_admin_login_flow.nxnx_search_handler_flow.nxnx_kv_store.nxnx_hash_facade.nxnx_search_inverted.nxnx_wiki_routes.nxnx_wiki_index_builder.nxnx_wiki_archive_router.nxnx_artifact_store.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_csprng_fill sys_mmap ↻ nx_csprng_urandom_path sys_openat_rd ↻ sys_read ↻ sys_close ↻ nx_kv_store_init nx_admin_login_config_init nx_search_flow_init sys_mmap ↻ nx_search_query_init sys_mmap ↻ nx_search_onsite_init sys_mmap ↻ nx_search_results_init nx_wiki_doc_store_init sys_mmap ↻ nx_wiki_index_builder_init nx_inv_new nx_wiki_index_builder_add nx_wiki_doc_store_add sys_mmap ↻ nx_wib_pool_alloc nx_inv_index_row nx_inv_is_token_char nx_inv_hash_bytes_lower nx_inv_add_posting nx_inv_count_token nx_inv_slot_at nx_inv_slot_hash nx_inv_slot_set_hash nx_inv_slot_set_postings_c

structs

none

consts

62const NX_WHD_OK: i64 = 0
63const NX_WHD_BAD_INPUT: i64 = 3800
64const NX_WHD_CERT_LOAD_FAILED: i64 = 3801
65const NX_WHD_BIND_FAILED: i64 = 3802
66const NX_WHD_HS_FAILED: i64 = 3803
67const NX_WHD_RECV_FAILED: i64 = 3804
68const NX_WHD_PARSE_FAILED: i64 = 3805
69const NX_WHD_DISPATCH_FAILED: i64 = 3806
70const NX_WHD_SEND_FAILED: i64 = 3807
73const NX_WHD_LISTEN_PORT: i64 = 8443 // V1 demo; production binds 443 via cap_net_bind
74const NX_WHD_BACKLOG: i64 = 32
75const NX_WHD_REQ_REC_CAP: i64 = 16384 // 16 KB encrypted request
76const NX_WHD_PLAIN_CAP: i64 = 16384 // 16 KB decrypted request
77const NX_WHD_RESP_CAP: i64 = 1048576 // 1 MB response body
78const NX_WHD_OUT_REC_CAP: i64 = 1048768 // resp + TLS overhead
79const NX_WHD_REQUEST_BUDGET: i64 = 100000 // hard cap on total requests served per process
82const NX_WHD_DEFAULT_CERT_PATH: *u8 = "/tmp/nx_cert_gen_demo_ed25519_cert.der" as *u8
83const NX_WHD_DEFAULT_PRIV_PATH: *u8 = "/tmp/nx_cert_gen_demo_ed25519_priv.bin" as *u8
86const NX_WHD_REALM: *u8 = "Nishi Wiki" as *u8
87const NX_WHD_REALM_N: i64 = 10
88const NX_WHD_ADMIN_USER: *u8 = "elderwesto" as *u8
89const NX_WHD_ADMIN_USER_N: i64 = 10

functions

93func nx_whd_handle_one(
169func main() -> i64