dns: add ovh backend

This commit is contained in:
Girish Ramakrishnan
2023-11-05 18:38:30 +01:00
parent 8e468788a9
commit b88afbac4e
14 changed files with 349 additions and 11 deletions
+23 -1
View File
@@ -2,7 +2,7 @@
/* global async */
/* global angular */
/* global $, TASK_TYPES */
/* global $, TASK_TYPES, ENDPOINTS_OVH */
angular.module('Application').controller('DomainsController', ['$scope', '$location', 'Client', function ($scope, $location, Client) {
Client.onReady(function () { if (!Client.getUserInfo().isAtLeastAdmin) $location.path('/'); });
@@ -56,6 +56,7 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
{ name: 'Name.com', value: 'namecom' },
{ name: 'Namecheap', value: 'namecheap' },
{ name: 'Netcup', value: 'netcup' },
{ name: 'OVH', value: 'ovh' },
{ name: 'Porkbun', value: 'porkbun' },
{ name: 'Vultr', value: 'vultr' },
{ name: 'Wildcard', value: 'wildcard' },
@@ -76,6 +77,7 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
case 'namecom': return 'Name.com';
case 'namecheap': return 'Namecheap';
case 'netcup': return 'Netcup';
case 'ovh': return 'OVH';
case 'gcdns': return 'Google Cloud';
case 'godaddy': return 'GoDaddy';
case 'vultr': return 'Vultr';
@@ -87,6 +89,8 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
}
};
$scope.ovhEndpoints = ENDPOINTS_OVH;
$scope.needsPort80 = function (dnsProvider, tlsProvider) {
return ((dnsProvider === 'manual' || dnsProvider === 'noop' || dnsProvider === 'wildcard') &&
(tlsProvider === 'letsencrypt-prod' || tlsProvider === 'letsencrypt-staging'));
@@ -261,6 +265,10 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
netcupCustomerNumber: '',
netcupApiKey: '',
netcupApiPassword: '',
ovhEndpoint: 'ovh-eu',
ovhConsumerKey: '',
ovhAppKey: '',
ovhAppSecret: '',
porkbunSecretapikey: '',
porkbunApikey: '',
@@ -332,6 +340,11 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
$scope.domainConfigure.netcupApiKey = domain.provider === 'netcup' ? domain.config.apiKey : '';
$scope.domainConfigure.netcupApiPassword = domain.provider === 'netcup' ? domain.config.apiPassword : '';
$scope.domainConfigure.ovhEndpoint = domain.provider === 'ovh' ? domain.config.endpoint : '';
$scope.domainConfigure.ovhConsumerKey = domain.provider === 'ovh' ? domain.config.consumerKey : '';
$scope.domainConfigure.ovhAppKey = domain.provider === 'ovh' ? domain.config.appKey : '';
$scope.domainConfigure.ovhAppSecret = domain.provider === 'ovh' ? domain.config.appSecret : '';
$scope.domainConfigure.porkbunApikey = domain.provider === 'porkbun' ? domain.config.apikey : '';
$scope.domainConfigure.porkbunSecretapikey = domain.provider === 'porkbun' ? domain.config.secretapikey : '';
@@ -409,6 +422,11 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
data.customerNumber = $scope.domainConfigure.netcupCustomerNumber;
data.apiKey = $scope.domainConfigure.netcupApiKey;
data.apiPassword = $scope.domainConfigure.netcupApiPassword;
} else if (provider === 'ovh') {
data.endpoint = $scope.domainConfigure.ovhEndpoint;
data.consumerKey = $scope.domainConfigure.ovhConsumerKey;
data.appKey = $scope.domainConfigure.ovhAppKey;
data.appSecret = $scope.domainConfigure.ovhAppSecret;
} else if (provider === 'porkbun') {
data.apikey = $scope.domainConfigure.porkbunApikey;
data.secretapikey = $scope.domainConfigure.porkbunSecretapikey;
@@ -478,6 +496,10 @@ angular.module('Application').controller('DomainsController', ['$scope', '$locat
$scope.domainConfigure.netcupCustomerNumber = '';
$scope.domainConfigure.netcupApiKey = '';
$scope.domainConfigure.netcupApiPassword = '';
$scope.domainConfigure.ovhEndpoint = '';
$scope.domainConfigure.ovhConsumerKey = '';
$scope.domainConfigure.ovhAppKey = '';
$scope.domainConfigure.ovhAppSecret = '';
$scope.domainConfigure.porkbunApikey = '';
$scope.domainConfigure.porkbunSecretapikey = '';
$scope.domainConfigure.vultrToken = '';