Skip to content

Commit

Permalink
during dnscheck, if srv accountconfig record with just a dot, for a n…
Browse files Browse the repository at this point in the history
…on-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!
  • Loading branch information
mjl- committed Jun 27, 2024
1 parent beee035 commit e350af7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion webadmin/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions webadmin/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' }));
Expand Down
4 changes: 2 additions & 2 deletions webadmin/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e350af7

Please sign in to comment.