nx_cert_autorenew_lib.nx
buildroot/runtime/nx_cert_autorenew_lib.nx
about
nx_cert_autorenew_lib.nx -- PURE mapping + threshold logic for the per-domain wildcard TLS
auto-renewal system (no I/O, no TLS, no fork). Split out (rule 15 DRY / rule 9 single-responsibility)
so BOTH the driver (nx_cert_autorenew.nx) and the gate (nx_cert_autorenew_gate.nx) share ONE copy of
the domain->path mapping + the WARN/EXPIRED trigger predicate -- the exact logic the gate proves and
the driver acts on. Reuses nx_cert_monitor's verdict vocabulary (CM_OK/WARN/EXPIRED/NOCERT + cm_verdict
+ CM_WARN_DAYS) so the monitor and the renewer can NEVER disagree about "is this cert expiring".
The mapping closes the gap that started this whole arc: a per-domain wildcard cert that silently lapsed
because nothing renewed it. Given a dotted domain D, the system knows EXACTLY:
issue output -> /tmp/new_<D>_fullchain.der + /tmp/new_<D>_ecdsa_key.bin (nx_acme_dns01_issue argv[1]=D)
live SNI path -> /volume1/.../certs/le_<label>_fullchain.der + le_<label>_ecdsa_key.bin
(label = D's first DNS label; the names nx_sites_daemon loads per ClientHello SNI)
license_tier: ORIGINAL (composes nx_cert_monitor's verdict logic; no new crypto/transport)
dependencies 1 imports · 2 importers
imports: nx_cert_monitor.nx
imported by: nx_cert_autorenew.nxnx_cert_autorenew_gate.nx
structs
| none |
consts
| 17 | const CAR_CERT_DIR: *u8 = "/volume1/homes/elderwesto/nishihost/certs/" as *u8 |
| 18 | const CAR_TMP_NEW: *u8 = "/tmp/new_" as *u8 |
functions
| 21 | func car_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 22 | func car_streq(a: *u8, b: *u8) -> i64 |
| 29 | func car_put(out: *u8, off: i64, s: *u8) -> i64 |
| 38 | func car_label(domain: *u8, out: *u8) -> i64 |
| 50 | func car_issue_der(domain: *u8, out: *u8) -> i64 |
| 56 | func car_issue_key(domain: *u8, out: *u8) -> i64 |
| 62 | func car_remote_der(label: *u8, out: *u8) -> i64 |
| 68 | func car_remote_key(label: *u8, out: *u8) -> i64 |
| 76 | func car_should_renew(verdict: i64) -> i64 |