better debugging
This commit is contained in:
parent
5a2e494352
commit
379a8bcabb
@ -263,7 +263,7 @@ Cloudron.prototype.checkA = function (callback) {
|
|||||||
|
|
||||||
if (records[0] !== that._box.ip) return callback(new Error('Bad A record. ' + records[0] + '. Expecting ' + that._box.ip));
|
if (records[0] !== that._box.ip) return callback(new Error('Bad A record. ' + records[0] + '. Expecting ' + that._box.ip));
|
||||||
|
|
||||||
callback();
|
callback(null, records);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -275,7 +275,7 @@ Cloudron.prototype.checkSPF = function (callback) {
|
|||||||
|
|
||||||
if (records[0][0].search(new RegExp('^v=spf1 ip4:' + that._box.ip + ' ~all$')) !== 0) return callback(new Error('Bad SPF record. ' + records[0][0]));
|
if (records[0][0].search(new RegExp('^v=spf1 ip4:' + that._box.ip + ' ~all$')) !== 0) return callback(new Error('Bad SPF record. ' + records[0][0]));
|
||||||
|
|
||||||
callback();
|
callback(null, records);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -287,7 +287,7 @@ Cloudron.prototype.checkDKIM = function (callback) {
|
|||||||
// node removes the quotes or maybe this is why a 2d-array?
|
// node removes the quotes or maybe this is why a 2d-array?
|
||||||
if (records[0][0].search(/^v=DKIM1; t=s; p=.*$/) !== 0) return callback(new Error('Bad DKIM record. ' + records[0][0]));
|
if (records[0][0].search(/^v=DKIM1; t=s; p=.*$/) !== 0) return callback(new Error('Bad DKIM record. ' + records[0][0]));
|
||||||
|
|
||||||
callback();
|
callback(null, records);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -299,7 +299,7 @@ Cloudron.prototype.checkDMARC = function (callback) {
|
|||||||
// node removes the quotes or maybe this is why a 2d-array?
|
// node removes the quotes or maybe this is why a 2d-array?
|
||||||
if (records[0][0].search(/^v=DMARC1; p=none; pct=100; rua=mailto:.*; ruf=.*$/) !== 0) return callback(new Error('Bad DMARC record. ' + records[0][0]));
|
if (records[0][0].search(/^v=DMARC1; p=none; pct=100; rua=mailto:.*; ruf=.*$/) !== 0) return callback(new Error('Bad DMARC record. ' + records[0][0]));
|
||||||
|
|
||||||
callback();
|
callback(null, records);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -99,11 +99,13 @@ describe('Appstore new user flow', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('has setup DNS records cleaned up', function (done) {
|
it('has setup DNS records cleaned up', function (done) {
|
||||||
dns.setServers([ '8.8.8.8' ]); // use different dns server so as to not get cached results
|
dns.setServers([ '205.251.199.12' ]); // use different dns server so as to not get cached results
|
||||||
|
|
||||||
function expectError(tag, fn) {
|
function expectError(tag, fn) {
|
||||||
return function (cb) {
|
return function (cb) {
|
||||||
fn(function (error) {
|
fn(function (error, records) {
|
||||||
|
if (!error) console.error('Records of %s is %j', tag, records);
|
||||||
|
|
||||||
cb(error ? null : new Error('Expecting error for ' + tag));
|
cb(error ? null : new Error('Expecting error for ' + tag));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user