restore latest from npm

This commit is contained in:
AJ ONeal 2018-05-01 14:14:15 -06:00
parent 2f10eab1c5
commit 8ed6e3cdcc
3 changed files with 53 additions and 15 deletions

View File

@ -1,16 +1,14 @@
[![Join the chat at https://gitter.im/Daplie/letsencrypt-express](https://badges.gitter.im/Daplie/letsencrypt-express.svg)](https://gitter.im/Daplie/letsencrypt-express?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
| [letsencrypt](https://github.com/Daplie/node-letsencrypt) (library)
| [letsencrypt-cli](https://github.com/Daplie/letsencrypt-cli)
| [letsencrypt-express](https://github.com/Daplie/letsencrypt-express)
| [letsencrypt-koa](https://github.com/Daplie/letsencrypt-koa)
| [letsencrypt-hapi](https://github.com/Daplie/letsencrypt-hapi)
|
le-challenge-dns
================
**For production** use [`le-challenge-ddns`](https://github.com/Daplie/le-challenge-ddns) (or a similar ddns tool)
| Sponsored by [ppl](https://ppl.family)
| [greenlock.js](https://git.coolaj86.com/coolaj86/greenlock.js) (library)
| [greenlock-express.js](https://git.coolaj86.com/coolaj86/greenlock-express.js)
| [greenlock-cli.js](https://git.coolaj86.com/coolaj86/greenlock-cli.js)
| [acme-v2.js](https://git.coolaj86.com/coolaj86/acme-v2.js)
|
**For production** use [`le-challenge-ddns`](https://git.coolaj86.com/coolaj86/le-challenge-ddns) (or a similar ddns tool)
A manual (interactive CLI) dns-based strategy for node-letsencrypt for setting, retrieving,
and clearing ACME DNS-01 challenges issued by the ACME server

View File

@ -5,7 +5,7 @@ var dns = PromiseA.promisifyAll(require('dns'));
var Challenge = module.exports;
Challenge.create = function (defaults) {
return {
return {
getOptions: function () {
return defaults || {};
}
@ -74,3 +74,41 @@ Challenge.loopback = function (defaults, domain, challenge, done) {
console.log("dig TXT +noall +answer @8.8.8.8 '" + challengeDomain + "' # " + challenge);
dns.resolveTxtAsync(challengeDomain).then(function (x) { done(null, x); }, done);
};
Challenge.test = function (args, domain, challenge, keyAuthorization, done) {
var me = this;
args.test = args.test || '_test.';
defaults.test = args.test;
me.set(args, domain, challenge, keyAuthorization || challenge, function (err, k) {
if (err) { done(err); return; }
me.loopback(defaults, domain, challenge, function (err, arr) {
if (err) { done(err); return; }
if (!arr.some(function (a) {
return a.some(function (keyAuthDigest) {
return keyAuthDigest === k;
});
})) {
err = new Error("txt record '" + challenge + "' doesn't match '" + k + "'");
}
me.remove(defaults, domain, challenge, function (_err) {
if (_err) { done(_err); return; }
// TODO needs to use native-dns so that specific nameservers can be used
// (otherwise the cache will still have the old answer)
done(err || null);
/*
me.loopback(defaults, domain, challenge, function (err) {
if (err) { done(err); return; }
done();
});
*/
});
});
});
}

View File

@ -1,6 +1,6 @@
{
"name": "le-challenge-dns",
"version": "2.1.0",
"version": "2.2.1",
"description": "A manual (interactive CLI) dns-based strategy for node-letsencrypt for setting, retrieving, and clearing ACME DNS-01 challenges issued by the ACME server",
"main": "index.js",
"scripts": {
@ -8,7 +8,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/Daplie/le-challenge-dns.git"
"url": "git+https://git.coolaj86.com/coolaj86/le-challenge-dns.js.git"
},
"keywords": [
"le",
@ -20,6 +20,8 @@
"interactive",
"cli",
"acme",
"Let's Encrypt v2",
"LetsEncrypt",
"challenge",
"dns",
"cluster",
@ -28,9 +30,9 @@
"author": "AJ ONeal <coolaj86@gmail.com> (https://coolaj86.com/)",
"license": "(MIT OR Apache-2.0)",
"bugs": {
"url": "https://github.com/Daplie/le-challenge-dns/issues"
"url": "https://git.coolaj86.com/coolaj86/le-challenge-dns.js/issues"
},
"homepage": "https://github.com/Daplie/le-challenge-dns#readme",
"homepage": "https://git.coolaj86.com/coolaj86/le-challenge-dns.js",
"dependencies": {
}
}