mcfd

command module
v0.0.0-...-6b55a7b Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: GPL-3.0 Imports: 2 Imported by: 0

README

mcfd

This app aims to be an easy manager for cloudflare dns. It uses a declarative approach to determine the state of your zones.

Installation

go get git.sr.ht/~ecmma/mcfd

or clone the repo and go build.

Usage

Create a configuration file under .config/mcfd/ called config (a --config flag is planned to permit users to specify their config's path).

The configuration file holds the state of your zones using yaml. A brief example:

authkey: "<your-auth-key>"
email: "<your-email>" 
ip: "<your-ip>"       # Obviously optional

zones: 
  - zone: "mydom.com"
    subs: 
      - name: "@"
        proxy: true
      - name: "mysub1"
        content: "my.other.ip"
        subs: 
        - name: "mysubsub1"
          content: "random.ip"
      - name: "mail"
        proxy: false
      - name: "" 
        record: "MX"
        content: "mail.mydom.com"
      - name: "www"
        proxy: true 
        content: "@"
        record: "CNAME"

So, mcfd works by reading your config file, creating an internal representation and put-ing the appropriate payload to CloudFlare.

Declarative configuration

The following code block describes the various keys and defaults of the configuration file.

authkey: "<your-auth-key>"    # The authorization key issued by CloudFlare 

email: "<your-email>"         # The email associated with your CloudFlare account

ip: "<your-ip>"               # (optional) Set this if you want your IP to be fixed. 
                              # If this value is not set, the default value 
                              # is the current public IP of the machine running mcfd.

zones:                        # The list of zones in your CloudFlare setup. 
  # --- archetype of zone representation
  - zone: "<your-domain>"     # The name of your registered domain. For example, 
                              # this field may be "mysite.me". 
    subs:                     # The list of subdomains (technically optional)

      # --- archetype of subdomain representation
      - name: "<your-sub>"    # The subdomain to update. The full qualified 
                              # record should be "<your-sub>.<your-domain>".
                              # For example, this field may be "www".
                              # (special) use "@" to refer to <your-domain>.

        content:              # (optional) default: "<ip>" (literally)
                              # What should be inserted in the record. For example, 
                              # it may be the redirect url for a CNAME record. 
                              # (special) "<ip>" represents the current ip or the field ip, if declared.
                              # (special) "@" represents "<your-domain>".

        proxy: true || false  # (optional) default: false

        record: "A"           # (optional) default: "A"
        
        subs:                 # Same as the `subs` field we're in now.

Future development

  • add executable arguments such as verbosity
  • add deletion and creation of DNS records to be truly declarative

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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