dynflare

command module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: MIT Imports: 11 Imported by: 0

README

Dynflare

Detects your external IP address and updates a DNS record in Cloudflare.

Install

From source: go get -u github.com/trapped/dynflare

Docker: docker run trapped/dynflare --help

Setup

Both environment variables and CLI flags are supported.

  • CLOUDFLARE_EMAIL or -cloudflare-email: Cloudflare email used for API authentication
  • CLOUDFLARE_API_KEY or -cloudflare-api-key: Cloudflare API key
  • RECORDS or -r: multiple values supported; DNS records in the <provider>:<zone>:<type>:<name> format; if using the environment variable, join records with , (comma)
  • -p: pretty-print all DNS records in a tab-separated table
  • -dry: fake the actual DNS update

After setting everything up, you should be able to just run ./dynflare; depending on your use-case, you might want to set up a cronjob or a Kubernetes CronJob.

Supported IP detection mechanisms

  • IPify
  • MyIP
  • More public services (planned)
  • Self-connect using ngrok (planned)
  • Fetch from multiple sources and pick most seen

Contributing

Adding a new IP provider

IP providers must implement the Provider interface:

type Provider interface {
	Name() string
	Fetch() (string, error)
}

Contributions are welcome! Just submit a pull request.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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