Compare commits

..

No commits in common. "5afd9396537193946c8bcb9fadc467944d892eb9" and "ceec79275d33edc089b86d3136c9e2aa1934cfdd" have entirely different histories.

3 changed files with 35 additions and 39 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("");
@ -131,7 +131,10 @@ Greenlock.create = function (gl) {
console.warn(""); console.warn("");
console.warn(" 'v01' for Let's Encrypt v1 (deprecated)"); console.warn(" 'v01' for Let's Encrypt v1 (deprecated)");
console.warn(""); console.warn("");
console.warn("This will be required in versions v2.3+"); console.warn("====================================================================");
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) {
@ -143,29 +146,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 || 'production' === gl.server) { if ('staging' === gl.server) {
if ('staging' === gl.server) { gl.server = 'https://acme-staging.api.letsencrypt.org/directory';
gl.server = 'https://acme-staging.api.letsencrypt.org/directory'; gl.version = 'v01';
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 '" + gl._deprecatedServerName + "' option is deprecated."); console.warn("Due to versioning issues the 'staging' option is deprecated. Please specify the full url and version.");
console.warn("Please specify the full url and version.");
console.warn(""); console.warn("");
console.warn("For APIs add:"); console.warn("\t--acme-url '" + gl.server + "' \\");
console.warn("\t, \"version\": \"" + gl.version + "\""); console.warn("\t--acme-version '" + gl.version + "' \\");
console.warn("\t, \"server\": \"" + gl.server + "\""); console.warn("");
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("");
@ -176,22 +179,19 @@ 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."); console.warn("Let's Encrypt v1 is deprecated. Please update to Let's Encrypt v2 (ACME draft 11)");
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(""); console.error(e);
console.error("=== Error (easy-to-fix) ==="); console.info("");
console.error(""); console.info("");
console.error("Hey, this isn't a big deal, but you need to manually add v1 support:"); console.info("If you require v01 API support (which is deprecated), you must install it:");
console.error(""); console.info("");
console.error(" npm install --save le-acme-core"); console.info("\tnpm install le-acme-core");
console.error(""); console.info("");
console.error("Just run that real quick, restart, and everything will work great."); console.info("");
console.error("");
console.error("");
process.exit(e.code || 13); process.exit(e.code || 13);
} }
} }

View File

@ -91,7 +91,6 @@ 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);
@ -111,8 +110,6 @@ 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.17", "version": "2.2.16",
"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,8 +58,7 @@
"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",