Remove dns related settings api
This is replaced with the multi domain aware api
This commit is contained in:
@@ -467,20 +467,6 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification',
|
||||
}).error(defaultErrorHandler(callback));
|
||||
};
|
||||
|
||||
Client.prototype.setDnsConfig = function (dnsConfig, callback) {
|
||||
post('/api/v1/settings/dns_config', dnsConfig).success(function(data, status) {
|
||||
if (status !== 200) return callback(new ClientError(status, data));
|
||||
callback(null);
|
||||
}).error(defaultErrorHandler(callback));
|
||||
};
|
||||
|
||||
Client.prototype.getDnsConfig = function (callback) {
|
||||
get('/api/v1/settings/dns_config').success(function(data, status) {
|
||||
if (status !== 200) return callback(new ClientError(status, data));
|
||||
callback(null, data);
|
||||
}).error(defaultErrorHandler(callback));
|
||||
};
|
||||
|
||||
Client.prototype.setAutoupdatePattern = function (pattern, callback) {
|
||||
post('/api/v1/settings/autoupdate_pattern', { pattern: pattern }).success(function(data, status) {
|
||||
if (status !== 200) return callback(new ClientError(status, data));
|
||||
|
||||
@@ -114,47 +114,41 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
|
||||
};
|
||||
|
||||
function runConfigurationChecks() {
|
||||
Client.getDnsConfig(function (error, result) {
|
||||
var actionScope;
|
||||
|
||||
// warn user if dns config is not working (the 'configuring' flag detects if configureWebadmin is 'active')
|
||||
if (!$scope.status.webadminStatus.configuring && !$scope.status.webadminStatus.dns) {
|
||||
actionScope = $scope.$new(true);
|
||||
actionScope.action = '/#/certs';
|
||||
Client.notify('Invalid Domain Config', 'Unable to update DNS. Click here to update it.', true, 'error', actionScope);
|
||||
}
|
||||
|
||||
Client.getBackupConfig(function (error, backupConfig) {
|
||||
if (error) return console.error(error);
|
||||
|
||||
var actionScope;
|
||||
if (backupConfig.provider === 'noop') {
|
||||
var actionScope = $scope.$new(true);
|
||||
actionScope.action = '/#/settings';
|
||||
|
||||
// warn user if dns config is not working (the 'configuring' flag detects if configureWebadmin is 'active')
|
||||
if (!$scope.status.webadminStatus.configuring && !$scope.status.webadminStatus.dns) {
|
||||
actionScope = $scope.$new(true);
|
||||
actionScope.action = '/#/certs';
|
||||
Client.notify('Invalid Domain Config', 'Unable to update DNS. Click here to update it.', true, 'error', actionScope);
|
||||
Client.notify('Backup Configuration', 'Cloudron backups are disabled. Ensure the server is backed up using alternate means.', false, 'info', actionScope);
|
||||
}
|
||||
|
||||
if (result.provider === 'caas') return;
|
||||
|
||||
Client.getBackupConfig(function (error, backupConfig) {
|
||||
Client.getMailRelay(function (error, result) {
|
||||
if (error) return console.error(error);
|
||||
|
||||
if (backupConfig.provider === 'noop') {
|
||||
var actionScope = $scope.$new(true);
|
||||
actionScope.action = '/#/settings';
|
||||
// the email status checks are currently only useful when using Cloudron itself for relaying
|
||||
if (result.provider !== 'cloudron-smtp') return;
|
||||
|
||||
Client.notify('Backup Configuration', 'Cloudron backups are disabled. Ensure the server is backed up using alternate means.', false, 'info', actionScope);
|
||||
}
|
||||
|
||||
Client.getMailRelay(function (error, result) {
|
||||
// Check if all email DNS records are set up properly only for non external DNS API
|
||||
Client.getEmailStatus(function (error, result) {
|
||||
if (error) return console.error(error);
|
||||
|
||||
// the email status checks are currently only useful when using Cloudron itself for relaying
|
||||
if (result.provider !== 'cloudron-smtp') return;
|
||||
if (!result.dns.spf.status || !result.dns.dkim.status || !result.dns.ptr.status || !result.relay.status) {
|
||||
var actionScope = $scope.$new(true);
|
||||
actionScope.action = '/#/email';
|
||||
|
||||
// Check if all email DNS records are set up properly only for non external DNS API
|
||||
Client.getEmailStatus(function (error, result) {
|
||||
if (error) return console.error(error);
|
||||
|
||||
if (!result.dns.spf.status || !result.dns.dkim.status || !result.dns.ptr.status || !result.relay.status) {
|
||||
var actionScope = $scope.$new(true);
|
||||
actionScope.action = '/#/email';
|
||||
|
||||
Client.notify('DNS Configuration', 'Please setup all required DNS records to guarantee correct mail delivery', false, 'info', actionScope);
|
||||
}
|
||||
});
|
||||
Client.notify('DNS Configuration', 'Please setup all required DNS records to guarantee correct mail delivery', false, 'info', actionScope);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -239,11 +239,12 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
|
||||
});
|
||||
}
|
||||
|
||||
// TODO this currently assumes the config.fqdn is the mail domain
|
||||
function getDnsConfig() {
|
||||
Client.getDnsConfig(function (error, dnsConfig) {
|
||||
Client.getDomain($scope.config.fqdn, function (error, result) {
|
||||
if (error) return console.error(error);
|
||||
|
||||
$scope.dnsConfig = dnsConfig;
|
||||
$scope.dnsConfig = result.config;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user