code wiki / (root) / nx_golive.nx

nx_golive.nx

buildroot/runtime/nx_golive.nx

13746 B259 linesdepth 22pulls 139 transitivereach 1 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_golive.nx -- ONE-COMMAND domain purchase->live DRIVER. Composes the proven executors (nx_porkbun_domain's pbd_* + nx_acme_porkbun's DNS) into a single ordered, spend-safe, auto-quoting walk that HALTS at the two operator gates. This is the "deploy it from here without any issues" front door: the operator runs ONE command; the driver reads the live quote itself, checks it against the cap, dry-runs the purchase server-side, and STOPS -- it will not spend or mutate the edge without the explicit confirm tokens. nx_golive <domain> <credfile> <cap_cents> [confirm-spend] [confirm-edge] STAGES (each STOPS on failure; the pipeline never proceeds past a red step): 1 CHECK live availability + AUTO-EXTRACT the quote (cents) from the registrar 2 CAP quote <= cap_cents, else STOP (the spend ceiling is the operator's, passed in) 3 DRYRUN server-side create dryRun:true -- full preflight, ZERO charge (SUCCESS => wouldSucceed) -- GATE A: no `confirm-spend` => STOP here with the exact cost; re-run with the token to buy 4 REGISTER real create (spends account credit); parse orderId 5 WANIP ping -> our public IP (for the A records) 6 DNS publish A @ + www -> our IP 7 CERT ssl/retrieve the bundle (saved 0600; key never printed) -- GATE B: no `confirm-edge` => STOP; edge SNI+route is operator-gated (contended NAS files) 8 EDGE/VERIFY -- left to the never-brick mgmt plane + a live 200 check (operator-driven) license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_porkbun_domain.nx nx_golive.nx nx_golive_gate.nx

imports: nx_porkbun_domain.nx

imported by: nx_golive_gate.nx

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

main gl_w gl_streq pbd_store nx_trust_store_load_from_c sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_nss_certdata_parse sys_mmap ↻ _pat_class_cert _pat_value_octal _pat_end _find_newline _starts_with _parse_octal_line sys_mmap ↻ _is_space _decode_octal_escape _is_octal trust_store_alloc sys_mmap ↻ nx_x509_trust_store_load sys_mmap ↻ x509_parse sys_mmap ↻ asn1_cursor_init asn1_expect_tag sys_mmap ↻ asn1_read_tlv_header asn1_read_length x509_read_tlv sys_mmap ↻ asn1_expect_tag ↻ x509_read_alg_id sys_mmap ↻

structs

none

consts

23const K_MAGIC_2048: i64 = 2048

functions

25func gl_w(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
26func gl_nn(v: i64) -> i64 { let bb: *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{bb[i]=t[k-1-i];i=i+1} sys_write(1,bb,k); return 0 }
called by 1: main
27func gl_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: gl_json_ismain
28func gl_streq(a: *u8, b: *u8) -> i64
called by 1: main
35func gl_body(resp: *u8, total: i64, boff: *i64, blen: *i64) -> i64
43func gl_dollars_to_cents(buf: *u8, off: i64, len: i64) -> i64
called by 2: gl_json_centsmain
64func gl_json_cents(resp: *u8, total: i64, key: *u8, keylen: i64) -> i64
74func gl_json_is(resp: *u8, total: i64, key: *u8, keylen: i64, want: *u8) -> i64
88func gl_json_copy(resp: *u8, total: i64, key: *u8, keylen: i64, out: *u8, cap: i64) -> i64
called by 2: mainmain calls 2: gl_bodynx_acme_json_str
103func gl_create(raw: *u8, ao: i64, an: i64, so: i64, sn2: i64, dom: *u8, quote: i64, is_dry: i64,
called by 1: main calls 3: pk_putpbd_putnnx_acme_req
119func main(argc: i64, argv: *i64) -> i64