acme-http-01-s3.js/test.js

28 lines
793 B
JavaScript
Raw Normal View History

2019-11-01 06:23:19 +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();
// Usage: node ./test.js example.com username xxxxxxxxx
var record = process.argv[2] || process.env.RECORD;
var challenger = require('./index.js').create({
databaseUrl: process.env.DATABASE_URL,
tableName: process.env.TABLE_NAME,
dialect: process.env.DIALECT,
storage: process.env.STORAGE
});
// The dry-run tests can pass on, literally, 'example.com'
// but the integration tests require that you have control over the domain
tester
.testRecord('http-01', record, challenger)
.then(function() {
console.info('PASS', record);
})
.catch(function(e) {
console.error(e.message);
console.error(e.stack);
});