GithubHelp home page GithubHelp logo

glared's Introduction

Automatically update the A record of your cloudflare domains with your public IPv4 address

  • Gets the external/public IPv4 Address
  • Uses the config.yaml to get the auth email, cloudflare token and list of domains
  • Updates each domain's A record with the public IPv4 address
  • Supports domains and subdomains, i.e. if you want to update the domain only, set the domain and name to the same value in the config.
  • If you want to update only a subdomain and not the domain, set the name and domain to a different value, i.e. if your domain is "example.com" and you want to udpate "subdomain.example.com" set the latter as name and the former as domain in the config.yaml

Same config.yaml

domains:
  - domain: "example0.com"
    name: "example0.com"
    zone: "14188253e4f00003d5d45e03pp0ppp23"
    proxied: false
  - domain: "example1.com"
    subdomain: "example1"
    zone: "14188253e4f00003d5d45e03pp0ppp23"
    proxied: false
  - domain: "example2.com"
    name: "example2"
    zone: "14188253e4f00003d5d45e03pp0ppp23"
    proxied: false
  - domain: "example3.com"
    name: "example3"
    zone: "14188253e4f00003d5d45e03pp0ppp23"
    proxied: false
auth:
  key: "14188253e4f00003d5d45e03pp0ppp23"
  email: "[email protected]"

Usage:

go build && ./glared

Should print something like

2023/07/21 12:33:31 IPV4 address hasn't changed, 200.22.20.15 = 200.22.20.15 in example0.com
2023/07/21 12:33:31 IPV4 address hasn't changed, 200.22.20.15 = 200.22.20.15 in example1.example1.com
2023/07/21 12:33:32 IPV4 address hasn't changed, 200.22.20.15 = 200.22.20.15 in example2.example2.com

Motivation: I have a dynamic IP address at home and every time the electricity goes out (used too much power), I have to manually update the A records of all domains hosted at home with cloudflare.

glared's People

Contributors

octohedron avatar

Watchers

 avatar  avatar  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.