| 
									
										
										
										
											2019-06-06 23:32:22 -06:00
										 |  |  | #!/usr/bin/env node
 | 
					
						
							|  |  |  | 'use strict'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // See https://git.coolaj86.com/coolaj86/acme-challenge-test.js
 | 
					
						
							|  |  |  | var tester = require('acme-challenge-test'); | 
					
						
							| 
									
										
										
										
											2019-06-29 02:33:19 -06:00
										 |  |  | require('dotenv').config(); | 
					
						
							| 
									
										
										
										
											2019-06-06 23:32:22 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  | // Usage: node ./test.js example.com xxxxxxxxx
 | 
					
						
							| 
									
										
										
										
											2019-06-29 02:33:19 -06:00
										 |  |  | var zone = process.argv[2] || process.env.DUCKDNS_DOMAIN | 
					
						
							| 
									
										
										
										
											2019-06-06 23:32:22 -06:00
										 |  |  | var challenger = require('./index.js').create({ | 
					
						
							| 
									
										
										
										
											2019-06-29 02:33:19 -06:00
										 |  |  | 	token: process.argv[3] || process.env.DUCKDNS_TOKEN | 
					
						
							| 
									
										
										
										
											2019-06-06 23:32:22 -06:00
										 |  |  | }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-29 02:33:19 -06:00
										 |  |  | // DuckDNS is limited and cannot pass the full range of tests
 | 
					
						
							|  |  |  | // so instead of the normal testZone(), we testRecord().
 | 
					
						
							| 
									
										
										
										
											2019-06-06 23:32:22 -06:00
										 |  |  | tester | 
					
						
							| 
									
										
										
										
											2019-06-29 02:33:19 -06:00
										 |  |  | 	.testRecord('dns-01', zone, challenger) | 
					
						
							| 
									
										
										
										
											2019-06-06 23:32:22 -06:00
										 |  |  | 	.then(function() { | 
					
						
							|  |  |  | 		console.info('PASS', zone); | 
					
						
							|  |  |  | 	}) | 
					
						
							|  |  |  | 	.catch(function(e) { | 
					
						
							|  |  |  | 		console.error(e.message); | 
					
						
							|  |  |  | 		console.error(e.stack); | 
					
						
							|  |  |  | 	}); |