Giter VIP home page Giter VIP logo

leitstand-powerdns's Introduction

Leitstand Powerdns Connector

This Project is the powerdns connector of the Leitstand project. It connects the Leitstand inventory with powerdns.

TOC

  1. Leitstand Powerdns Connector
    1. TOC
    2. Getting Started
    3. Build
    4. Run
      1. Configuration
    5. Build docker
    6. Run docker

Getting Started

This project is developed with the go language.

Build

To build the project just use make.

make

After the build the binary can be found in the build folder bin. There is one subfolder for each platform.

Run

$ ./bin/darwin_amd64/connector  -help
Usage of ./bin/darwin_amd64/connector:
  -addr string
        HTTP network address (default ":19991")
  -config string
        Configuration for the powerdns connector (default "/etc/leitstand/connector/powerdns.json")
  -version
        Returns the software version

Configuration

The Configuration file for the connector needs to specify the following data:

  • Nameservers Nameservers to use for zone creation, not allowed to be empty
  • ExternalURL The URL under which this service is externally reachable (for example, if this services is served via a reverse proxy). Used for generating relative and absolute links back to this service itself. (e.g.: http://localhost:19991)
  • PowerdnsServerID the id of the server, see https://doc.powerdns.com/authoritative/http-api/server.html (e.g.: localhost)
  • PowerdnsBaseURL the base url of the server (e.g.: http://localhost:8081)
  • PowerdnsAPIKey the api key of powerdns (e.g.: changeme)
  • WebHookID is used to register this service in the inventory as event listener. This should not change, otherwise the service is registered twice. (e.g. 52acd668-3171-45a3-b23a-05adc76dc809)
  • InventoyRestRestURL the base url of the inventory server (e.g.: http://10.0.0.7:8080/api/v1)
  • InventoryAuthorizationHeader the authorization header to call the webhook registration server (e.g.: Basic bWFydGluOmdlaGVpbQ==)

Example:

{
  "external_url": "${external_url:http://localhost:19991}",
  "nameservers": ["dns."],
  "powerdns_server_id": "${powerdns_server_id:localhost}",
  "powerdns_base_url": "${powerdns_base_url:http://localhost:8081}",
  "powerdns_api_key": "${powerdns_api_key:changeme}",
  "inventory_rest_rest_url":"${inventory_rest_rest_url:http://10.0.0.7:8080/api/v1}",
  "web_hook_id": "${web_hook_id:52acd668-3171-45a3-b23a-05adc76dc809}",
  "inventory_authorization_header": "${inventory_authorization_header:Basic bWFydGluOmdlaGVpbQ==}"
}

The syntax ${<variable>:<defaultvalue>} allows ot specify a environment variable and if that is not set a default value. The default value can be omitted by just writing ${variable}.

Build docker

To build a docker container just use:

make docker-build

Run docker

To run a docker container just use:

make docker-run

Sequenz Diagram

The following sequence diagram gives a short overview of the connectors functionality.

Swagger

Find the swagger files under the doc folder.

image

The connector registers every 60 seconds in the inventory. If there is a change in an DNS record the inventory sends a notification to the connector. The connector translates the changes and sends them to the powerdns web api.

leitstand-powerdns's People

Contributors

idefixcert avatar martinsteger avatar

Watchers

James Cloos avatar  avatar Hannes Gredler avatar  avatar

Forkers

patrickpl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.