yaddnsccf

package module
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

README

yaddnsc-cloudflare: Cloudflare DNS Support for yaddnsc

This module implements support for Cloudflare DNS into yaddnsc.

Features

  • Support for IPv4 and IPv6
  • Support for multiple host updates

Requirements

  • The DNS record to be updated must already exist in Cloudflare; this module does not create DNS entries.
  • You must create and use a scoped Cloudflare token with this module.

Configuration

Refer to the formal JSON schema definition in schema.json. An example configuration is provided below.

Example
{
    "services":
        [
            {
                "type": "cloudflare",
                "config": {
                    "token": "My-Secret-Cloudflare-Token",
                    "zone_id": "My-DNS-Zone-ID",
                    "hosts": ["myhost.mydomain.com", "mydomain.com"]
                }
            }
        ]
}

If you need to update the root record of a domain, use the domain name as shown in the example above.

The type of record (A or AAAA) to be updated is determined by the IP address received in the request from yaddnsc. When yaddnsc sends an IPv4 address then this module attempts to pull the A record for the given host and update it. Same with an IPv6 address.

Response

As part of a yaddnsc response, a service must return a JSON object that is then used for template substitution in your webhook configurations. This service's JSON object includes the following keys:

Key Values
OriginalIP The IP address found in the DNS record
UpdatedIP The IP address now stored in DNS; might be same as OriginalIP if the IP address did not change.
Status The yaddnsc status for this request; one of NoChg, Ok, Err
ZoneID The Cloudflare Zone ID being modified.
Host The hostname being modified or the domain name if it's a root record update; note that this is always a single value as configs with multiple hosts are broken up into multiple requests.

Use this values for substitutions in your webhooks to send contextual information about an update to your webhooks.

Contributing

Pull requests are welcome. Bugs and feature requests can also be submitted as tickets in the project.

Documentation

Overview

Package yaddnsccf implements support for Cloudflare DNS in yaddnsc

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Processor

type Processor struct {
	// contains filtered or unexported fields
}

func New

func New(log wlog.Logger) *Processor

func (*Processor) Describe

func (impl *Processor) Describe() string

func (*Processor) Execute

func (impl *Processor) Execute(blob []byte, systemIP net.IP) ([]byte, error)

func (*Processor) Init added in v0.1.1

func (impl *Processor) Init() error

func (*Processor) Schema added in v0.1.0

func (impl *Processor) Schema() []byte

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL