Compare commits
	
		
			No commits in common. "master" and "v3.0.2" have entirely different histories.
		
	
	
		
	
		
							
								
								
									
										16
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								README.md
									
									
									
									
									
								
							| @ -1,4 +1,4 @@ | |||||||
| # [greenlock-challenge-manual](https://git.coolaj86.com/coolaj86/greenlock-challenge-manual.js) | # [le-challenge-manual](https://git.coolaj86.com/coolaj86/le-challenge-manual.js) | ||||||
| 
 | 
 | ||||||
| | A [Root](https://rootprojects.org) Project | | | A [Root](https://rootprojects.org) Project | | ||||||
| 
 | 
 | ||||||
| @ -13,15 +13,15 @@ for [Greenlock](https://git.coolaj86.com/coolaj86/greenlock-express.js) v2.7+ (a | |||||||
| 
 | 
 | ||||||
| Other ACME Challenge Reference Implementations: | Other ACME Challenge Reference Implementations: | ||||||
| 
 | 
 | ||||||
| * [**greenlock-challenge-manual**](https://git.coolaj86.com/coolaj86/greenlock-challenge-manual.js) | * [**le-challenge-manual**](https://git.coolaj86.com/coolaj86/le-challenge-manual.js) | ||||||
| * [greenlock-challenge-http](https://git.coolaj86.com/coolaj86/greenlock-challenge-http.js) | * [le-challenge-http](https://git.coolaj86.com/coolaj86/le-challenge-http.js) | ||||||
| * [greenlock-challenge-dns](https://git.coolaj86.com/coolaj86/greenlock-challenge-dns.js) | * [le-challenge-dns](https://git.coolaj86.com/coolaj86/le-challenge-dns.js) | ||||||
| 
 | 
 | ||||||
| Install | Install | ||||||
| ------- | ------- | ||||||
| 
 | 
 | ||||||
| ```bash | ```bash | ||||||
| npm install --save greenlock-challenge-manual@3.x | npm install --save le-challenge-manual@3.x | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| Usage | Usage | ||||||
| @ -32,9 +32,9 @@ var Greenlock = require('greenlock'); | |||||||
| 
 | 
 | ||||||
| Greenlock.create({ | Greenlock.create({ | ||||||
|   ... |   ... | ||||||
| , challenges: { 'http-01': require('greenlock-challenge-manual') | , challenges: { 'http-01': require('le-challenge-manual') | ||||||
|               , 'dns-01': require('greenlock-challenge-manual') |               , 'dns-01': require('le-challenge-manual') | ||||||
|               , 'tls-alpn-01': require('greenlock-challenge-manual') |               , 'tls-alpn-01': require('le-challenge-manual') | ||||||
|               } |               } | ||||||
|   ... |   ... | ||||||
| }); | }); | ||||||
|  | |||||||
							
								
								
									
										6
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								index.js
									
									
									
									
									
								
							| @ -6,8 +6,8 @@ var Challenge = module.exports; | |||||||
| Challenge.create = function (config) { | Challenge.create = function (config) { | ||||||
|   // 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).
 | ||||||
| 
 | 
 | ||||||
|   var http01 = require('greenlock-challenge-http').create(config); |   var http01 = require('le-challenge-http').create(config); | ||||||
|   var dns01 = require('greenlock-challenge-dns').create(config); |   var dns01 = require('le-challenge-dns').create(config); | ||||||
| 
 | 
 | ||||||
|   var challenger = {}; |   var challenger = {}; | ||||||
| 
 | 
 | ||||||
| @ -114,7 +114,7 @@ Challenge._get = function (args) { | |||||||
|     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(); | ||||||
|       try { |       try { | ||||||
|         result = JSON.parse(result); |         result = JSON.parse(result); | ||||||
|       } catch(e) { |       } catch(e) { | ||||||
|  | |||||||
							
								
								
									
										20
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										20
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @ -1,18 +1,18 @@ | |||||||
| { | { | ||||||
|   "name": "greenlock-challenge-manual", |   "name": "le-challenge-manual", | ||||||
|   "version": "3.0.4", |   "version": "3.0.2", | ||||||
|   "lockfileVersion": 1, |   "lockfileVersion": 1, | ||||||
|   "requires": true, |   "requires": true, | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "greenlock-challenge-dns": { |     "le-challenge-dns": { | ||||||
|       "version": "3.0.4", |       "version": "3.0.2", | ||||||
|       "resolved": "https://registry.npmjs.org/greenlock-challenge-dns/-/greenlock-challenge-dns-3.0.4.tgz", |       "resolved": "https://registry.npmjs.org/le-challenge-dns/-/le-challenge-dns-3.0.2.tgz", | ||||||
|       "integrity": "sha512-CJI9RAtrZl9ICldyU5cRGzb1/wIbS3O+MJy9z7gKb7fLDNF7Wmw9Fv2agBLSOtIPr7TYgyyesvt8ppA4OIS+yg==" |       "integrity": "sha512-cmg26G2VdcRL9Ja8JegsES3B2jBTZ/LkkaqzrUAMRl2UQQiS/+kursn3J761ht58/sXOpYVp5V6rQwIXSknDbg==" | ||||||
|     }, |     }, | ||||||
|     "greenlock-challenge-http": { |     "le-challenge-http": { | ||||||
|       "version": "3.0.1", |       "version": "3.0.0", | ||||||
|       "resolved": "https://registry.npmjs.org/greenlock-challenge-http/-/greenlock-challenge-http-3.0.1.tgz", |       "resolved": "https://registry.npmjs.org/le-challenge-http/-/le-challenge-http-3.0.0.tgz", | ||||||
|       "integrity": "sha512-u+r8VtT+Qve0wucVZEPivFRT7DP+Jfl7McGMbna0BFVvAc+NJyOJGyvBa6aGDi4qgEhx7pjh0yCsCEKDHI2zDw==" |       "integrity": "sha512-kQb2j/lftI6mRjHy5AqueOkqjlcyfLlAF3Nk468xjloG0JGadjK4iT23mlXTaBIg84OIpPlhRuS+XNs5uhn8Xw==" | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | |||||||
							
								
								
									
										21
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								package.json
									
									
									
									
									
								
							| @ -1,21 +1,22 @@ | |||||||
| { | { | ||||||
|   "name": "greenlock-challenge-manual", |   "name": "le-challenge-manual", | ||||||
|   "version": "3.0.4", |   "version": "3.0.2", | ||||||
|   "description": "A cli-based strategy for node-letsencrypt. Prints the ACME challenge Token and Key and then waits for you to hit enter before continuing.", |   "description": "A cli-based strategy for node-letsencrypt. Prints the ACME challenge Token and Key and then waits for you to hit enter before continuing.", | ||||||
|   "main": "index.js", |   "main": "index.js", | ||||||
|   "homepage": "https://git.coolaj86.com/coolaj86/greenlock-challenge-manual.js", |   "homepage": "https://git.coolaj86.com/coolaj86/le-challenge-manual.js", | ||||||
|   "scripts": { |   "scripts": { | ||||||
|     "test": "node test.js" |     "test": "node test.js" | ||||||
|   }, |   }, | ||||||
|   "repository": { |   "repository": { | ||||||
|     "type": "git", |     "type": "git", | ||||||
|     "url": "https://git.coolaj86.com/coolaj86/greenlock-challenge-manual.js.git" |     "url": "https://git.coolaj86.com/coolaj86/le-challenge-manual.js.git" | ||||||
|   }, |   }, | ||||||
|   "keywords": [ |   "keywords": [ | ||||||
|     "Let's Encrypt", |     "le-challenge", | ||||||
|     "ACME", |     "le-challenge-", | ||||||
|     "challenge", |  | ||||||
|     "manual", |     "manual", | ||||||
|  |     "acme", | ||||||
|  |     "letsencrypt", | ||||||
|     "certbot", |     "certbot", | ||||||
|     "cli", |     "cli", | ||||||
|     "commandline" |     "commandline" | ||||||
| @ -23,10 +24,10 @@ | |||||||
|   "author": "AJ ONeal <coolaj86@gmail.com> (https://coolaj86.com/)", |   "author": "AJ ONeal <coolaj86@gmail.com> (https://coolaj86.com/)", | ||||||
|   "license": "MPL-2.0", |   "license": "MPL-2.0", | ||||||
|   "bugs": { |   "bugs": { | ||||||
|     "url": "https://git.coolaj86.com/coolaj86/greenlock-challenge-manual.js/issues" |     "url": "https://git.coolaj86.com/coolaj86/le-challenge-manual.js/issues" | ||||||
|   }, |   }, | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "greenlock-challenge-dns": "^3.0.3", |     "le-challenge-dns": "^3.0.2", | ||||||
|     "greenlock-challenge-http": "^3.0.0" |     "le-challenge-http": "^3.0.0" | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | |||||||
							
								
								
									
										55
									
								
								test.js
									
									
									
									
									
								
							
							
						
						
									
										55
									
								
								test.js
									
									
									
									
									
								
							| @ -1,25 +1,50 @@ | |||||||
| 'use strict'; | 'use strict'; | ||||||
|  | /*global Promise*/ | ||||||
| 
 | 
 | ||||||
| var tester = require('greenlock-challenge-test'); | var challenge = require('./').create({}); | ||||||
| 
 | 
 | ||||||
| var challenger = require('./').create({}); | var opts = challenge.getOptions && challenge.getOptions() || challenge.options; | ||||||
| 
 | 
 | ||||||
| // The dry-run tests can pass on, literally, 'example.com'
 | function run() { | ||||||
| // but the integration tests require that you have control over the domain
 |   // this will cause the prompt to appear
 | ||||||
| var domain = 'example.com'; |   return new Promise(function (resolve, reject) { | ||||||
| var wildname = '*.example.com'; |     challenge.set(opts, function () { | ||||||
| 
 |       // this will cause the final completion message to appear
 | ||||||
| tester.test('http-01', domain, challenger).then(function () { |       return Promise.resolve(challenge.remove(opts)).then(resolve).catch(reject); | ||||||
|   console.info("PASS http-01"); |  | ||||||
|   return tester.test('dns-01', wildname, challenger).then(function () { |  | ||||||
|     console.info("PASS dns-01"); |  | ||||||
|     }); |     }); | ||||||
|  |   }); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | opts.challenge = { | ||||||
|  |   type: 'http-01' | ||||||
|  | , identifier: { type: 'dns', value: 'example.com' } | ||||||
|  | , wildcard: false | ||||||
|  | , expires: '2012-01-01T12:00:00.000Z' | ||||||
|  | , token: 'abc123' | ||||||
|  | , thumbprint: '<<account key thumbprint>>' | ||||||
|  | , keyAuthorization: 'abc123.xxxx' | ||||||
|  | , dnsHost: '_acme-challenge.example.com' | ||||||
|  | , dnsAuthorization: 'yyyy' | ||||||
|  | , altname: 'example.com' | ||||||
|  | }; | ||||||
|  | run(opts).then(function () { | ||||||
|  |   opts.challenge = { | ||||||
|  |     type: 'dns-01' | ||||||
|  |   , identifier: { type: 'dns', value: 'example.com' } | ||||||
|  |   , wildcard: true | ||||||
|  |   , expires: '2012-01-01T12:00:00.000Z' | ||||||
|  |   , token: 'abc123' | ||||||
|  |   , thumbprint: '<<account key thumbprint>>' | ||||||
|  |   , keyAuthorization: 'abc123.xxxx' | ||||||
|  |   , dnsHost: '_acme-challenge.example.com' | ||||||
|  |   , dnsAuthorization: 'yyyy' | ||||||
|  |   , altname: '*.example.com' | ||||||
|  |   }; | ||||||
|  |   return run(opts); | ||||||
| }).then(function () { | }).then(function () { | ||||||
|   return tester.test('fake-01', domain, challenger).then(function () { |   console.info("PASS"); | ||||||
|     console.info("PASS fake-01"); |  | ||||||
|   }); |  | ||||||
| }).catch(function (err) { | }).catch(function (err) { | ||||||
|   console.error("FAIL"); |   console.error("FAIL"); | ||||||
|   console.error(err); |   console.error(err); | ||||||
|   process.exit(20); |   process.exit(17); | ||||||
| }); | }); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user