Compare commits
No commits in common. "master" and "refactor" have entirely different histories.
|
@ -1,3 +1,2 @@
|
|||
.env
|
||||
*secret*
|
||||
node_modules
|
||||
|
|
12
README.md
12
README.md
|
@ -1,4 +1,4 @@
|
|||
# [acme-dns-01-vultr](https://git.rootprojects.org/root/acme-dns-01-vultr.js) | a [Root](https://rootprojects.org) project
|
||||
# [acme-dns-01-vultr](https://git.rootprojects.org/root/acme-dns-01-vultr.js) | a [Root](https://rootrpojects.org) project
|
||||
|
||||
Vultr DNS + Let's Encrypt for Node.js
|
||||
|
||||
|
@ -13,12 +13,12 @@ npm install --save acme-dns-01-vultr@3.x
|
|||
|
||||
# Usage
|
||||
|
||||
First you create an instance with your API token:
|
||||
First you create an instance with your credentials:
|
||||
|
||||
```js
|
||||
var dns01 = require('acme-dns-01-vultr').create({
|
||||
baseUrl: 'https://api.vultr.com/v1/dns', // default
|
||||
token: 'xxxx'
|
||||
apiKey: 'xxxx'
|
||||
});
|
||||
```
|
||||
|
||||
|
@ -55,14 +55,14 @@ dns01
|
|||
.set({
|
||||
identifier: { value: 'foo.example.com' },
|
||||
wildcard: false,
|
||||
dnsHost: '_acme-challenge.foo.example.com',
|
||||
dnsHost: '_acme-challenge.foo.example.com'
|
||||
dnsAuthorization: 'xxx_secret_xxx'
|
||||
})
|
||||
.then(function () {
|
||||
console.log('TXT record set');
|
||||
console.log("TXT record set");
|
||||
})
|
||||
.catch(function () {
|
||||
console.log('Failed to set TXT record');
|
||||
console.log("Failed to set TXT record");
|
||||
});
|
||||
```
|
||||
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
ZONE=example.co.uk
|
||||
TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
@ -9,9 +9,7 @@ var defaults = {
|
|||
|
||||
module.exports.create = function(config) {
|
||||
var baseUrl = (config.baseUrl || defaults.baseUrl).replace(/\/$/, '');
|
||||
// In all of the other modules the API token is called token,
|
||||
// but here we support both.
|
||||
var apiKey = config.token || config.apiKey;
|
||||
var apiKey = config.apiKey;
|
||||
|
||||
function api(method, path, form) {
|
||||
return request({
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "acme-dns-01-vultr",
|
||||
"version": "3.0.2",
|
||||
"version": "3.0.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -23,12 +23,6 @@
|
|||
"requires": {
|
||||
"acme-challenge-test": "^3.2.0"
|
||||
}
|
||||
},
|
||||
"dotenv": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.0.0.tgz",
|
||||
"integrity": "sha512-30xVGqjLjiUOArT4+M5q9sYdvuR4riM6yK9wMcas9Vbp6zZa+ocC9dp6QoftuhTPhFAiLK/0C5Ni2nou/Bk8lg==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "acme-dns-01-vultr",
|
||||
"version": "3.0.2",
|
||||
"version": "3.0.0",
|
||||
"description": "Vultr DNS for Let's Encrypt / ACME dns-01 challenges with ACME.js and Greenlock.js",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
@ -24,7 +24,6 @@
|
|||
"@root/request": "^1.3.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
"acme-dns-01-test": "^3.2.1",
|
||||
"dotenv": "^8.0.0"
|
||||
"acme-dns-01-test": "^3.2.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
#!/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();
|
||||
// https://git.rootprojects.org/root/acme-dns-01-test.js
|
||||
var tester = require('acme-dns-01-test');
|
||||
|
||||
// Usage: node ./test.js example.com xxxxxxxxx
|
||||
var zone = process.argv[2] || process.env.ZONE;
|
||||
var zone = process.argv[2];
|
||||
var challenger = require('./index.js').create({
|
||||
token: process.argv[3] || process.env.TOKEN
|
||||
apiKey: process.argv[3]
|
||||
});
|
||||
|
||||
// The dry-run tests can pass on, literally, 'example.com'
|
||||
|
@ -19,6 +18,7 @@ tester
|
|||
console.info('PASS', zone);
|
||||
})
|
||||
.catch(function(e) {
|
||||
console.info('FAIL', zone);
|
||||
console.error(e.message);
|
||||
console.error(e.stack);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue