acme-dns-01-powerdns

1.0.7 • Public • Published

acme-dns-01-powerdns

npm NPM Snyk Vulnerabilities for npm package Website

a acme-dns/greenlock plugin for powerdns

Install

npm i acme-dns-01-powerdns --save

Usage

You have to supply a file named .env, in your projects root folder, with your information, like shown here

.env

PDNS_API_KEY = "your powerdns api key";
PDNS_API_ENDPOINT = "https://example.com/api/v1/servers/localhost";
MAINTAINER_EMAIL = "maintainer@example.com";
SUBSCRIBER_EMAIL = "subscriber@example.com";

Also install greenlock and dotenv if you haven't already

npm i greenlock dotenv --save

Now you can request a certificate using greenlock with your own powerdns server

Set staging to false to get a real non testing certificate if you're sure that your config works

index.js

"use strict";

require("dotenv").config(); //loads the .env file and provides the variables to the process

var pkg = require("./package.json");
var Greenlock = require("greenlock");
var greenlock = Greenlock.create({
    packageRoot: __dirname,
    configDir: "./greenlock.d/",
    packageAgent: pkg.name + "/" + pkg.version,
    maintainerEmail: process.env.MAINTAINER_EMAIL,
    staging: true,
    notify: function (event, details) {
        if ("error" === event) {
            // `details` is an error object in this case
            console.error(details);
        }
    }
});

greenlock.manager.defaults({
    // The "Let's Encrypt Subscriber" (often the same as the maintainer)
    // NOT the end customer (except where that is also the maintainer)
    subscriberEmail: process.env.SUBSCRIBER_EMAIL,
    agreeToTerms: true,
    challenges: {
        "dns-01": {
            module: "acme-dns-01-powerdns",
            token: process.env.PDNS_API_KEY,
            baseUrl: process.env.PDNS_API_ENDPOINT
        }
    }
});
var altnames = ["example.com", "*.example.com"];

greenlock
    .add({
        subject: altnames[0],
        altnames: altnames
    })
    .then(function () {
        // saved config to db (or file system)
    });

Need help?

Feel free to contact me via xl9jthv_7bvgakv9o9wg0jabn2ylm91xxrzzgt0e@y.gy in english or german

powerdns-api for nodejs

powerdns-api

PDNS WEB API Documentation

https://doc.powerdns.com/authoritative/http-api/index.html

Package Sidebar

Install

npm i acme-dns-01-powerdns

Weekly Downloads

16

Version

1.0.7

License

MIT

Unpacked Size

9.57 kB

Total Files

6

Last publish

Collaborators

  • firstdorsal