code wiki / _hdl_build / nx_nginx_cert_sync.nx
nx_nginx_cert_sync.nx
buildroot/runtime/_hdl_build/nx_nginx_cert_sync.nx
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
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
structs
| none |
consts
| 11 | const K_MAGIC_65536: i64 = 65536 |
| 12 | const K_MAGIC_131072: i64 = 131072 |
| 13 | const K_MAGIC_4096: i64 = 4096 |
| 14 | const K_MAGIC_1024: i64 = 1024 |
functions
| 16 | func 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 } |
| 17 | func 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 } |
| 18 | func cs_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 20 | func cs_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 38 | func cs_b64(src: *u8, n: i64, out: *u8, oo: *i64) -> i64 |
| 69 | func cs_append(out: *u8, oo: *i64, s: *u8) -> i64 |
| 78 | func cs_pem_cert(der: *u8, n: i64, out: *u8, oo: *i64) -> i64 |
| 85 | func cs_write(path: *u8, buf: *u8, n: i64) -> i64 |
| 100 | func cs_path(dir: *u8, name: *u8, out: *u8) -> i64 called by 1: main |
| 112 | func main(argc: i64, argv: *i64) -> i64 |