Giter Site home page Giter Site logo

cf-failover's Introduction

CF-Failover

Using the Cloudflare API to change DNS records to maximize uptime

Usage/Examples

api-failover -c config.json

Configure

The configure file is a JSON array file with each domain group in the following pattern:

  {
    "primary": ["ip1", "ip2", "ip3..."],
    "backup": ["backip1", "backip2..."],
    "method": "tcp", // "tcp", "ping" are the methods currently supported
    "record": "your.domain.com",
    "param": "80",  // not used for ping, port number for tcp
    "token": "cloudflare token",
    "zoneid": "cloudflare zone id",
    "interval": 10  // health check interval
  }

Pinging on Linux

In some cases, an error may be thrown when the program attempts to ping the specified hosts. The simplest way to alleviate this is to run the program as root or in Docker.
For more information, check the Linux section in the pro-bing README

Precompiled releases

Precompiled releases are build automatically by Github Actions and can be downloaded from the releases page
After downloading for the appropriate platform, the program can be run directly

Compiling locally

In order to compile locally, Go must be installed

git clone https://github.com/snowie2000/cf-failover/
cd api-failover
go install

Credit

Originally created by https://github.com/slashtechno/api-failover

TcpPing implemented by https://github.com/cloverstd/tcping

cf-failover's People

Contributors

slashtechno avatar dependabot[bot] avatar deepsource-autofix[bot] avatar deepsourcebot avatar snowie2000 avatar deepsource-io[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.