ovh: fix nameserver matching

there's a whole bunch: ovh.ca, ovh.us, ovh.com, ovhcloud.com, ovh.co.uk

https://forum.cloudron.io/topic/10435/limitation-with-dns-using-ovh-in-validating-name-server-domains-domain-nameservers-are-not-set-to-ovh
This commit is contained in:
Girish Ramakrishnan
2023-11-16 10:27:09 +01:00
parent fe1c483b78
commit efd42b7293

View File

@@ -216,7 +216,7 @@ async function verifyDomainConfig(domainObject) {
if (error && error.code === 'ENOTFOUND') throw new BoxError(BoxError.BAD_FIELD, 'Unable to resolve nameservers for this domain');
if (error || !nameservers) throw new BoxError(BoxError.BAD_FIELD, error ? error.message : 'Unable to get nameservers');
if (!nameservers.every(function (n) { return n.toLowerCase().indexOf('ovh.net') !== -1; })) { // SoYouStart and Kimsufi can also be accomdated
if (!nameservers.every(function (n) { return n.toLowerCase().search(/ovh|kimsufi/) !== -1; })) { // SoYouStart and Kimsufi can also be accomdated
debug('verifyDomainConfig: %j does not contain OVH NS', nameservers);
throw new BoxError(BoxError.BAD_FIELD, 'Domain nameservers are not set to OVH');
}