Code Monkey home page Code Monkey logo

gocloud's Introduction

gocloud

This aims to obe a quick way to setup and then keep your dyanmic ip updated on Cloudflare through the use of their API.

I wrote this as kind of a intro to Go and becuase I needed a way to keep my Cloudflare records up to day with my dynamic ip. Homelab stuff.

Usage:

gocloud [--debug]

Flags:

--debug Writes a LOT of spammy messages to stdout, this does help with finding issues

Config

This does require a config.yml file to be placed in the same directory as the main exeacutable. I've included an example file, config.example.yml you can make a copy of this and remove the .example part from the name.const

Be sure to read the comments in there it's fairly self explnitory. The gist of it is you need your Cloudflare email, and Global API Key as well some zones you want to make sure are up to date.

How

How does it work? Well it loops through your list of zones (defined in config.yml) and calls the Cloudflare API to then fetch a list of all "A" records for this DNS Zone.

We then iterate over these records looking for a matching name (again in your config.yml) if a name is matcched and IP set in this type "A" record is different than your external IP (or IP set in config.yml) we set it to match. If the name is not matched OR the IP already matches we don't do anything.

gocloud's People

Contributors

jnewing avatar

Stargazers

Sean O'Donnell 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.