From 4aa5606408f7188a7edda5c010793f9d7d1dc076 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 15 Nov 2026 21:15:44 -0700 Subject: names: a domain may have no DNS records (dns: false in its config). paff.club does: every browser's PAFF tipping wallet claims a name there, the zone reached Cloudflare's record quota ("Record quota exceeded", 81045) and every new claim failed, its 500 answered without CORS so the browser only saw a CORS error; while the records were never usable there, DNSSEC being off. Its names stay LNURL and NIP-05; a record kept from before is removed as its name updates Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VMan6VeUVDmcp6GPSFWPwT --- names/server.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'names/server.js') diff --git a/names/server.js b/names/server.js index 83996d7..92e6fd8 100644 --- a/names/server.js +++ b/names/server.js @@ -40,7 +40,7 @@ import { accountOf, accountBlockers, forgetAccount } from './forget.js'; const CFG = JSON.parse(readFileSync(process.env.NAMES_CONFIG || join(import.meta.dir, 'config.json'), 'utf8')); -// { port, domains: { '': { zoneId, welcome? } }, domain (default), cfEmail, cfKey, +// { port, domains: { '': { zoneId, welcome?, dns? } }, domain (default), cfEmail, cfKey, // dbFile (SQLite state), stateFile (the old JSON state, imported once), // ln: { kind:'socket', path } — the ASP's CLN, for per-name bolt12 offers, // forwarder: { mnemonic, ark, esplora, network } — a small float ark wallet @@ -88,6 +88,15 @@ const cfHeaders = { const recordName = (name, domain) => `${name}.user._bitcoin-payment.${domain}`; async function cfWrite(name, domain, uri, existingId) { + // A domain whose config says dns: false gets no BIP-353 records: its names + // are LNURL and NIP-05 only. paff.club: every browser's tipping wallet + // claims a name there, the zone hit Cloudflare's record quota ("Record quota + // exceeded", 81045) and claims failed, while its records were never usable + // (DNSSEC is off there). A record kept from before goes as its name updates. + if (DOMAINS[domain]?.dns === false) { + if (existingId) await cfDelete(domain, existingId).catch((e) => log(`dns record ${existingId} stayed: ${e.message}`)); + return null; + } // TXT character-strings cap at 255 bytes; BIP-353 readers concatenate the // chunks in order, so a long ark+lno URI just spans several quoted strings. const zoneId = DOMAINS[domain]?.zoneId; @@ -105,6 +114,7 @@ async function cfWrite(name, domain, uri, existingId) { return j.result.id; } async function cfDelete(domain, recordId) { + if (!recordId) return; // a name on a domain without records (dns: false) const zoneId = DOMAINS[domain]?.zoneId; if (!zoneId) throw new Error('unknown domain'); const r = await fetch(`${CF}/zones/${zoneId}/dns_records/${recordId}`, { -- cgit v1.2.3