diff options
| author | Adam Soltys <[email protected]> | 2026-11-15 21:33:35 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-11-15 21:33:35 -0700 |
| commit | 159ef981bcee5fb7792b992551843df2618efcce (patch) | |
| tree | 5ab6493f8ed138657cfc18dc912dc3361b19ecb6 /names | |
| parent | 364a3b9793654b6373a4803d52dcb8019ed11a55 (diff) | |
| download | coinosv3-server-159ef981bcee5fb7792b992551843df2618efcce.tar.gz coinosv3-server-159ef981bcee5fb7792b992551843df2618efcce.zip | |
dns-migrate: an optional domain argument (rehearse cf-cleanup on staging.coinos.io first)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VMan6SwkivduFDDkMmnXjZ
Diffstat (limited to 'names')
| -rw-r--r-- | names/dns-migrate.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/names/dns-migrate.js b/names/dns-migrate.js index 4753c9e..c4ae68b 100644 --- a/names/dns-migrate.js +++ b/names/dns-migrate.js @@ -3,6 +3,7 @@ // docker exec names bun names/dns-migrate.js backfill every name of a knot domain → Knot // docker exec names bun names/dns-migrate.js check Knot holds what the database says // docker exec names bun names/dns-migrate.js cf-cleanup delete the per-name TXT records from Cloudflare +// (each takes an optional domain, e.g. `cf-cleanup staging.coinos.io`) // The database is only read: the running registrar owns it. Names it writes // after the switch go to Knot themselves, and a stale Cloudflare record id // left in the database is harmless (knotWrite's cleanup of it just fails). @@ -14,7 +15,9 @@ const CFG = JSON.parse(readFileSync(process.env.NAMES_CONFIG, 'utf8')); const DOMAINS = CFG.domains || {}; const TTL = 300; const recordName = (name, domain) => `${name}.user._bitcoin-payment.${domain}`; -const knotDomains = Object.keys(DOMAINS).filter((d) => DOMAINS[d].knot); +// an optional last argument narrows a run to one domain +const only = process.argv[3]; +const knotDomains = Object.keys(DOMAINS).filter((d) => DOMAINS[d].knot && (!only || d === only)); const log = (...a) => console.log(new Date().toISOString(), ...a); function names() { |
