From c7336ae7da68abc17be6051ba1d10a2b986760ea Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Mon, 15 Jul 2019 21:24:31 -0600 Subject: [PATCH] project skeleton --- AUTHORS | 1 + example.env | 2 ++ index.js | 3 +++ lib/index.js | 29 +++++++++++++++++++++++++++++ package.json | 27 +++++++++++++++++++++++++++ test.js | 23 +++++++++++++++++++++++ 6 files changed, 85 insertions(+) create mode 100644 AUTHORS create mode 100644 example.env create mode 100644 index.js create mode 100644 lib/index.js create mode 100644 package.json create mode 100755 test.js diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..f2496e6 --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ +AJ ONeal (https://coolaj86.com/) diff --git a/example.env b/example.env new file mode 100644 index 0000000..48ceb39 --- /dev/null +++ b/example.env @@ -0,0 +1,2 @@ +ZONE=example.co.uk +TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx diff --git a/index.js b/index.js new file mode 100644 index 0000000..647221a --- /dev/null +++ b/index.js @@ -0,0 +1,3 @@ +'use strict'; + +module.exports = require('./lib/index.js'); diff --git a/lib/index.js b/lib/index.js new file mode 100644 index 0000000..e25856a --- /dev/null +++ b/lib/index.js @@ -0,0 +1,29 @@ +'use strict'; + +var request; +var defaults = {}; + +module.exports.create = function(config) { + return { + init: function(opts) { + request = opts.request; + return null; + }, + zones: function(data) { + //console.info('List Zones', data); + throw Error('listing zones not implemented'); + }, + set: function(data) { + // console.info('Add TXT', data); + throw Error('setting TXT not implemented'); + }, + remove: function(data) { + // console.info('Remove TXT', data); + throw Error('removing TXT not implemented'); + }, + get: function(data) { + // console.info('List TXT', data); + throw Error('listing TXTs not implemented'); + } + }; +}; diff --git a/package.json b/package.json new file mode 100644 index 0000000..1e9b7e1 --- /dev/null +++ b/package.json @@ -0,0 +1,27 @@ +{ + "name": "acme-dns-01-route53", + "version": "0.0.1", + "description": "Amazon AWS Route53 DNS + Let's Encrypt for Node.js - ACME dns-01 challenges w/ ACME.js and Greenlock.js", + "main": "index.js", + "scripts": { + "test": "node test.js" + }, + "repository": { + "type": "git", + "url": "https://git.coolaj86.com/coolaj86/acme-dns-01-route53.js.git" + }, + "keywords": [ + "digitalocean", + "digital-ocean", + "dns", + "dns-01", + "letsencrypt", + "acme", + "greenlock" + ], + "author": "AJ ONeal (https://coolaj86.com/)", + "license": "MPL-2.0", + "devDependencies": { + "dotenv": "^8.0.0" + } +} diff --git a/test.js b/test.js new file mode 100755 index 0000000..b794bdf --- /dev/null +++ b/test.js @@ -0,0 +1,23 @@ +#!/usr/bin/env node +'use strict'; + +// See https://git.coolaj86.com/coolaj86/acme-challenge-test.js +var tester = require('acme-challenge-test'); + +// Usage: node ./test.js example.com xxxxxxxxx +var zone = process.argv[2] || process.env.ZONE; +var challenger = require('./index.js').create({ + token: process.argv[3] || process.env.TOKEN +}); + +// The dry-run tests can pass on, literally, 'example.com' +// but the integration tests require that you have control over the domain +tester + .testZone('dns-01', zone, challenger) + .then(function() { + console.info('PASS', zone); + }) + .catch(function(e) { + console.error(e.message); + console.error(e.stack); + });