nx_pages_config.nx
buildroot/runtime/nx_pages_config.nx
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
imports: nx_syscalls.nxnx_pages_vhost.nx
imported by: nx_pages_config_test.nxnx_pages_daemon.nxnx_pages_https_daemon.nx
structs
| none |
consts
| 29 | const NX_PCFG_OK: i64 = 0 |
| 30 | const NX_PCFG_ERR_OPEN: i64 = 1 |
| 31 | const NX_PCFG_ERR_READ: i64 = 2 |
| 32 | const NX_PCFG_ERR_TOO_BIG: i64 = 3 |
| 33 | const NX_PCFG_ERR_PARSE: i64 = 4 |
| 34 | const NX_PCFG_ERR_VHOST_OOM: i64 = 5 |
| 36 | const NX_PCFG_MAX_FILE_BYTES: i64 = 65536 // 64 KB conf cap (V1) |
| 37 | const NX_PCFG_MAX_VHOSTS: i64 = 64 |
functions
| 41 | func _pcfg_is_ws(b: i64) -> i64 called by 1: nx_pages_config_load |
| 47 | func _pcfg_strlen(s: *u8) -> i64 |
| 53 | func _pcfg_byte_eq(a: *u8, ao: i64, b: *u8, bo: i64, n: i64) -> i64 called by 1: nx_pages_config_load |
| 64 | func _pcfg_find_byte(buf: *u8, start: i64, end: i64, needle: i64) -> i64 called by 1: nx_pages_config_load |
| 79 | func _pcfg_parse_i64(buf: *u8, start: i64, end: i64, out_val: *i64) -> i64 called by 1: nx_pages_config_load |
| 105 | func nx_pages_config_load( |