Git Product home page Git Product logo

dynamic-cloud-dns's Introduction

Dynamic Cloud DNS

Dynamic DNS functionality backed by Google Cloud DNS hosted on Google Cloud Functions. The deployed function can be called with the host, IPv4 and IPv6 address to update. The data can be either URL query parameters or a JSON body.

curl https://us-central1-<project-name>.cloudfunctions.net/updateHost?token=<secretToken>&host=test.example.com&ipv4=192.168.1.1&ipv6=::1
curl https://us-central1-<project-name>.cloudfunctions.net/updateHost \
    -d '{ \
            token: "<secretToken>" \
            host: "test.example.com" \
            ipv4: "192.168.1.1" \
            ipv6: "::1" \
        }'

If neither an IPv4 nor an IPv6 address is provided, the source address of the request is used.

Configuration

Settings are stored in settings.json

Config Description
dnsZone The Google Cloud DNS Zone name in which the records reside.
secretToken A secret token, used to authenticate users.
allowedHosts A list of hosts that callers are allowed to update. May include "*" to allow all hosts.
ttl Time to live for records in seconds.

To be able to authenticate against the Google Cloud DNS API, an environment variable GOOGLE_APPLICATION_CREDENTIALS must be set, which points to a valid credentials.json. The Google Cloud project name is read from the env var GCLOUD_PROJECT.

Local Development

  • nvm use
  • npm install
  • Setup your Gcloud credentials: export GOOGLE_APPLICATION_CREDENTIALS=/Path/to/your/credentials.json
  • To start the emulator in the background: npm start &
  • Send requests to the emulator: curl localhost:8080?token=<secretToken>&host=test.example.com&ipv4=192.168.1.1&ipv6=::1

See docs for further info.

Deploy to Google Cloud Functions

Client

If you want to call this automatically under Linux, you can try Dynamic Cloud DNS Client

License

Copyright (c) 2020, Simon Rüegg. All rights reserved.

Dynamic Cloud DNS is licensed under the MIT License.

See LICENSE for more details.

dynamic-cloud-dns's People

Contributors

crazystick avatar dependabot[bot] avatar fysac avatar renovate-bot avatar srueg 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.