nx_wiki_vhost_table.nx
buildroot/runtime/wiki/nx_wiki_vhost_table.nx
about
nx_wiki_vhost_table.nx -- V-HOST-2.5: per-vhost wiki state table.
Extends V-HOST-2 single-vhost daemon to N-vhost. Operator hosts
nishifamily.com + andelinwest.com + jasonewest.com on a single
substrate process; per-request Host header picks which site's wiki
state to dispatch to.
COMPOSES (per "avoid duplicate primitives"):
nx_syscalls (caller-allocated structs)
hub/nx_admin_login_flow / nx_search_handler_flow / nx_search_inverted
wiki/nx_wiki_index_builder + nx_wiki_archive_router + nx_artifact_store
COMPOSED BY:
wiki/nx_wiki_https_daemon (V-HOST-2.5 multi-vhost dispatch)
V-HOST-2.5 SCOPE:
- NxWikiVHost struct: hostname + per-site wiki state pointers
- NxWikiVHostTable: array of NxWikiVHost; bounded by NX_WVT_MAX_VHOSTS
- nx_wiki_vhost_add: register a site at startup
- nx_wiki_vhost_lookup_by_host: case-insensitive Host header match
- Sealed fallback policy: 0=no fallback (404 on no match); idx=fallback to that vhost
V-HOST-2.5 NON-SCOPE (queued):
- SNI-aware cert selection during TLS handshake (currently shared
multi-SAN cert across all vhosts; V-HOST-2.5.5)
- Per-vhost cert (requires extending nx_tls13_server_session_run
with cert-picker callback; V-HOST-2.5.5)
- Per-vhost admin auth (currently shared admin across vhosts;
operator may want per-vhost in V-HOST-2.5.7)
Status: V-HOST-2.5. 2026-05-27.
dependencies 7 imports · 1 importers
imports: nx_syscalls.nxnx_modern_auth_flow.nxnx_search_handler_flow.nxnx_search_inverted.nxnx_wiki_index_builder.nxnx_wiki_archive_router.nxnx_artifact_store.nx
imported by: nx_wiki_https_daemon_mv.nx
structs
| 58 | struct NxWikiVHost |
| 73 | struct NxWikiVHostTable |
consts
| 42 | const NX_WVT_OK: i64 = 0 |
| 43 | const NX_WVT_BAD_INPUT: i64 = 3820 |
| 44 | const NX_WVT_TABLE_FULL: i64 = 3821 |
| 45 | const NX_WVT_NOT_FOUND: i64 = 3822 |
| 46 | const NX_WVT_HOSTNAME_TOO_LONG: i64 = 3823 |
| 49 | const NX_WVT_MAX_VHOSTS: i64 = 16 // bounded; V+1 increases when corpus grows |
| 50 | const NX_WVT_MAX_HOSTNAME_LEN: i64 = 253 // RFC 1035 per-label * total |
| 51 | const NX_WVT_FALLBACK_NONE: i64 = 0 - 1 |
| 69 | const NX_WVT_VHOST_BYTES: i64 = 72 |
functions
| 81 | func nx_wiki_vhost_table_init(t: *NxWikiVHostTable) -> i64 |
| 91 | func nx_wiki_vhost_add(t: *NxWikiVHostTable, called by 1: main |
| 119 | func nx_wiki_vhost_set_fallback(t: *NxWikiVHostTable, idx: i64) -> i64 called by 1: main |
| 132 | func _nx_wvt_lc(b: i64) -> i64 called by 1: _nx_wvt_eq_ci |
| 137 | func _nx_wvt_eq_ci(a: *u8, a_n: i64, b: *u8, b_n: i64) -> i64 |
| 157 | func nx_wiki_vhost_lookup_by_host(t: *NxWikiVHostTable, |
| 189 | func nx_wiki_vhost_at(t: *NxWikiVHostTable, idx: i64) -> *NxWikiVHost called by 1: nx_mv_handle_one |
| 196 | func nx_wiki_vhost_count(t: *NxWikiVHostTable) -> i64 |