Coder Social home page Coder Social logo

rogelio-o / ddns-aws Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 3.11 MB

Dynamic DNS with AWS stack. Update Route53 domain with current router IP.

License: MIT License

TypeScript 36.04% JavaScript 12.44% Shell 31.42% Dockerfile 5.89% Makefile 14.21%

ddns-aws's Introduction

ddns-aws

This is a DDNS (Dynamic DNS) tool to update your domain with your router current IP. The project has two components:

  • The server, which gets the IP from headers, check if it has changed (based on last_ip query parameter) and set the Route53 domain record pointing to the IP.
  • The client, which periodically calls the server with the last_ip query parameter and set it with the response.

How to use it?

Server deployment

The server is a AWS lambda function created with serverless framework. To deploy it some env variables should be set and then the deploy command should be run:

cd lambda
export HOSTED_ZONE_ID=<YOUR HOSTED ZONE ID>
export RECORD_NAME=<YOUR RECORD NAME: foo.example.com>
serverless deploy --stage pro --env production

WARNING: AWS user has to be logged-in on the system and the user need the required permissions to deploy with serverless framework.

The result of the deploy command will return a URL and an API key that should be saved to configure the client.

Client configuration

The client is a bash script. Additional files are provided to configure systemctl service and timer. The client could be configured in something like a Raspberry PI that is always running.

Follow the next steps to configure the client:

  • Replace <API_KEY> and <URL> from client/ddns-aws-client.service.
  • Move client/ddns-aws-client.sh to /usr/bin/.
  • Move client/ddns-aws-client.service and client/ddns-aws-client.timer to /etc/systemd/system/.
  • sudo systemctl disable ddns-aws-client
  • sudo systemctl enable ddns-aws-client.timer

It can be checked that the timer is running with command: sudo systemctl status ddns-aws-client.

Docker

Run client executing the following command:

docker run rogelioo/ddns-aws-client:latest -v /tmp/ddns_cache/:/tmp/ddns_cache/ --api-key <API_KEY> --url <URL>

Docker

Replace <API_URL> from client/k8s.yaml, create PVC ddns-aws-client with 500Ki, and run the following command:

kubectl apply -f client/k8s.yaml

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.