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 github.com/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"
record: "A"
subs:
- name: "mysub1"
content: "my.other.ip"
- name "mail"
proxy: false
- name: ""
record: "MX"
content: "mail.mydom.com"
- name: "www"
proxy: true
content: "mydom.com"
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".
proxy: true || false # (optional) default: false
record: "A" # (optional) default: "A"
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".
content: # (optional) default: "<ip>" (literally)
# What should be inserted in the record. For example,
# it may be the redirect url for a CNAME record.
# The default "<ip>" represents the current ip
# or the field ip, if declared.
proxy: true || false # (optional) default: false
record: "A" # (optional) default: "A"
Future development
- add subsub(sub..sub)domains
- add executable arguments
- other ideas?