diff --git a/src/dns.js b/src/dns.js index 43a9066f1..48b27e48f 100644 --- a/src/dns.js +++ b/src/dns.js @@ -154,7 +154,7 @@ async function upsertDnsRecords(subdomain, domain, type, values) { assert.strictEqual(typeof type, 'string'); assert(Array.isArray(values)); - debug(`upsertDnsRecord: location ${subdomain} on domain ${domain} of type ${type} with values ${JSON.stringify(values)}`); + debug(`upsertDnsRecords: subdomain:${subdomain} domain:${domain} type:${type} values:${JSON.stringify(values)}`); const domainObject = await domains.get(domain); await api(domainObject.provider).upsert(domainObject, subdomain, type, values); @@ -166,7 +166,7 @@ async function removeDnsRecords(subdomain, domain, type, values) { assert.strictEqual(typeof type, 'string'); assert(Array.isArray(values)); - debug('removeDnsRecords: %s on %s type %s values', subdomain, domain, type, values); + debug(`removeDnsRecords: subdomain:${subdomain} domain:${domain} type:${type} values:${JSON.stringify(values)}`); const domainObject = await domains.get(domain); const [error] = await safe(api(domainObject.provider).del(domainObject, subdomain, type, values)); diff --git a/src/dns/porkbun.js b/src/dns/porkbun.js index 9ffc5c050..d6afc5486 100644 --- a/src/dns/porkbun.js +++ b/src/dns/porkbun.js @@ -44,7 +44,7 @@ async function getDnsRecords(domainConfig, zoneName, name, type) { assert.strictEqual(typeof name, 'string'); assert.strictEqual(typeof type, 'string'); - debug(`get: ${name} in zone ${zoneName} of type ${type}`); + debug(`get: ${name} zone:${zoneName} type:${type}`); const data = { secretapikey: domainConfig.secretapikey, @@ -100,7 +100,7 @@ async function upsert(domainObject, location, type, values) { zoneName = domainObject.zoneName, name = dns.getName(domainObject, location, type) || ''; - debug(`upsert: ${name} in zone ${zoneName} of type ${type} with values ${JSON.stringify(values)}`); + debug(`upsert: ${name} zone:${zoneName} type:${type} values:${JSON.stringify(values)}`); await delDnsRecords(domainConfig, zoneName, name, type); @@ -135,7 +135,7 @@ async function upsert(domainObject, location, type, values) { debug(`upsert: created record with id ${response.body.id}`); - await timers.setTimeout(1500); // see rate limit note at top of file + await timers.setTimeout(5000); // see rate limit note at top of file } } @@ -162,7 +162,7 @@ async function del(domainObject, location, type, values) { zoneName = domainObject.zoneName, name = dns.getName(domainObject, location, type) || ''; - debug(`del: ${name} in zone ${zoneName} of type ${type} with values ${JSON.stringify(values)}`); + debug(`del: ${name} zone ${zoneName} of type ${type} with values ${JSON.stringify(values)}`); const data = { secretapikey: domainConfig.secretapikey, @@ -185,7 +185,7 @@ async function del(domainObject, location, type, values) { if (response.statusCode !== 200) throw new BoxError(BoxError.EXTERNAL_ERROR, formatError(response)); if (response.body.status !== 'SUCCESS') throw new BoxError(BoxError.EXTERNAL_ERROR, `Invalid status in response: ${JSON.stringify(response.body)}`); - await timers.setTimeout(1500); // see rate limit note at top of file + await timers.setTimeout(5000); // see rate limit note at top of file } } diff --git a/src/mail.js b/src/mail.js index 552519c9f..365c04003 100644 --- a/src/mail.js +++ b/src/mail.js @@ -684,7 +684,7 @@ async function upsertDnsRecords(domain, mailFqdn) { assert.strictEqual(typeof domain, 'string'); assert.strictEqual(typeof mailFqdn, 'string'); - debug(`upsertDnsRecords: updating mail dns records of domain ${domain} and mail fqdn ${mailFqdn}`); + debug(`upsertDnsRecords: updating mail dns records domain:${domain} mailFqdn:${mailFqdn}`); const mailDomain = await getDomain(domain); if (!mailDomain) throw new BoxError(BoxError.NOT_FOUND, 'mail domain not found'); @@ -706,7 +706,7 @@ async function upsertDnsRecords(domain, mailFqdn) { const dmarcRecords = await dns.getDnsRecords('_dmarc', domain, 'TXT'); // only update dmarc if absent. this allows user to set email for reporting if (dmarcRecords.length === 0) records.push({ subdomain: '_dmarc', domain, type: 'TXT', values: [ '"v=DMARC1; p=reject; pct=100"' ] }); - debug(`upsertDnsRecords: will update ${domain} with ${JSON.stringify(records)}`); + debug(`upsertDnsRecords: updating ${domain} with ${records.length} records: ${JSON.stringify(records)}`); for (const record of records) { await dns.upsertDnsRecords(record.subdomain, record.domain, record.type, record.values);