Allow setup to be run again as long as not-activated

this is useful if the activation fails somewhere mid-way and we don't
need to re-setup the cloudron all over
This commit is contained in:
Girish Ramakrishnan
2018-12-07 14:35:04 -08:00
parent 331c8ae247
commit 8d944f9a4a
6 changed files with 95 additions and 45 deletions

View File

@@ -8,6 +8,7 @@ exports = module.exports = {
getDomain: getDomain,
addDomain: addDomain,
removeDomain: removeDomain,
clearDomains: clearDomains,
setDnsRecords: setDnsRecords,
@@ -807,6 +808,16 @@ function removeDomain(domain, callback) {
});
}
function clearDomains(callback) {
assert.strictEqual(typeof callback, 'function');
maildb.clear(function (error) {
if (error) return callback(new MailError(MailError.INTERNAL_ERROR, error));
callback();
});
}
function setMailFromValidation(domain, enabled, callback) {
assert.strictEqual(typeof domain, 'string');
assert.strictEqual(typeof enabled, 'boolean');