Compare commits
	
		
			No commits in common. "master" and "v3.0.7" have entirely different histories.
		
	
	
		
	
		
| @ -1,8 +0,0 @@ | |||||||
| { |  | ||||||
|   "bracketSpacing": true, |  | ||||||
|   "printWidth": 80, |  | ||||||
|   "singleQuote": true, |  | ||||||
|   "tabWidth": 2, |  | ||||||
|   "trailingComma": "none", |  | ||||||
|   "useTabs": false |  | ||||||
| } |  | ||||||
							
								
								
									
										74
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										74
									
								
								README.md
									
									
									
									
									
								
							| @ -11,15 +11,15 @@ and [ACME.js](https://git.rootprojects.org/root/acme-v2.js). | |||||||
| _acme-challenge.example.com   TXT   xxxxxxxxxxxxxxxx    TTL 60 | _acme-challenge.example.com   TXT   xxxxxxxxxxxxxxxx    TTL 60 | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| - Prints the ACME challenge DNS Host and DNS Key Authorization Digest to the terminal | * Prints the ACME challenge DNS Host and DNS Key Authorization Digest to the terminal | ||||||
|   - (waits for you to hit enter before continuing) |   * (waits for you to hit enter before continuing) | ||||||
| - Let's you know when the challenge as succeeded or failed, and is safe to remove. | * Let's you know when the challenge as succeeded or failed, and is safe to remove. | ||||||
| 
 | 
 | ||||||
| Other ACME Challenge Reference Implementations: | Other ACME Challenge Reference Implementations: | ||||||
| 
 | 
 | ||||||
| - [acme-http-01-cli](https://git.rootprojects.org/root/acme-http-01-cli.js.git) | * [acme-http-01-cli](https://git.rootprojects.org/root/acme-http-01-cli.js.git) | ||||||
| - [acme-http-01-fs](https://git.rootprojects.org/root/acme-http-01-webroot.js.git) | * [acme-http-01-fs](https://git.rootprojects.org/root/acme-http-01-webroot.js.git) | ||||||
| - [**acme-dns-01-cli**](https://git.rootprojects.org/root/acme-dns-01-cli.js.git) | * [**acme-dns-01-cli**](https://git.rootprojects.org/root/acme-dns-01-cli.js.git) | ||||||
| 
 | 
 | ||||||
| ## Install | ## Install | ||||||
| 
 | 
 | ||||||
| @ -31,16 +31,16 @@ If you have `greenlock@v2.6` or lower, you'll need the old `le-challenge-dns@2.x | |||||||
| 
 | 
 | ||||||
| ## Usage | ## Usage | ||||||
| 
 | 
 | ||||||
| ```js | ```bash | ||||||
| var Greenlock = require('greenlock'); | var Greenlock = require('greenlock'); | ||||||
| 
 | 
 | ||||||
| Greenlock.create({ | Greenlock.create({ | ||||||
|   challenges: { |   ... | ||||||
|     'http-01': require('acme-http-01-fs'), | , challenges: { 'http-01': require('acme-http-01-fs') | ||||||
|     'dns-01': require('acme-dns-01-cli').create({ debug: true }), |               , 'dns-01': require('acme-dns-01-cli').create({ debug: true }) | ||||||
|     'tls-alpn-01': require('acme-tls-alpn-01-cli') |               , 'tls-alpn-01': require('acme-tls-alpn-01-cli') | ||||||
|   } |               } | ||||||
|   // ... |   ... | ||||||
| }); | }); | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| @ -49,9 +49,11 @@ overwriting the default with the one that you want in `approveDomains()`: | |||||||
| 
 | 
 | ||||||
| ```js | ```js | ||||||
| function approveDomains(opts) { | function approveDomains(opts) { | ||||||
|   // ... |   ... | ||||||
|  | 
 | ||||||
|   if (!opts.challenges) { opts.challenges = {}; } |   if (!opts.challenges) { opts.challenges = {}; } | ||||||
|   opts.challenges['dns-01'] = acmeDns01Cli; |   opts.challenges['dns-01'] = acmeDns01Cli; | ||||||
|  |   opts.challenges['http-01'] = ... | ||||||
| 
 | 
 | ||||||
|   return Promise.resolve({ ... }); |   return Promise.resolve({ ... }); | ||||||
| } | } | ||||||
| @ -64,37 +66,36 @@ it will require 6 individual challenges. | |||||||
| 
 | 
 | ||||||
| For ACME Challenge: | For ACME Challenge: | ||||||
| 
 | 
 | ||||||
| - `set(opts)` | * `set(opts)` | ||||||
| - `remove(opts)` | * `remove(opts)` | ||||||
| 
 | 
 | ||||||
| The `dns-01` strategy supports wildcards (whereas `http-01` does not). | The `dns-01` strategy supports wildcards (whereas `http-01` does not). | ||||||
| 
 | 
 | ||||||
| The options object has whatever options were set in `approveDomains()` | The options object has whatever options were set in `approveDomains()` | ||||||
| as well as the `challenge`, which looks like this: | as well as the `challenge`, which looks like this: | ||||||
| 
 | 
 | ||||||
| ```json | ```js | ||||||
| { | { challenge: { | ||||||
|   "challenge": { |     identifier: { type: 'dns', value: 'example.com' | ||||||
|     "identifier": { "type": "dns", "value": "example.com" }, |   , wildcard: true | ||||||
|     "wildcard": true, |   , altname: '*.example.com' | ||||||
|     "altname": "*.example.com", |   , type: 'dns-01' | ||||||
|     "type": "dns-01", |   , token: 'xxxxxx' | ||||||
|     "token": "xxxxxx", |   , keyAuthorization: 'xxxxxx.abc123' | ||||||
|     "keyAuthorization": "xxxxxx.abc123", |   , dnsHost: '_acme-challenge.example.com' | ||||||
|     "dnsHost": "_acme-challenge.example.com", |   , dnsAuthorization: 'xyz567' | ||||||
|     "dnsAuthorization": "xyz567", |   , expires: '1970-01-01T00:00:00Z' | ||||||
|     "expires": "1970-01-01T00:00:00Z" |  | ||||||
|   } |   } | ||||||
| } | } | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| For greenlock.js internals: | For greenlock.js internals: | ||||||
| 
 | 
 | ||||||
| - `options` stores the internal defaults merged with the user-supplied options | * `options` stores the internal defaults merged with the user-supplied options | ||||||
| 
 | 
 | ||||||
| Optional: | Optional: | ||||||
| 
 | 
 | ||||||
| - `get(limitedOpts)` | * `get(limitedOpts)` | ||||||
| 
 | 
 | ||||||
| Note: Typically there wouldn't be a `get()` for DNS because the NameServer (not Greenlock) answers the requests. | Note: Typically there wouldn't be a `get()` for DNS because the NameServer (not Greenlock) answers the requests. | ||||||
| It could be used for testing implementations, but that's about it. | It could be used for testing implementations, but that's about it. | ||||||
| @ -103,13 +104,12 @@ It could be used for testing implementations, but that's about it. | |||||||
| If there were an implementation of Greenlock integrated directly into | If there were an implementation of Greenlock integrated directly into | ||||||
| a NameServer (which currently there is not), it would probably look like this: | a NameServer (which currently there is not), it would probably look like this: | ||||||
| 
 | 
 | ||||||
| ```json | ```js | ||||||
| { | { challenge: { | ||||||
|   "challenge": { |     type: 'dns-01' | ||||||
|     "type": "dns-01", |   , identifier: { type: 'dns', value: 'example.com' } | ||||||
|     "identifier": { "type": "dns", "value": "example.com" }, |   , token: 'abc123' | ||||||
|     "token": "abc123", |   , dnsHost: '_acme-challenge.example.com' | ||||||
|     "dnsHost": "_acme-challenge.example.com" |  | ||||||
|   } |   } | ||||||
| } | } | ||||||
| ``` | ``` | ||||||
|  | |||||||
							
								
								
									
										184
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										184
									
								
								index.js
									
									
									
									
									
								
							| @ -1,9 +1,11 @@ | |||||||
| 'use strict'; | 'use strict'; | ||||||
| /*global Promise*/ | /*global Promise*/ | ||||||
|  | 
 | ||||||
| var Challenge = module.exports; | var Challenge = module.exports; | ||||||
| 
 | 
 | ||||||
| // If your implementation needs config options, set them. Otherwise, don't bother (duh).
 | // If your implementation needs config options, set them. Otherwise, don't bother (duh).
 | ||||||
| Challenge.create = function(config) { | Challenge.create = function (config) { | ||||||
|  | 
 | ||||||
|   var challenger = {}; |   var challenger = {}; | ||||||
| 
 | 
 | ||||||
|   // Note: normally you'd these right in the method body, but for the sake of
 |   // Note: normally you'd these right in the method body, but for the sake of
 | ||||||
| @ -12,24 +14,19 @@ Challenge.create = function(config) { | |||||||
|   // Note: All of these methods can be synchronous, async, Promise, and callback-style
 |   // Note: All of these methods can be synchronous, async, Promise, and callback-style
 | ||||||
|   // (the calling functions check function.length and then Promisify accordingly)
 |   // (the calling functions check function.length and then Promisify accordingly)
 | ||||||
| 
 | 
 | ||||||
|   // Fetches an array of zone name strings
 |   // Called when it's tiem to set the challenge
 | ||||||
|   challenger.zones = function(opts, cb) { |   challenger.set = function (opts, cb) { | ||||||
|     return Challenge._getZones(opts, cb); |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   // Called when it's time to set the challenge
 |  | ||||||
|   challenger.set = function(opts, cb) { |  | ||||||
|     return Challenge._setDns(opts, cb); |     return Challenge._setDns(opts, cb); | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   // Called when it's time to remove the challenge
 |   // Called when it's time to remove the challenge
 | ||||||
|   challenger.remove = function(opts, cb) { |   challenger.remove = function (opts) { | ||||||
|     return Challenge._removeDns(opts, cb); |     return Challenge._removeDns(opts); | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   // Optional (only really useful for http and testing)
 |   // Optional (only really useful for http and testing)
 | ||||||
|   // Called when the challenge needs to be retrieved
 |   // Called when the challenge needs to be retrieved
 | ||||||
|   challenger.get = function(opts) { |   challenger.get = function (opts) { | ||||||
|     return Challenge._getDns(opts); |     return Challenge._getDns(opts); | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
| @ -41,167 +38,88 @@ Challenge.create = function(config) { | |||||||
|   return challenger; |   return challenger; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| // Show the user the token and key and wait for them to be ready to continue
 |  | ||||||
| Challenge._getZones = function(args, cb) { |  | ||||||
|   // if you need per-run / per-domain options set them in approveDomains() and they'll be on 'args' here.
 |  | ||||||
|   if (!Array.isArray(args.dnsHosts)) { |  | ||||||
|     console.error( |  | ||||||
|       'You must be using Greenlock v2.7+ to use acme-dns-01-cli v3+' |  | ||||||
|     ); |  | ||||||
|     process.exit(); |  | ||||||
|   } |  | ||||||
|   console.info(); |  | ||||||
|   console.info('############################'); |  | ||||||
|   console.info('# Step 1: Get Domain Zones #'); |  | ||||||
|   console.info('############################'); |  | ||||||
|   console.info(); |  | ||||||
|   console.info( |  | ||||||
|     'Enter a comma or space delimited list of domain zones to which the following domain records belong.' |  | ||||||
|   ); |  | ||||||
|   console.info(); |  | ||||||
|   console.info( |  | ||||||
|     'Example:' + |  | ||||||
|       '\n\tDOMAIN RECORD\t=>\tDOMAIN ZONE' + |  | ||||||
|       '\n\texample.com\t=>\texample.com' + |  | ||||||
|       '\n\tfoo.example.com\t=>\texample.com' + |  | ||||||
|       '\n\tbar.example.com\t=>\texample.com' + |  | ||||||
|       '\n\texample.co.uk\t=>\texample.co.uk' + |  | ||||||
|       '\n\nYou would enter: example.com, example.co.uk' |  | ||||||
|   ); |  | ||||||
|   console.info(); |  | ||||||
|   console.info('Domain RECORDS: ', args.dnsHosts.join(', ')); |  | ||||||
|   process.stdout.write('Domain ZONE list: '); |  | ||||||
|   process.stdin.resume(); |  | ||||||
|   process.stdin.once('data', function(chunk) { |  | ||||||
|     process.stdin.pause(); |  | ||||||
|     var zones = chunk |  | ||||||
|       .toString('utf8') |  | ||||||
|       .trim() |  | ||||||
|       .split(/[,\s]+/); |  | ||||||
|     console.info('Got Domain Zones:', zones); |  | ||||||
|     setTimeout(function() { |  | ||||||
|       cb(null, zones); |  | ||||||
|     }, 1000); |  | ||||||
|   }); |  | ||||||
| }; |  | ||||||
| 
 | 
 | ||||||
| // 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._setDns = function(args, cb) { | Challenge._setDns = function (args, cb) { | ||||||
|   // if you need per-run / per-domain options set them in approveDomains() and they'll be on 'args' here.
 |   // 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( |     console.error("You must be using Greenlock v2.7+ to use greenlock-challenge-dns v3+"); | ||||||
|       'You must be using Greenlock v2.7+ to use acme-dns-01-cli v3+' |  | ||||||
|     ); |  | ||||||
|     process.exit(); |     process.exit(); | ||||||
|   } |   } | ||||||
|   var ch = args.challenge; |   var ch = args.challenge; | ||||||
| 
 | 
 | ||||||
|   console.info('\n\n\n\n\n'); |   console.info(""); | ||||||
|   console.info('#################################'); |  | ||||||
|   console.info('# Step 2: Set Domain TXT Record #'); |  | ||||||
|   console.info('#################################'); |  | ||||||
|   console.info(''); |  | ||||||
|   console.info("[ACME dns-01 '" + ch.altname + "' CHALLENGE]"); |   console.info("[ACME dns-01 '" + ch.altname + "' CHALLENGE]"); | ||||||
|   console.info("You're about to receive the following DNS query:"); |   console.info("You're about to receive the following DNS query:"); | ||||||
|   console.info(''); |   console.info(""); | ||||||
|   console.info( |   console.info("\tTXT\t" + ch.dnsHost + "\t" + ch.dnsAuthorization + "\tTTL 60"); | ||||||
|     '\tTXT\t' + ch.dnsHost + '\t' + ch.dnsAuthorization + '\tTTL 60' |   console.info(""); | ||||||
|   ); |  | ||||||
|   console.info(''); |  | ||||||
|   if (ch.debug) { |   if (ch.debug) { | ||||||
|     console.info('Debug Info:'); |     console.info("Debug Info:"); | ||||||
|     console.info(''); |     console.info(""); | ||||||
|     console.info( |     console.info(JSON.stringify(dnsChallengeToJson(ch), null, '  ').replace(/^/gm, '\t')); | ||||||
|       JSON.stringify(dnsChallengeToJson(ch), null, '  ').replace(/^/gm, '\t') |     console.info(""); | ||||||
|     ); |  | ||||||
|     console.info(''); |  | ||||||
|   } |   } | ||||||
|   console.info( |   console.info("Go set that DNS record, wait a few seconds for it to propagate, and then continue when ready"); | ||||||
|     'Go set that DNS record, wait a few seconds for it to propagate, and then continue when ready' |   console.info("[Press the ANY key to continue...]"); | ||||||
|   ); |  | ||||||
|   console.info('[Press the ANY key to continue...]'); |  | ||||||
|   process.stdin.resume(); |   process.stdin.resume(); | ||||||
|   process.stdin.once('data', function() { |   process.stdin.once('data', function () { | ||||||
|     process.stdin.pause(); |     process.stdin.pause(); | ||||||
|     setTimeout(function() { |     cb(null, null); | ||||||
|       cb(null, null); |  | ||||||
|     }, 1000); |  | ||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| // 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._removeDns = function(args, cb) { | Challenge._removeDns = function (args) { | ||||||
|   var ch = args.challenge; |   var ch = args.challenge; | ||||||
|   console.info('\n\n\n\n\n'); |   console.info(""); | ||||||
|   console.info('####################################'); |  | ||||||
|   console.info('# Step 4: Remove Domain TXT Record #'); |  | ||||||
|   console.info('####################################'); |  | ||||||
|   console.info(''); |  | ||||||
|   console.info("[ACME dns-01 '" + ch.altname + "' COMPLETE]: " + ch.status); |   console.info("[ACME dns-01 '" + ch.altname + "' COMPLETE]: " + ch.status); | ||||||
|   console.info( |   console.info("Challenge complete. You may now remove the DNS-01 challenge record:"); | ||||||
|     'Challenge complete. You may now remove the DNS-01 challenge record:' |   console.info(""); | ||||||
|   ); |   console.info("\tTXT\t" + ch.altname + "\t" + ch.dnsAuthorization); | ||||||
|   console.info(''); |   console.info(""); | ||||||
|   console.info('\tTXT\t' + ch.altname + '\t' + ch.dnsAuthorization); |  | ||||||
|   console.info(''); |  | ||||||
|   console.info('NOTE: the next get should be EMPTY'); |  | ||||||
|   console.info(''); |  | ||||||
| 
 | 
 | ||||||
|   setTimeout(function() { |   return null; | ||||||
|     cb(null, null); |  | ||||||
|   }, 1000); |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| // This is implemented here for completeness (and perhaps some possible use in testing),
 | // This is implemented here for completeness (and perhaps some possible use in testing),
 | ||||||
| // but it's not something you would implement because the Greenlock server isn't the NameServer.
 | // but it's not something you would implement because the Greenlock server isn't the NameServer.
 | ||||||
| Challenge._getDns = function(args) { | Challenge._getDns = function (args) { | ||||||
|   var ch = args.challenge; |   var ch = args.challenge; | ||||||
|   // because the way to mock a DNS challenge is weird
 |   // because the way to mock a DNS challenge is weird
 | ||||||
|   var altname = ch.altname || ch.dnsHost || ch.identifier.value; |   var altname = (ch.altname || ch.dnsHost || ch.identifier.value); | ||||||
|   var dnsHost = ch.dnsHost || ch.identifier.value; |   var dnsHost = (ch.dnsHost || ch.identifier.value); | ||||||
| 
 | 
 | ||||||
|   if (ch._test || !Challenge._getCache[ch.token]) { |   if (ch._test || !Challenge._getCache[ch.token]) { | ||||||
|     console.info('\n\n\n\n\n'); |  | ||||||
|     console.info('#################################'); |  | ||||||
|     console.info('# Step 3: Get Domain TXT Record #'); |  | ||||||
|     console.info('#################################'); |  | ||||||
|     Challenge._getCache[ch.token] = true; |     Challenge._getCache[ch.token] = true; | ||||||
|     console.info(''); |     console.info(""); | ||||||
|     console.info( |     console.info("[ACME " + ch.type + " '" + altname + "' REQUEST]: " + ch.status); | ||||||
|       '[ACME ' + ch.type + " '" + altname + "' REQUEST]: " + ch.status |  | ||||||
|     ); |  | ||||||
|     console.info("The '" + ch.type + "' challenge request has arrived!"); |     console.info("The '" + ch.type + "' challenge request has arrived!"); | ||||||
|     console.info('dig TXT ' + dnsHost); |     console.info('dig TXT ' + dnsHost); | ||||||
|     console.info( |     console.info("(paste in the \"DNS Authorization\" you received a moment ago to respond)"); | ||||||
|       '(paste in the "DNS Authorization" you received a moment ago to respond)' |     process.stdout.write("> "); | ||||||
|     ); |  | ||||||
|     process.stdout.write('> '); |  | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   return new Promise(function(resolve, reject) { |   return new Promise(function (resolve, reject) { | ||||||
|     process.stdin.resume(); |     process.stdin.resume(); | ||||||
|     process.stdin.once('error', reject); |     process.stdin.once('error', reject); | ||||||
|     process.stdin.once('data', function(chunk) { |     process.stdin.once('data', function (chunk) { | ||||||
|       process.stdin.pause(); |       process.stdin.pause(); | ||||||
| 
 | 
 | ||||||
|       var result = chunk.toString('utf8').trim(); |       var result = chunk.toString('utf8').trim(); | ||||||
|       try { |       try { | ||||||
|         result = JSON.parse(result); |         result = JSON.parse(result); | ||||||
|       } catch (e) { |       } catch(e) { | ||||||
|         args.challenge.dnsAuthorization = result; |         args.challenge.dnsAuthorization = result; | ||||||
|         result = args.challenge; |         result = args.challenge; | ||||||
|       } |       } | ||||||
|       if (result.dnsAuthorization) { |       if (result.dnsAuthorization) { | ||||||
|         setTimeout(function() { |         resolve(result); | ||||||
|           resolve(result); |  | ||||||
|         }, 1000); |  | ||||||
|         return; |         return; | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|       // The return value will checked. It must not be 'undefined'.
 |       // The return value will checked. It must not be 'undefined'.
 | ||||||
|       setTimeout(function() { |       resolve(null); | ||||||
|         resolve(null); |  | ||||||
|       }, 1000); |  | ||||||
|     }); |     }); | ||||||
|   }); |   }); | ||||||
| }; | }; | ||||||
| @ -209,15 +127,15 @@ Challenge._getCache = {}; | |||||||
| 
 | 
 | ||||||
| function dnsChallengeToJson(ch) { | function dnsChallengeToJson(ch) { | ||||||
|   return { |   return { | ||||||
|     type: ch.type, |     type: ch.type | ||||||
|     altname: ch.altname, |   , altname: ch.altname | ||||||
|     identifier: ch.identifier, |   , identifier: ch.identifier | ||||||
|     wildcard: ch.wildcard, |   , wildcard: ch.wildcard | ||||||
|     expires: ch.expires, |   , expires: ch.expires | ||||||
|     token: ch.token, |   , token: ch.token | ||||||
|     thumbprint: ch.thumbprint, |   , thumbprint: ch.thumbprint | ||||||
|     keyAuthorization: ch.keyAuthorization, |   , keyAuthorization: ch.keyAuthorization | ||||||
|     dnsHost: ch.dnsHost, |   , dnsHost: ch.dnsHost | ||||||
|     dnsAuthorization: ch.dnsAuthorization |   , dnsAuthorization: ch.dnsAuthorization | ||||||
|   }; |   }; | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| { | { | ||||||
|   "name": "acme-dns-01-cli", |   "name": "acme-dns-01-cli", | ||||||
|   "version": "3.1.0", |   "version": "3.0.7", | ||||||
|   "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", | ||||||
|   "homepage": "https://greenlock.domains/", |   "homepage": "https://greenlock.domains/", | ||||||
|   "main": "index.js", |   "main": "index.js", | ||||||
| @ -29,8 +29,5 @@ | |||||||
|   "bugs": { |   "bugs": { | ||||||
|     "url": "https://git.rootprojects.org/root/acme-dns-01-cli.js/issues" |     "url": "https://git.rootprojects.org/root/acme-dns-01-cli.js/issues" | ||||||
|   }, |   }, | ||||||
|   "dependencies": {}, |   "dependencies": {} | ||||||
|   "devDependencies": { |  | ||||||
|     "acme-dns-01-test": "^3.1.0" |  | ||||||
|   } |  | ||||||
| } | } | ||||||
|  | |||||||
							
								
								
									
										24
									
								
								test.js
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								test.js
									
									
									
									
									
								
							| @ -1,22 +1,18 @@ | |||||||
| 'use strict'; | 'use strict'; | ||||||
| 
 | 
 | ||||||
| var tester = require('acme-dns-01-test'); | var tester = require('greenlock-challenge-test'); | ||||||
| 
 | 
 | ||||||
| var type = 'dns-01'; | var type = 'dns-01'; | ||||||
| var challenger = require('./index.js').create({}); | var challenger = require('greenlock-challenge-dns').create({}); | ||||||
| 
 | 
 | ||||||
| // The dry-run tests can pass on, literally, 'example.com'
 | // The dry-run tests can pass on, literally, 'example.com'
 | ||||||
| // but the integration tests require that you have control over the domain
 | // but the integration tests require that you have control over the domain
 | ||||||
| var zone = 'example.com'; | var domain = '*.example.com'; | ||||||
| 
 | 
 | ||||||
| tester | tester.test(type, domain, challenger).then(function () { | ||||||
|   // will test example.com, foo.example.com, *.foo.example.com
 |   console.info("PASS"); | ||||||
|   .testZone(type, zone, challenger) | }).catch(function (err) { | ||||||
|   .then(function() { |   console.error("FAIL"); | ||||||
|     console.info('PASS'); |   console.error(err); | ||||||
|   }) |   process.exit(20); | ||||||
|   .catch(function(err) { | }); | ||||||
|     console.error('FAIL'); |  | ||||||
|     console.error(err); |  | ||||||
|     process.exit(20); |  | ||||||
|   }); |  | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user