Compare commits

...

7 Commits

Author SHA1 Message Date
AJ ONeal 0e58683c7d v2.2.18 2018-05-21 13:58:27 -06:00
AJ ONeal c8b4c88a5c instruct to install le-acme-core 2018-05-21 13:57:58 -06:00
AJ ONeal 5afd939653 v2.2.17 2018-05-21 13:50:55 -06:00
AJ ONeal 13064ee177 Merge branch 'master' of ssh://git.coolaj86.com:22042/coolaj86/greenlock.js into v2.2 2018-05-21 13:47:59 -06:00
AJ ONeal ff674ef07b adjust error messages 2018-05-21 13:47:54 -06:00
AJ ONeal 47b02e22a0 Merge branch 'new-reg-url' of mrstegeman/greenlock.js into master 2018-05-21 17:17:00 +00:00
Michael Stegeman 1c861f923f
Pass new-reg and authz URLs to storage backend. 2018-05-21 07:33:41 -06:00
3 changed files with 40 additions and 35 deletions

View File

@ -118,9 +118,9 @@ Greenlock.create = function (gl) {
console.warn(""); console.warn("");
console.warn(""); console.warn("");
console.warn(""); console.warn("");
console.warn("===================================================================="); console.warn("==========================================================");
console.warn("== greenlock.js (v2.2.0+) =="); console.warn("== greenlock.js (v2.2.0+) ==");
console.warn("===================================================================="); console.warn("==========================================================");
console.warn(""); console.warn("");
console.warn("Please specify 'version' option:"); console.warn("Please specify 'version' option:");
console.warn(""); console.warn("");
@ -130,11 +130,9 @@ Greenlock.create = function (gl) {
console.warn("or"); console.warn("or");
console.warn(""); console.warn("");
console.warn(" 'v01' for Let's Encrypt v1 (deprecated)"); console.warn(" 'v01' for Let's Encrypt v1 (deprecated)");
console.warn(" (also 'npm install --save le-acme-core' as this legacy dependency will soon be removed)");
console.warn(""); console.warn("");
console.warn("===================================================================="); console.warn("This will be required in versions v2.3+");
console.warn("== this will be required from version v2.3 forward ==");
console.warn("====================================================================");
console.warn("");
console.warn(""); console.warn("");
console.warn(""); console.warn("");
} else if ('v02' === gl.version) { } else if ('v02' === gl.version) {
@ -146,29 +144,29 @@ Greenlock.create = function (gl) {
if (!gl.server) { if (!gl.server) {
throw new Error("opts.server must specify an ACME directory URL, such as 'https://acme-staging-v02.api.letsencrypt.org/directory'"); throw new Error("opts.server must specify an ACME directory URL, such as 'https://acme-staging-v02.api.letsencrypt.org/directory'");
} }
if ('staging' === gl.server) { if ('staging' === gl.server || 'production' === gl.server) {
gl.server = 'https://acme-staging.api.letsencrypt.org/directory'; if ('staging' === gl.server) {
gl.version = 'v01'; gl.server = 'https://acme-staging.api.letsencrypt.org/directory';
gl.version = 'v01';
gl._deprecatedServerName = 'staging';
}
else if ('production' === gl.server) {
gl.server = 'https://acme-v01.api.letsencrypt.org/directory';
gl.version = 'v01';
gl._deprecatedServerName = 'production';
}
console.warn(""); console.warn("");
console.warn(""); console.warn("");
console.warn("=== WARNING ==="); console.warn("=== WARNING ===");
console.warn(""); console.warn("");
console.warn("Due to versioning issues the 'staging' option is deprecated. Please specify the full url and version."); console.warn("Due to versioning issues the '" + gl._deprecatedServerName + "' option is deprecated.");
console.warn("Please specify the full url and version.");
console.warn(""); console.warn("");
console.warn("\t--acme-url '" + gl.server + "' \\"); console.warn("For APIs add:");
console.warn("\t--acme-version '" + gl.version + "' \\"); console.warn("\t, \"version\": \"" + gl.version + "\"");
console.warn(""); console.warn("\t, \"server\": \"" + gl.server + "\"");
console.warn("");
}
else if ('production' === gl.server) {
gl.server = 'https://acme-v01.api.letsencrypt.org/directory';
gl.version = 'v01';
console.warn("");
console.warn("");
console.warn("=== WARNING ===");
console.warn("");
console.warn("Due to versioning issues the 'production' option is deprecated. Please specify the full url and version.");
console.warn(""); console.warn("");
console.warn("For the CLI add:");
console.warn("\t--acme-url '" + gl.server + "' \\"); console.warn("\t--acme-url '" + gl.server + "' \\");
console.warn("\t--acme-version '" + gl.version + "' \\"); console.warn("\t--acme-version '" + gl.version + "' \\");
console.warn(""); console.warn("");
@ -179,19 +177,22 @@ Greenlock.create = function (gl) {
console.warn(""); console.warn("");
console.warn("=== WARNING ==="); console.warn("=== WARNING ===");
console.warn(""); console.warn("");
console.warn("Let's Encrypt v1 is deprecated. Please update to Let's Encrypt v2 (ACME draft 11)"); console.warn("Let's Encrypt v1 is deprecated.");
console.warn("Please update to Let's Encrypt v2 (ACME draft 11)");
console.warn(""); console.warn("");
try { try {
return require('le-acme-core').ACME; return require('le-acme-core').ACME;
} catch(e) { } catch(e) {
console.error(e); console.error("");
console.info(""); console.error("=== Error (easy-to-fix) ===");
console.info(""); console.error("");
console.info("If you require v01 API support (which is deprecated), you must install it:"); console.error("Hey, this isn't a big deal, but you need to manually add v1 support:");
console.info(""); console.error("");
console.info("\tnpm install le-acme-core"); console.error(" npm install --save le-acme-core");
console.info(""); console.error("");
console.info(""); console.error("Just run that real quick, restart, and everything will work great.");
console.error("");
console.error("");
process.exit(e.code || 13); process.exit(e.code || 13);
} }
} }

View File

@ -91,6 +91,7 @@ module.exports.create = function (gl) {
return gl.acme.registerNewAccountAsync({ return gl.acme.registerNewAccountAsync({
email: args.email email: args.email
, newRegUrl: args._acmeUrls.newReg , newRegUrl: args._acmeUrls.newReg
, newAuthzUrl: args._acmeUrls.newAuthz
, agreeToTerms: function (tosUrl, agreeCb) { , agreeToTerms: function (tosUrl, agreeCb) {
if (true === args.agreeTos || tosUrl === args.agreeTos || tosUrl === gl.agreeToTerms) { if (true === args.agreeTos || tosUrl === args.agreeTos || tosUrl === gl.agreeToTerms) {
agreeCb(null, tosUrl); agreeCb(null, tosUrl);
@ -110,6 +111,8 @@ module.exports.create = function (gl) {
keypair: keypair keypair: keypair
, receipt: receipt , receipt: receipt
, email: args.email , email: args.email
, newRegUrl: args._acmeUrls.newReg
, newAuthzUrl: args._acmeUrls.newAuthz
}; };
// TODO move templating of arguments to right here? // TODO move templating of arguments to right here?

View File

@ -1,6 +1,6 @@
{ {
"name": "greenlock", "name": "greenlock",
"version": "2.2.16", "version": "2.2.18",
"description": "Let's Encrypt for node.js on npm", "description": "Let's Encrypt for node.js on npm",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
@ -58,7 +58,8 @@
"request": "^2.75.0" "request": "^2.75.0"
}, },
"optionalDependencies": { "optionalDependencies": {
"bluebird": "^3.5.1" "bluebird": "^3.5.1",
"le-acme-core": "^2.1.3"
}, },
"dependencies": { "dependencies": {
"acme-v2": "^1.0.6", "acme-v2": "^1.0.6",