code wiki / _hdl_build / nx_nginx_cert_sync.nx

nx_nginx_cert_sync.nx

buildroot/runtime/_hdl_build/nx_nginx_cert_sync.nx

8278 B233 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_nginx_cert_sync.nx -- feed the AUTORENEWED Route-B wildcard cert into the DSM-nginx cert store (single renewal pipeline, many consumers -- DRY). The nginx nishi-wildcard PEMs went stale (Mar 30 issue -> expired ~Jun 28) while nx_cert_autorenew kept the sites.elf DER fresh (Jun 29): chat/matrix/ mfg/staging.nishifamily.com all served an EXPIRED cert. This organ converts the fresh DER chain + raw P-256 key into the PEM files nginx needs. Caller (aw_sudo cmd) wraps it with backup + nginx -t gate + reload + restore-on-fail (never-brick). usage: nx_nginx_cert_sync <fullchain.der> <key32.bin> <outdir> writes: <outdir>/fullchain.pem <outdir>/cert.pem <outdir>/privkey.pem license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_nginx_cert_sync.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main cs_puts sys_write sys_mmap cs_read sys_openat_rd sys_read sys_close cs_putn sys_mmap ↻ sys_write ↻ cs_pem_cert cs_append cs_b64 cs_append ↻ cs_b64 ↻ cs_path cs_write sys_openat_wr sys_write ↻ sys_close ↻

structs

none

consts

11const K_MAGIC_65536: i64 = 65536
12const K_MAGIC_131072: i64 = 131072
13const K_MAGIC_4096: i64 = 4096
14const K_MAGIC_1024: i64 = 1024

functions

16func cs_puts(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 calls 1: sys_write
17func cs_putn(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
18func cs_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
20func cs_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
38func cs_b64(src: *u8, n: i64, out: *u8, oo: *i64) -> i64
called by 2: cs_pem_certmain
69func cs_append(out: *u8, oo: *i64, s: *u8) -> i64
called by 2: cs_pem_certmain
78func cs_pem_cert(der: *u8, n: i64, out: *u8, oo: *i64) -> i64
called by 1: main calls 2: cs_appendcs_b64
85func cs_write(path: *u8, buf: *u8, n: i64) -> i64
100func cs_path(dir: *u8, name: *u8, out: *u8) -> i64
called by 1: main
112func main(argc: i64, argv: *i64) -> i64