Socket
Socket
Sign inDemoInstall

acme-dns-01-powerdns

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    acme-dns-01-powerdns

PowerDNS DNS for Let's Encrypt / ACME dns-01 challenges with ACME.js and Greenlock.js


Version published
Weekly downloads
10
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 14 Jun 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc