acme-dns-01-duckdns.js/test.js

25 lines
685 B
JavaScript
Raw Normal View History

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');
require('dotenv').config();
2019-06-07 05:32:22 +00:00
// Usage: node ./test.js example.com xxxxxxxxx
var zone = process.argv[2] || process.env.DUCKDNS_DOMAIN
2019-06-07 05:32:22 +00:00
var challenger = require('./index.js').create({
token: process.argv[3] || process.env.DUCKDNS_TOKEN
2019-06-07 05:32:22 +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
.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);
});