syncflaer

module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: GPL-3.0

README

SyncFlaer

Synchronize Traefik host rules with Cloudflare®.

Docker Image Version (latest semver) Docker Pulls

Why?

  • Dynamically create, update or delete Cloudflare® DNS records based on Traefik http rules
  • Update DNS records when public IP changes
  • Supports configuring additional DNS records that are not in Traefik

Contents

Usage

Simple

Create a config file based on the example examples/config.yml located in this repository.

syncflaer -config-path /opt/syncflaer.yml

Flags:

Usage of SyncFlaer:
  -config-path string
    	Path to config file (default "config.yml")
  -debug
    	Enable debug mode
  -version
    	Print the current version and exit
Kubernetes

SyncFlaer can also run as a Kubernetes CronJob. Please refer to the examples/deploy directory of this repository.

Configuration

Overview

SyncFlaer is configurable via a YAML config file as well as some environment variables.

Minimal Config File
---
rootDomain: example.com

traefik:
  url: https://traefik.example.com

cloudflare:
  email: mail@example.com
  apiKey: abc
Full Config File
---
rootDomain: example.com

ipProviders:
  - https://ifconfig.me/ip
  - https://ipecho.net/plain
  - https://myip.is/ip

notifications:
  slack:
    webhookURL: https://hooks.slack.com/services/abc/def
    username: SyncFlaer
    channel: "#syncflaer"
    iconURL: https://url.to/image.png

traefik:
  url: https://traefik.example.com
  username: admin
  password: supersecure
  ignoredRules:
    - local.example.com
    - dev.example.com

additionalRecords:
  - name: vpn.example.com
    ttl: 120
  - name: a.example.com
    proxied: true
    type: A
    contents: 1.1.1.1

cloudflare:
  email: mail@example.com
  apiKey: abc
  defaults:
    type: CNAME
    proxied: true
    ttl: 1
Environment Variables

Note: Environment variables have a higher precedence than the config file!

The following environment variables are configurable:

Name Description
SLACK_WEBHOOK Slack Webhook URL
TRAEFIK_PASSWORD Password for Traefik dashboard (HTTP basic auth)
CLOUDFLARE_APIKEY Cloudflare API key
Defaults

If not specified, the following config applies:

Name Default Value
ipProviders ["https://ifconfig.me/ip", "https://ipecho.net/plain", "https://myip.is/ip"]
cloudflare.defaults.type CNAME
cloudflare.defaults.proxied false
cloudflare.defaults.ttl 1
notifications.slack.username SyncFlaer
notifications.slack.iconURL https://www.cloudflare.com/img/cf-facebook-card.png
Additional Records

You can specify additional DNS records that are not configured as a Traefik host.

A Record
Key Example Default Value Required
name a.example.com none yes
type A cloudflare.defaults.type no
ttl 1 cloudflare.defaults.ttl no
content 1.1.1.1 current public IP no
proxied true false no
CNAME Record
Key Example Default Value Required
name vpn.example.com none yes
type CNAME cloudflare.defaults.type no
ttl 120 cloudflare.defaults.ttl no
content mysite.com rootDomain no
proxied false false no

2021 Containeroo

Cloudflare and the Cloudflare Logo are registred trademarks owned by Cloudflare Inc. This project is not affiliated with Cloudflare®.

License

GNU GPLv3

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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