From e8947cebbef4208117545900189f59ba580db822 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 19 Dec 2015 20:50:02 +0000 Subject: [PATCH] fix webrootPath, updated README --- lib/webroot.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/webroot.js b/lib/webroot.js index 81b4eb6..e2dba79 100644 --- a/lib/webroot.js +++ b/lib/webroot.js @@ -11,15 +11,16 @@ module.exports.create = function (defaults) { // _challenges: {} , setChallenge: function (args, key, value, cb) { - mkdirp(defaults.webrootPath, function (err) { + var challengePath = path.join(defaults.webrootPath, '.well-known', 'acme-challenge'); + mkdirp(challengePath, function (err) { if (err) { - console.error("Could not create --webroot-path '" + defaults.webrootPath + "':", err.code); + console.error("Could not create --webroot-path '" + challengePath + "':", err.code); console.error("Try checking the permissions, maybe?"); cb(err); return; } - var keyfile = path.join(defaults.webrootPath, key); + var keyfile = path.join(challengePath, key); fs.writeFile(keyfile, value, 'utf8', function (err) { if (err) { @@ -35,7 +36,7 @@ module.exports.create = function (defaults) { // handled as file read by web server // , getChallenge: function (args, key, cb) {} , removeChallenge: function (args, key, cb) { - var keyfile = path.join(defaults.webrootPath, key); + var keyfile = path.join(defaults.webrootPath, '.well-known', 'acme-challenge', key); fs.unlink(keyfile, function (err) { if (err) {