store fallback certs in the database
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
var appdb = require('../appdb.js'),
|
||||
const appdb = require('../appdb.js'),
|
||||
apps = require('../apps.js'),
|
||||
async = require('async'),
|
||||
backupdb = require('../backupdb.js'),
|
||||
@@ -21,6 +21,7 @@ var appdb = require('../appdb.js'),
|
||||
mailboxdb = require('../mailboxdb.js'),
|
||||
maildb = require('../maildb.js'),
|
||||
notificationdb = require('../notificationdb.js'),
|
||||
reverseProxy = require('../reverseproxy.js'),
|
||||
settingsdb = require('../settingsdb.js'),
|
||||
taskdb = require('../taskdb.js'),
|
||||
tokendb = require('../tokendb.js'),
|
||||
@@ -92,6 +93,7 @@ const DOMAIN_0 = {
|
||||
tlsConfig: { provider: 'fallback' },
|
||||
wellKnown: null
|
||||
};
|
||||
DOMAIN_0.fallbackCertificate = reverseProxy.generateFallbackCertificateSync(DOMAIN_0.domain);
|
||||
|
||||
const DOMAIN_1 = {
|
||||
domain: 'foo.cloudron.io',
|
||||
@@ -101,6 +103,7 @@ const DOMAIN_1 = {
|
||||
tlsConfig: { provider: 'fallback' },
|
||||
wellKnown: null
|
||||
};
|
||||
DOMAIN_1.fallbackCertificate = reverseProxy.generateFallbackCertificateSync(DOMAIN_1.domain);
|
||||
|
||||
describe('database', function () {
|
||||
before(function (done) {
|
||||
@@ -311,15 +314,15 @@ describe('database', function () {
|
||||
});
|
||||
|
||||
it('can add domain', function (done) {
|
||||
domaindb.add(DOMAIN_0.domain, { zoneName: DOMAIN_0.zoneName, provider: DOMAIN_0.provider, config: DOMAIN_0.config, tlsConfig: DOMAIN_0.tlsConfig }, done);
|
||||
domaindb.add(DOMAIN_0.domain, DOMAIN_0, done);
|
||||
});
|
||||
|
||||
it('can add another domain', function (done) {
|
||||
domaindb.add(DOMAIN_1.domain, { zoneName: DOMAIN_1.zoneName, provider: DOMAIN_1.provider, config: DOMAIN_1.config, tlsConfig: DOMAIN_1.tlsConfig }, done);
|
||||
domaindb.add(DOMAIN_1.domain, DOMAIN_1, done);
|
||||
});
|
||||
|
||||
it('cannot add same domain twice', function (done) {
|
||||
domaindb.add(DOMAIN_0.domain, { zoneName: DOMAIN_0.zoneName, provider: DOMAIN_0.provider, config: DOMAIN_0.config, tlsConfig: DOMAIN_0.tlsConfig }, function (error) {
|
||||
domaindb.add(DOMAIN_0.domain, DOMAIN_0, function (error) {
|
||||
expect(error).to.be.ok();
|
||||
expect(error.reason).to.be(BoxError.ALREADY_EXISTS);
|
||||
done();
|
||||
@@ -952,7 +955,7 @@ describe('database', function () {
|
||||
before(function (done) {
|
||||
async.series([
|
||||
userdb.add.bind(null, USER_0.id, USER_0),
|
||||
domaindb.add.bind(null, DOMAIN_0.domain, { zoneName: DOMAIN_0.zoneName, provider: DOMAIN_0.provider, config: DOMAIN_0.config, tlsConfig: DOMAIN_0.tlsConfig })
|
||||
domaindb.add.bind(null, DOMAIN_0.domain, DOMAIN_0)
|
||||
], done);
|
||||
});
|
||||
|
||||
@@ -1840,7 +1843,7 @@ describe('database', function () {
|
||||
describe('mailboxes', function () {
|
||||
before(function (done) {
|
||||
async.series([
|
||||
domaindb.add.bind(null, DOMAIN_0.domain, { zoneName: DOMAIN_0.zoneName, provider: DOMAIN_0.provider, config: DOMAIN_0.config, tlsConfig: DOMAIN_0.tlsConfig }),
|
||||
domaindb.add.bind(null, DOMAIN_0.domain, DOMAIN_0),
|
||||
], done);
|
||||
});
|
||||
|
||||
@@ -2013,7 +2016,7 @@ describe('database', function () {
|
||||
};
|
||||
|
||||
before(function (done) {
|
||||
domaindb.add(DOMAIN_0.domain, { zoneName: DOMAIN_0.zoneName, provider: DOMAIN_0.provider, config: DOMAIN_0.config, tlsConfig: DOMAIN_0.tlsConfig }, done);
|
||||
domaindb.add(DOMAIN_0.domain, DOMAIN_0, done);
|
||||
});
|
||||
|
||||
after(function (done) {
|
||||
|
||||
Reference in New Issue
Block a user