code wiki / (root) / nx_pages_config.nx

nx_pages_config.nx

buildroot/runtime/nx_pages_config.nx

7387 B208 linesdepth 4pulls 4 transitivereach 3 importersview sourcekind librarytopic pages
docsdependenciesstructsconstsfunctions

about

nx_pages_config.nx -- D1.6 of NISHI_DEPLOY_ROADMAP. Loads vhost map from a config file so nx_pages_daemon + nx_pages_https_daemon can be deployed without recompiling for per-host doc-root changes. File format (one entry per line, very simple to keep the parser tiny): # nishifamily.com primary vhost=nishifamily.com:/share/nishi-pages/dist vhost=www.nishifamily.com:/share/nishi-pages/dist vhost=andelinwest.com:/share/andelin-pages/dist fallback=0 Rules: - Blank lines + lines starting with '#' are ignored. - 'vhost=<host>:<root>' adds a vhost (order preserved; fallback_idx references this 0-based ordering). - 'fallback=<idx>' picks the fallback vhost. Omit -> no fallback. - All other keys (http_port, https_port, cert_path, key_path) are recognized but consumed via separate accessor functions; the parser stores their string values into a flat string arena and exposes lookup by name. Per NISHI_DEPLOY_ROADMAP D1.6. Companion: SIGHUP zero-downtime reload is deferred to D1.6.5.

dependencies 2 imports · 3 importers

nx_syscalls.nx nx_pages_vhost.nx nx_pages_config.nx nx_pages_config_test.nx nx_pages_daemon.nx nx_pages_https_daemon.nx

imports: nx_syscalls.nxnx_pages_vhost.nx

imported by: nx_pages_config_test.nxnx_pages_daemon.nxnx_pages_https_daemon.nx

structs

none

consts

29const NX_PCFG_OK: i64 = 0
30const NX_PCFG_ERR_OPEN: i64 = 1
31const NX_PCFG_ERR_READ: i64 = 2
32const NX_PCFG_ERR_TOO_BIG: i64 = 3
33const NX_PCFG_ERR_PARSE: i64 = 4
34const NX_PCFG_ERR_VHOST_OOM: i64 = 5
36const NX_PCFG_MAX_FILE_BYTES: i64 = 65536 // 64 KB conf cap (V1)
37const NX_PCFG_MAX_VHOSTS: i64 = 64

functions

41func _pcfg_is_ws(b: i64) -> i64
47func _pcfg_strlen(s: *u8) -> i64
53func _pcfg_byte_eq(a: *u8, ao: i64, b: *u8, bo: i64, n: i64) -> i64
64func _pcfg_find_byte(buf: *u8, start: i64, end: i64, needle: i64) -> i64
79func _pcfg_parse_i64(buf: *u8, start: i64, end: i64, out_val: *i64) -> i64
105func nx_pages_config_load(