admin -> dashboard

This commit is contained in:
Girish Ramakrishnan
2021-05-05 12:29:04 -07:00
parent cc9b43450c
commit 44ac406e57
28 changed files with 104 additions and 104 deletions
+9 -9
View File
@@ -20,7 +20,7 @@ var async = require('async'),
var SERVER_URL = 'http://localhost:' + constants.PORT;
const ADMIN_DOMAIN = {
const DASHBOARD_DOMAIN = {
domain: 'admin.com',
zoneName: 'admin.com',
config: {},
@@ -49,7 +49,7 @@ function setup(done) {
function dnsSetup(callback) {
superagent.post(SERVER_URL + '/api/v1/cloudron/setup')
.send({ dnsConfig: { provider: ADMIN_DOMAIN.provider, domain: ADMIN_DOMAIN.domain, config: ADMIN_DOMAIN.config, tlsConfig: { provider: 'fallback' } } })
.send({ dnsConfig: { provider: DASHBOARD_DOMAIN.provider, domain: DASHBOARD_DOMAIN.domain, config: DASHBOARD_DOMAIN.config, tlsConfig: { provider: 'fallback' } } })
.end(function (error, result) {
expect(result).to.be.ok();
expect(result.statusCode).to.eql(200);
@@ -170,7 +170,7 @@ describe('Mail API', function () {
callback(null, dnsAnswerQueue[hostname][type]);
};
const suffix = crypto.createHash('sha256').update(settings.adminDomain()).digest('hex').substr(0, 6);
const suffix = crypto.createHash('sha256').update(settings.dashboardDomain()).digest('hex').substr(0, 6);
dkimDomain = `cloudron-${suffix}._domainkey.${DOMAIN_0.domain}`;
spfDomain = DOMAIN_0.domain;
mxDomain = DOMAIN_0.domain;
@@ -230,7 +230,7 @@ describe('Mail API', function () {
expect(res.body.dns.spf.domain).to.eql(spfDomain);
expect(res.body.dns.spf.type).to.eql('TXT');
expect(res.body.dns.spf.value).to.eql(null);
expect(res.body.dns.spf.expected).to.eql('v=spf1 a:' + settings.adminFqdn() + ' ~all');
expect(res.body.dns.spf.expected).to.eql('v=spf1 a:' + settings.dashboardFqdn() + ' ~all');
expect(res.body.dns.spf.status).to.eql(false);
expect(res.body.dns.dmarc).to.be.an('object');
@@ -269,7 +269,7 @@ describe('Mail API', function () {
expect(res.statusCode).to.equal(200);
expect(res.body.dns.spf).to.be.an('object');
expect(res.body.dns.spf.expected).to.eql('v=spf1 a:' + settings.adminFqdn() + ' ~all');
expect(res.body.dns.spf.expected).to.eql('v=spf1 a:' + settings.dashboardFqdn() + ' ~all');
expect(res.body.dns.spf.status).to.eql(false);
expect(res.body.dns.spf.value).to.eql(null);
@@ -311,7 +311,7 @@ describe('Mail API', function () {
expect(res.statusCode).to.equal(200);
expect(res.body.dns.spf).to.be.an('object');
expect(res.body.dns.spf.expected).to.eql('v=spf1 a:' + settings.adminFqdn() + ' a:random.com ~all');
expect(res.body.dns.spf.expected).to.eql('v=spf1 a:' + settings.dashboardFqdn() + ' a:random.com ~all');
expect(res.body.dns.spf.status).to.eql(false);
expect(res.body.dns.spf.value).to.eql('v=spf1 a:random.com ~all');
@@ -387,7 +387,7 @@ describe('Mail API', function () {
dnsAnswerQueue[mxDomain].MX = [ { priority: '10', exchange: settings.mailFqdn() } ];
dnsAnswerQueue[dmarcDomain].TXT = [['v=DMARC1; p=reject; pct=100']];
dnsAnswerQueue[dkimDomain].TXT = [['v=DKIM1; t=s; p=', mail._readDkimPublicKeySync(DOMAIN_0.domain) ]];
dnsAnswerQueue[spfDomain].TXT = [['v=spf1 a:' + settings.adminFqdn() + ' ~all']];
dnsAnswerQueue[spfDomain].TXT = [['v=spf1 a:' + settings.dashboardFqdn() + ' ~all']];
superagent.get(SERVER_URL + '/api/v1/mail/' + DOMAIN_0.domain + '/status')
.query({ access_token: token })
@@ -404,8 +404,8 @@ describe('Mail API', function () {
expect(res.body.dns.spf).to.be.an('object');
expect(res.body.dns.spf.domain).to.eql(spfDomain);
expect(res.body.dns.spf.type).to.eql('TXT');
expect(res.body.dns.spf.value).to.eql('v=spf1 a:' + settings.adminFqdn() + ' ~all');
expect(res.body.dns.spf.expected).to.eql('v=spf1 a:' + settings.adminFqdn() + ' ~all');
expect(res.body.dns.spf.value).to.eql('v=spf1 a:' + settings.dashboardFqdn() + ' ~all');
expect(res.body.dns.spf.expected).to.eql('v=spf1 a:' + settings.dashboardFqdn() + ' ~all');
expect(res.body.dns.spf.status).to.eql(true);
expect(res.body.dns.dmarc).to.be.an('object');