Compare commits
7 Commits
ceec79275d
...
0e58683c7d
Author | SHA1 | Date |
---|---|---|
AJ ONeal | 0e58683c7d | |
AJ ONeal | c8b4c88a5c | |
AJ ONeal | 5afd939653 | |
AJ ONeal | 13064ee177 | |
AJ ONeal | ff674ef07b | |
AJ ONeal | 47b02e22a0 | |
Michael Stegeman | 1c861f923f |
53
index.js
53
index.js
|
@ -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 || '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';
|
||||||
console.warn("");
|
gl._deprecatedServerName = 'staging';
|
||||||
console.warn("");
|
|
||||||
console.warn("=== WARNING ===");
|
|
||||||
console.warn("");
|
|
||||||
console.warn("Due to versioning issues the 'staging' option is deprecated. Please specify the full url and version.");
|
|
||||||
console.warn("");
|
|
||||||
console.warn("\t--acme-url '" + gl.server + "' \\");
|
|
||||||
console.warn("\t--acme-version '" + gl.version + "' \\");
|
|
||||||
console.warn("");
|
|
||||||
console.warn("");
|
|
||||||
}
|
}
|
||||||
else if ('production' === gl.server) {
|
else if ('production' === gl.server) {
|
||||||
gl.server = 'https://acme-v01.api.letsencrypt.org/directory';
|
gl.server = 'https://acme-v01.api.letsencrypt.org/directory';
|
||||||
gl.version = 'v01';
|
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 'production' 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("For APIs add:");
|
||||||
|
console.warn("\t, \"version\": \"" + gl.version + "\"");
|
||||||
|
console.warn("\t, \"server\": \"" + gl.server + "\"");
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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?
|
||||||
|
|
|
@ -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",
|
||||||
|
|
Loading…
Reference in New Issue