diff --git a/webadmin/src/js/setup.js b/webadmin/src/js/setup.js index d8965d034..44fda1998 100644 --- a/webadmin/src/js/setup.js +++ b/webadmin/src/js/setup.js @@ -93,7 +93,23 @@ app.controller('SetupController', ['$scope', '$http', 'Client', function ($scope $scope.apiServerOrigin = ''; $scope.setupToken = ''; $scope.createAppstoreAccount = true; + $scope.showDNSSetup = false; + $scope.dnsProvider = [ + { name: 'Manual/Wildcard', value: 'manual' }, + { name: 'No-op', value: 'noop' }, + { name: 'AWS Route53', value: 'route53' }, + { name: 'Digital Ocean', value: 'digitalocean' } + ]; + $scope.dnsCredentials = { + error: null, + busy: false, + domain: '', + accessKeyId: '', + secretAccessKey: '', + digitalOceanToken: '', + provider: 'route53' + }; $scope.activateCloudron = function () { $scope.busy = true; @@ -133,6 +149,29 @@ app.controller('SetupController', ['$scope', '$http', 'Client', function ($scope }); }; + $scope.setDNSCredentials = function () { + $scope.busy = true; + + var data = { + provider: $scope.dnsCredentials.provider, + accessKeyId: $scope.dnsCredentials.accessKeyId, + secretAccessKey: $scope.dnsCredentials.secretAccessKey, + token: $scope.dnsCredentials.digitalOceanToken + }; + + Client.setDnsConfig(data, function (error) { + $scope.busy = false; + + if (error) { + $scope.dnsCredentials.error = error.message; + return; + } + + // TODO wait until domain is propagated and cert got acquired + window.location.href = '/'; + }); + }; + Client.getStatus(function (error, status) { if (error) { window.location.href = '/error.html'; diff --git a/webadmin/src/setup.html b/webadmin/src/setup.html index c2ee3058e..ebc356cab 100644 --- a/webadmin/src/setup.html +++ b/webadmin/src/setup.html @@ -37,7 +37,7 @@ Please use the setup link for this cloudron. -
+
@@ -84,14 +84,58 @@
- - + +
- Now do DNS setup +
+
+
+

Domain Setup

+

Specify the domain for your Cloudron

+

Apps will be installed on subdomains of that domain.

+
+
+
+
+

{{ dnsCredentials.error }}

+ +
+ +
+ +
+ + +
+ + +
+ + +
+
+ + +
+ + +
+ + +
+
+
+
+
+ +
+
+