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