@vladmandic/piacme
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -18,6 +18,7 @@ { | ||
"max-len": [1, 200, 3], | ||
"radix": "off", | ||
"dot-notation": "off", | ||
"radix":"off", | ||
"dot-notation":"off", | ||
"no-mixed-operators":"off", | ||
"object-curly-newline":"off" | ||
} | ||
} |
{ | ||
"name": "@vladmandic/piacme", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Simple ACME/LetsEncrypt HTTP/SSL Certificate Management", | ||
@@ -5,0 +5,0 @@ "main": "dist/piacme.js", |
@@ -58,3 +58,7 @@ const fs = require('fs'); | ||
if (force || !fs.existsSync(config.fullChain)) { | ||
log.info('acme create certificate'); | ||
if (!config.domains || (config.domains.length <= 0)) { | ||
log.info('acme skip create certificate', { domains: config.domains }); | ||
return false; | ||
} | ||
log.info('acme create certificate', { domains: config.domains, encoding: 'der' }); | ||
// what are we requesting | ||
@@ -78,3 +82,3 @@ const csrDer = await CSR.csr({ jwk: config.key, domains: config.domains, encoding: 'der' }); | ||
res.end(); | ||
if (config.debug) log.info('acme challenge', { key: key.host, url: req.url, sent: key.key }); | ||
log.info('acme challenge', { key: key.host, url: req.url, sent: key.key }); | ||
} else { | ||
@@ -87,8 +91,5 @@ log.info('acme challenge', { key: key.host, url: req.url }); | ||
// sudo setcap 'cap_net_bind_service=+ep' `which node` | ||
server.listen(80, () => log.state('acme validation', { server: 'ready' })); | ||
server.listen(80, () => log.state('acme validation', { server: 'ready', webroot: './.well-known/acme-challenge' })); | ||
server.on('error', (err) => log.error('acme validation', { err: err.message || err })); | ||
// stop http server | ||
server.on('request', (req, res) => { | ||
server.on('request', (req, res) => { // stop http server once request has finished | ||
req.socket['_isIdle'] = false; | ||
@@ -132,2 +133,6 @@ res.on('finish', () => { | ||
initial = true; | ||
if (!config.domains || (config.domains.length <= 0)) { | ||
log.info('acme skip create keys', { domains: config.domains }); | ||
return; | ||
} | ||
// initialize acme | ||
@@ -134,0 +139,0 @@ const packageAgent = config.application; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
827492
24820
5