2019-06-07 05:32:22 +00: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 08:33:19 +00:00
|
|
|
require('dotenv').config();
|
2019-06-07 05:32:22 +00:00
|
|
|
|
|
|
|
// Usage: node ./test.js example.com xxxxxxxxx
|
2019-06-29 08:33:19 +00:00
|
|
|
var zone = process.argv[2] || process.env.DUCKDNS_DOMAIN
|
2019-06-07 05:32:22 +00:00
|
|
|
var challenger = require('./index.js').create({
|
2019-06-29 08:33:19 +00:00
|
|
|
token: process.argv[3] || process.env.DUCKDNS_TOKEN
|
2019-06-07 05:32:22 +00:00
|
|
|
});
|
|
|
|
|
2019-06-29 08:33:19 +00:00
|
|
|
// DuckDNS is limited and cannot pass the full range of tests
|
|
|
|
// so instead of the normal testZone(), we testRecord().
|
2019-06-07 05:32:22 +00:00
|
|
|
tester
|
2019-06-29 08:33:19 +00:00
|
|
|
.testRecord('dns-01', zone, challenger)
|
2019-06-07 05:32:22 +00:00
|
|
|
.then(function() {
|
|
|
|
console.info('PASS', zone);
|
|
|
|
})
|
|
|
|
.catch(function(e) {
|
|
|
|
console.error(e.message);
|
|
|
|
console.error(e.stack);
|
|
|
|
});
|