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

34 lines
936 B
JavaScript
Raw Normal View History

#!/usr/bin/env node
'use strict';
2019-07-16 15:04:09 +00:00
// https://git.rootprojects.org/root/acme-dns-01-test.js
2019-07-18 06:18:53 +00:00
var tester = require('acme-challenge-test');
2019-07-23 07:54:22 +00:00
require('dotenv').config();
// Usage: node ./test.js example.com xxxxxxxxx
2019-07-23 07:54:22 +00:00
var zone = process.argv[2] || process.env.ZONE;
var challenger = require('./index.js').create({
2019-07-23 07:54:22 +00:00
apiUser: process.argv[3] || process.env.API_USER,
apiKey: process.argv[4] || process.env.API_KEY || process.env.TOKEN,
clientIp: process.argv[5] || process.env.CLIENT_IP,
username:
process.argv[6] ||
process.env.USERNAME ||
process.argv[3] ||
process.env.API_USER
});
// The dry-run tests can pass on, literally, 'example.com'
// but the integration tests require that you have control over the domain
tester
2019-07-16 15:04:09 +00:00
.testZone('dns-01', zone, challenger)
2019-07-23 07:54:22 +00:00
.then(function() {
console.info('PASS', zone);
})
.catch(function(e) {
console.info('FAIL', zone);
console.error(e.message);
console.error(e.stack);
});