Verified Commit 4cfab8fa authored by Sebastiaan Deckers's avatar Sebastiaan Deckers 馃悜

feat: do not generate ACME keys & certificates for wildcard domains

parent cee1eefa
......@@ -64,6 +64,7 @@ module.exports = {
home: resolve(process.cwd(), process.env.COMMONSHOST_CORE_ACME_HOME),
webroot: resolve(process.cwd(), process.env.COMMONSHOST_CORE_ACME_WEBROOT),
port: process.env.COMMONSHOST_CORE_ACME_PORT,
host: process.env.COMMONSHOST_CORE_ACME_HOST
host: process.env.COMMONSHOST_CORE_ACME_HOST,
wildcards: process.env.COMMONSHOST_CORE_ACME_WILDCARDS.split(' ')
}
}
......@@ -9,6 +9,11 @@ const rimraf = require('rimraf')
async function issueCertificate (fastify, domain) {
const { configuration, mongo: { db }, pubnub } = fastify
if (configuration.acme.wildcards.some((suffix) => domain.endsWith(suffix))) {
throw new Error(`Not renewing wildcard certificate for: ${domain}`)
}
const domains = [domain]
const certificate = await db.collection('certificates').findOne({ domain })
......
......@@ -92,7 +92,7 @@ test('Deploy a site', async (t) => {
console.log(status)
},
message ({ message }) {
console.log('PubSub received:', message)
console.log('PubNub:', message)
if (message.type === 'site-deploy') {
t.deepEqual(message, expectedDeploy)
receivedMessageCount++
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment