v3.0.2: improve user message

This commit is contained in:
AJ ONeal 2019-04-04 10:35:06 -06:00
parent 1b8495cdd2
commit b9015b8952
2 changed files with 8 additions and 7 deletions

View File

@ -3,6 +3,7 @@
var Challenge = module.exports; var Challenge = module.exports;
Challenge.create = function (defaults) { Challenge.create = function (defaults) {
// if you need special options that apply to all domains, you could set them here.
return { return {
options: defaults options: defaults
, set: Challenge.set , set: Challenge.set
@ -13,6 +14,7 @@ Challenge.create = function (defaults) {
// Show the user the token and key and wait for them to be ready to continue // Show the user the token and key and wait for them to be ready to continue
Challenge.set = function (args, cb) { Challenge.set = function (args, cb) {
// if you need per-run / per-domain options set them in approveDomains() and they'll be on 'args' here.
if (!args.challenge) { if (!args.challenge) {
console.error("please update to greenlock v2.7+"); console.error("please update to greenlock v2.7+");
process.exit(); process.exit();
@ -26,9 +28,8 @@ Challenge.set = function (args, cb) {
}); });
} else { } else {
console.info(""); console.info("");
console.info("Challenge for '" + opts.altname + "'"); console.info("We now present (for your copy-and-paste pleasure)...");
console.info(""); console.info("DNS-01 ACME (Let's Encrypt) Challenge for '" + opts.altname + "'");
console.info("We now present (for you copy-and-paste pleasure) your ACME Challenge");
console.info(""); console.info("");
console.info(opts.dnsHost + "\tTXT " + opts.dnsAuthorization + "\tTTL 60"); console.info(opts.dnsHost + "\tTXT " + opts.dnsAuthorization + "\tTTL 60");
console.info(""); console.info("");
@ -44,7 +45,7 @@ Challenge.set = function (args, cb) {
, expires: opts.expires , expires: opts.expires
}, null, ' ').replace(/^/gm, '\t')); }, null, ' ').replace(/^/gm, '\t'));
console.info(""); console.info("");
console.info("hit enter to continue..."); console.info("Insert quarter, er... I mean hit the any key to continue...");
process.stdin.resume(); process.stdin.resume();
process.stdin.on('data', function () { process.stdin.on('data', function () {
process.stdin.pause(); process.stdin.pause();
@ -53,7 +54,7 @@ Challenge.set = function (args, cb) {
} }
}; };
// nothing to do here, that's why it's manual // nothing to do here (that's the dns server's job), that's why it's manual
Challenge.get = function (defaults, cb) { Challenge.get = function (defaults, cb) {
// defaults.challenge // defaults.challenge
cb(null); cb(null);
@ -61,7 +62,7 @@ Challenge.get = function (defaults, cb) {
// might as well tell the user that whatever they were setting up has been checked // might as well tell the user that whatever they were setting up has been checked
Challenge.remove = function (args, cb) { Challenge.remove = function (args, cb) {
console.info("Challenge complete. You may remove the DNS-01 challenge record:"); console.info("Success. You may now remove the DNS-01 challenge record:");
console.info("\t" + args.challenge.altname + "\tTXT\t" + args.challenge.dnsAuthorization); console.info("\t" + args.challenge.altname + "\tTXT\t" + args.challenge.dnsAuthorization);
cb(null); cb(null);
}; };

View File

@ -1,6 +1,6 @@
{ {
"name": "le-challenge-dns", "name": "le-challenge-dns",
"version": "3.0.1", "version": "3.0.2",
"description": "A manual (interactive CLI) dns-based strategy for Greenlock / Let's Encrypt / ACME DNS-01 challenges", "description": "A manual (interactive CLI) dns-based strategy for Greenlock / Let's Encrypt / ACME DNS-01 challenges",
"main": "index.js", "main": "index.js",
"files": [], "files": [],