From e350af7eed6804a32f8f9729bf99aa7de9f2b717 Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Thu, 27 Jun 2024 15:06:41 +0200 Subject: [PATCH] during dnscheck, if srv accountconfig record with just a dot, for a non-existent service, is missing, show as warning instead of error the suggested dns records mention that these records are optional, but the dnscheck makes it look serious. not helpful. also remove unneeded whitespace in list of errors/warnings. for issue #184 by morki, thanks for reporting! --- webadmin/admin.go | 6 +++++- webadmin/admin.js | 4 ++-- webadmin/admin.ts | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/webadmin/admin.go b/webadmin/admin.go index 18fb747..bd2f46e 100644 --- a/webadmin/admin.go +++ b/webadmin/admin.go @@ -1404,7 +1404,11 @@ When enabling MTA-STS, or updating a policy, always update the policy first (thr if err != nil { addf(&r.SRVConf.Errors, "Looking up SRV record %q: %s", name, err) } else if len(req.srvs) == 0 { - addf(&r.SRVConf.Errors, "Missing SRV record %q", name) + if req.host == "." { + addf(&r.SRVConf.Warnings, "Missing optional SRV record %q", name) + } else { + addf(&r.SRVConf.Errors, "Missing SRV record %q", name) + } } else if len(req.srvs) != 1 || req.srvs[0].Target != req.host || req.srvs[0].Port != req.port { addf(&r.SRVConf.Errors, "Unexpected SRV record(s) for %q", name) } diff --git a/webadmin/admin.js b/webadmin/admin.js index 36bf6c2..3ec8136 100644 --- a/webadmin/admin.js +++ b/webadmin/admin.js @@ -2592,8 +2592,8 @@ const domainDNSCheck = async (d) => { if ((r.Errors || []).length === 0 && (r.Warnings || []).length === 0) { success = box(green, 'OK'); } - const errors = (r.Errors || []).length === 0 ? [] : box(red, dom.ul(style({ marginLeft: '1em' }), (r.Errors || []).map(s => dom.li(s)))); - const warnings = (r.Warnings || []).length === 0 ? [] : box(yellow, dom.ul(style({ marginLeft: '1em' }), (r.Warnings || []).map(s => dom.li(s)))); + const errors = (r.Errors || []).length === 0 ? [] : box(red, dom.ul((r.Errors || []).map(s => dom.li(s)))); + const warnings = (r.Warnings || []).length === 0 ? [] : box(yellow, dom.ul((r.Warnings || []).map(s => dom.li(s)))); let instructions = null; if (r.Instructions && r.Instructions.length > 0) { instructions = dom.div(style({ margin: '.5ex 0' })); diff --git a/webadmin/admin.ts b/webadmin/admin.ts index de6e70a..393939d 100644 --- a/webadmin/admin.ts +++ b/webadmin/admin.ts @@ -1928,8 +1928,8 @@ const domainDNSCheck = async (d: string) => { if ((r.Errors || []).length === 0 && (r.Warnings || []).length === 0) { success = box(green, 'OK') } - const errors = (r.Errors || []).length === 0 ? [] : box(red, dom.ul(style({marginLeft: '1em'}), (r.Errors || []).map(s => dom.li(s)))) - const warnings = (r.Warnings || []).length === 0 ? [] : box(yellow, dom.ul(style({marginLeft: '1em'}), (r.Warnings || []).map(s => dom.li(s)))) + const errors = (r.Errors || []).length === 0 ? [] : box(red, dom.ul((r.Errors || []).map(s => dom.li(s)))) + const warnings = (r.Warnings || []).length === 0 ? [] : box(yellow, dom.ul((r.Warnings || []).map(s => dom.li(s)))) let instructions: HTMLElement | null = null if (r.Instructions && r.Instructions.length > 0) {