code wiki / _hdl_build / nx_connect_appd.nx

nx_connect_appd.nx

buildroot/runtime/_hdl_build/nx_connect_appd.nx

25509 B486 linesdepth 16pulls 63 transitivereach 0 importersview sourcekind tooltopic connect
docsdependenciesstructsconstsfunctions

about

nx_connect_appd.nx -- the DEPLOYABLE CONNECT app daemon (ops shell around the pure core nx_connect_serve). Binds 0.0.0.0:8032 (LAN: http://192.168.8.227:8032/). Route /connect -> this port on the sovereign edge. Build with --build-only; run deliberately. license_tier: ORIGINAL 2026-07-10 PERSISTENCE + PER-SESSION: anonymous nxc_sess cookie -> an isolated persistent world. 2026-07-25 SHARED CONTENT-BLIND PLANE (E2E): daemon-owned pubkey directory + routed ciphertext, replayed from the append-only connect/shared.cbl at boot. 2026-07-25 REAL LOGIN (the accounts rung -- gates everything): full OPAQUE aPAKE (RFC 9807) via the shared nx_opaque_login seam, in CONNECT's OWN realm (nishi_connect, self-provisioned keys+store). The server stores only an OPAQUE envelope -- NO password-equivalent at rest. A signed session token rides the nxc_auth cookie; each request resolves it via olg_whoami to a stable 32-byte user-id -> the world binds to identity, not to an anonymous cookie. The display handle is resolved from a per-account file the daemon writes at register/login. Crypto lives HERE (the shell); the pure core only renders from the auth slots stamped into ctx. Unifying with one family-wide realm (nishi_site_admin) is the next rung.

dependencies 3 imports · 0 importers

nx_connect_accounts.nx nx_connect_album.nx nx_opaque_login.nx nx_connect_appd.nx

imports: nx_connect_accounts.nxnx_connect_album.nxnx_opaque_login.nx

imported by: nobody (leaf or entry point)

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

main cs_world_new sys_mmap cs_world_reset cs_cat sys_mkdir olg_ctx_setup_ttl nx_uas_server_keys_load_or sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close _uas_hex_dec _uas_nib nx_csprng_fill sys_mmap ↻ nx_csprng_urandom_path sys_openat_rd ↻ sys_read ↻ sys_close ↻ nx_opq_derive_keypair sys_mmap ↻ _voprf_load_context_string u256_alloc nx_scratch nx_scratch_init nx_scratch_oom sys_mmap ↻ nx_opq_hash_to_scalar sys_mmap ↻ nx_h2c_expand_message_xmd_ sys_mmap ↻ _h2c_i2osp_1 _h2c_i2osp_2 u256_alloc ↻ _opq_reduce_48be_mod_n u256_alloc ↻

structs

none

consts

19const CD_MAGIC_262144: i64 = 262144
20const CD_MAGIC_1048576: i64 = 1048576
21const CD_MAGIC_1024: i64 = 1024 // shared-plane delta-append emit buffer (one row max ~350B)
23const CD_PORT: i64 = 0x1f60 // 8032 (8031 = survey lane)
26const CD_REALM: *u8 = "nishi_connect"
27const CD_REALM_N: i64 = 13
28const CD_DISP: *u8 = "Nishi Connect"
29const CD_DISP_N: i64 = 13
30const CD_AUTH_KEYS: *u8 = "connect_auth_keys.bin\x00"
31const CD_AUTH_STORE: *u8 = "connect_auth_store.log\x00"
32const CD_SESS_TTL: i64 = 86400 // 24h == NX_MAUTH_HARD_MAX_TTL_S (the modauth hard cap; a longer TTL is
35const CD_ARGON_M: i64 = 19456 // 19 MiB argon2id (OWASP 2026 alt profile) -- real KSF, snappy on the NAS
36const CD_ARGON_T: i64 = 2
37const CD_ARGON_P: i64 = 1
38const CD_PW_MIN: i64 = 8 // minimum passphrase length
39const CD_COMPACT_EVERY: i64 = 16 // after this many delete-on-delivery acks, physically compact shared.cbl

functions

41func cd_p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main
42func cd_addr(out: *u8, port: i64) -> i64
called by 1: main
51func cd_is_post(req: *u8) -> i64
86func cd_req_path(req: *u8, reqlen: i64, out: *u8, cap: i64) -> i64
101func cd_lower(buf: *u8, n: i64) -> i64
108func cd_handle_path(acct: i64, out: *u8) -> i64
123func cd_write_handle(acct: i64, handle: *u8, hn: i64) -> i64
132func cd_read_handle(acct: i64, out: *u8, cap: i64) -> i64
158func cd_inject_line(resp: *u8, resp_len: i64, line: *u8, out: *u8, cap: i64) -> i64
173func cd_setcookie(val: *u8, val_len: i64, maxage: i64, out: *u8) -> i64
193func cd_atoi_n(s: *u8, n: i64) -> i64
199func cd_json_resp(body: *u8, bn: i64, out: *u8, cap: i64) -> i64
216func main() -> i64