Git Product home page Git Product logo

cloudflare-ddns's Introduction

cloudflare-ddns

Purpose

The original goal was to create a simple Nodejs client that updates a Cloudflare DNS entry to the client's public IP, much like DDNS. The new goal is to create a Python equivalent offering a server mode mimicking the same response as Cloudflare's trace service.

Nodejs

Node client to updates DNS entry in Cloudflare

Install

git clone https://github.com/jhfoo/cloudflare-ddns.git

Usage

npm start <host.domain.name> <cloudflare api token>

API Token Config

Create a token with the following permission:

  • Zone -> DNS -> Edit

What it does

  1. Check if zone is managed by the token.
  2. Get IP as reported by Cloudflare trace tool.
  3. Create/ update host.domain.name with IP.

Python (WIP)

Install

git clone https://github.com/jhfoo/cloudflare-ddns.git
cd cloudflare-ddns/python
./bin/setup

Usage

Help

cd cloudflare-ddns/python
./bin/cloudflare-ddns -h

Client mode

cd cloudflare-ddns/python
./bin/cloudflare-ddns client <hostname> <api token>

Alternatively the API token can be read from the environment variable CLOUDFLARE_TOKEN. If token is passed in the CLI it supercedes the environment variable.

Server mode

cd cloudflare-ddns/python
./bin/cloudflare-ddns server [<port>] [--dev|-d]

--dev runs server in development mode which means the server does not exit upon shutdown.

The following paths are valid:

/shutdown      # stops the service
/cdn-cgi/trace # mimicks the same path as Cloudflare
/              # same as above: for lazy people

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.