Code Monkey home page Code Monkey logo

aws-ddns's Introduction

AWS DDNS

Using AWS API Gateway and Lambda functions, create a DDNS provider for personal use.

This application is very minimum! It only has two endpoints. One is to create users to be authenticated with and the other is the actual endpoint routers can hit.

Tools needed

Deploy

To deploy this serverless application you will need to setup AWS Credentials (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html)

After that is setup you can install as many stages as you want.

The following will deploy to the dev stage. This stage is useful for testing out changes.

sls deploy --conceal #hide the secret api key from output

The following will deploy to the prod stage. I use this stage for the final API that is used by my router.

sls deploy -s prod --conceal #hide the secret api key from output

Getting the settings

After everything is deployed, you can go through the AWS console and setup custom domains and retrieve the API key used for the Create User endpoint.

Usage

POST /user

Creates a user that can be used to authenticate with.

You will need the following headers set:

  • Content-Type: application/json
  • x-api-key: <KEY> - The key can be found in the API Gateway portion of AWS console. This is the Admin key and with it, users can be created. So don't share it.

The following is an example body:

  • username - cannot contain a colon (:) and be greater than 7 characters
  • password - greater than 7 characters
{
    "username": "someuser",
    "password": "awesomePass",
    "domains": [
        "home.domain.com"
    ]
}

GET /nic/update

This endpoint is what routers should hit. It is roughtly based on this https://help.dyn.com/remote-access-api/perform-update/. I do not follow it completley but this could be made to follow it more closely if desired.

For my case I did not need to follow it completley so only used it as a guide

This endpoint requires just the Authorization header with a value in Basic auth format.

Query parameters are needed

  • hostname - comma seperated list of hostnames to update
    • you can supply multiple hostname parameters instead
    • cannot have a duplicate entry
  • myip - expects to be the IPv4 to update the record to

aws-ddns's People

Contributors

dependabot[bot] avatar dixonwille avatar

Stargazers

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