From 0b3b67e1cc6fa2d6539218eaf6b4dfac189f96f9 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 14 Oct 2016 13:39:54 -0600 Subject: [PATCH 1/2] initial commit --- .gitignore | 37 ++++++++++++++++++++++++++ LICENSE | 21 +++++++++++++++ README.md | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 36 ++++++++++++++++++++++++++ 4 files changed, 167 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5148e52 --- /dev/null +++ b/.gitignore @@ -0,0 +1,37 @@ +# Logs +logs +*.log +npm-debug.log* + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules +jspm_packages + +# Optional npm cache directory +.npm + +# Optional REPL history +.node_repl_history diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a7782bc --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Daplie, Inc + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..545cd68 --- /dev/null +++ b/README.md @@ -0,0 +1,73 @@ +[![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) you want + +A manual (interactive CLI) dns-based strategy for node-letsencrypt for setting, retrieving, +and clearing ACME DNS-01 challenges issued by the ACME server + +Prints out a subdomain record for `_acme-challenge` with `keyAuthDigest` +to be tested by the ACME server. + +You can then update your DNS manually by whichever method you use and then +press [enter] to continue the process. + +``` +_acme-challenge.example.com TXT xxxxxxxxxxxxxxxx TTL 60 +``` + +Install +------- + +```bash +npm install --save le-challenge-dns@2.x +``` + +Usage +----- + +```bash +var leChallengeDns = require('le-challenge-dns').create({ + debug: false +}); + +var LE = require('letsencrypt'); + +LE.create({ + server: LE.stagingServerUrl // Change to LE.productionServerUrl in production +, challengeType: 'dns-01' +, challenges: { + 'dns-01': leChallengeDns + } +, approveDomains: [ 'example.com' ] +}); +``` + +NOTE: If you request a certificate with 6 domains listed, +it will require 6 individual challenges. + +Exposed Methods +--------------- + +For ACME Challenge: + +* `set(opts, domain, challange, keyAuthorization, done)` +* `get(defaults, domain, challenge, done)` +* `remove(defaults, domain, challenge, done)` + +Note: `get()` is a no-op for `dns-01`. + +For node-letsencrypt internals: + +* `getOptions()` returns the internal defaults merged with the user-supplied options +* `loopback(defaults, domain, challange, done)` performs a dns lookup of the txt record +* `test(opts, domain, challange, keyAuthorization, done)` runs set, loopback, remove, loopback diff --git a/package.json b/package.json new file mode 100644 index 0000000..6d9428f --- /dev/null +++ b/package.json @@ -0,0 +1,36 @@ +{ + "name": "le-challenge-dns", + "version": "2.1.0", + "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": { + "test": "node test.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Daplie/le-challenge-dns.git" + }, + "keywords": [ + "le", + "letsencrypt", + "le-challenge", + "le-challenge-", + "le-challenge-dns", + "manual", + "interactive", + "cli", + "acme", + "challenge", + "dns", + "cluster", + "ephemeral" + ], + "author": "AJ ONeal (https://coolaj86.com/)", + "license": "(MIT OR Apache-2.0)", + "bugs": { + "url": "https://github.com/Daplie/le-challenge-dns/issues" + }, + "homepage": "https://github.com/Daplie/le-challenge-dns#readme", + "dependencies": { + } +} From 418a019b908e31da8a5bf0f0d19a4d05da83b123 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 14 Oct 2016 13:41:12 -0600 Subject: [PATCH 2/2] initial commit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 545cd68..06dcc78 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ le-challenge-dns ================ -**For production** use [`le-challenge-ddns`](https://github.com/Daplie/le-challenge-ddns) you want +**For production** use [`le-challenge-ddns`](https://github.com/Daplie/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