Giter VIP home page Giter VIP logo

namecheap-ddns-docker's Introduction

Hi there, I'm Navratan Lal Gupta ๐Ÿ‘‹

Website LinkedIn

I'm a DevOps Engineer, Developer and a Linux Enthusiast !

  • โค๏ธ Linux and ๐Ÿค Open Source Projects
  • ๐Ÿ”ญ Follow me on Medium for technical articles - Linux Shots.
  • ๐Ÿ‘ฏ Iโ€™m looking to contribute to Open Source projects.
  • โšก I love teaching, travelling, binge-coding and watching movies.
  • ๐Ÿฅ… 2024 Goals: Get certified as CKS.

๐Ÿค Connect with me:

GitHub Linux Shots | Medium Tech Blog Navratan Gupta | Twitter Navratan Gupta | LinkedIn


๐Ÿฅ‡ Certifications and Badges

CKA: Certified Kubernetes Administrator

SAA-C02: AWS Certified Solution Architect - Associate




โš™๏ธ Languages and Tools:

BASH Python Golang Docker Git Kubernetes Terraform Helm

GitLab Ansible Jenkins AWS Azure GCP




โšก Github Stats

navilg's Github Stats










navilg's top languages










๐Ÿ•ฎ Latest Tech articles

โžก๏ธ more articles...




"Buy Me A Coffee"

namecheap-ddns-docker's People

Contributors

navilg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

namecheap-ddns-docker's Issues

Wrong requests contain error message and return status code 200

I've noticed the following code:

// req.Header.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*")
	// req.Header.Add("Accept-Encoding", "gzip, deflate, br")
	// req.Header.Add("Connection", "keep-alive")

	response, err := apiclient.Do(req)
	if err != nil {
		// fmt.Println(2, err.Error())
		return err
	}

	defer response.Body.Close()

	if response.StatusCode != 200 {
		return &CustomError{ErrorCode: response.StatusCode, Err: errors.New(response.Status)}
	}

It expects to have a HTTP status different than 200 when having an error. Yet, that's not the case. They are sending a XML payload with the error under 200.

<?xml version="1.0" encoding="utf-16"?>
<interface-response>
  <Command>SETDNSHOST</Command>
  <Language>eng</Language>
  <ErrCount>1</ErrCount>
  <errors>
    <Err1>Passwords do not match</Err1>
  </errors>
  <ResponseCount>1</ResponseCount>
  <responses>
    <response>
      <Description>Passwords do not match</Description>
      <ResponseNumber>304156</ResponseNumber>
      <ResponseString>Validation error; invalid ; password</ResponseString>
    </response>
  </responses>
  <Done>true</Done>
  <debug><![CDATA[]]></debug>
</interface-response>

Being able to parse this would help logging.

Timeout the pubIp env variable set in container

Currently when IP address is set in namecheap, ncddns sets an env variable in current container so that it can compare the next time with current public IP. It prints the message "DNS record is same as current IP" if current public IP and env variable set is same.

This may not work if someone changes the IP address of a dns from namecheap dashboard unless container is restarted again. To avoid this, We can have a timeout set for env variable set, after which it should be wiped out so that fresh attempt to add ip address is made by ncddns.

Feature request: Multiple hosts

I have a few subdomains all pointing to my homelab. It would be useful if I could provide multiple hosts, and update them all at once.

For example:

docker run --name server.example.com -d --restart unless-stopped -e NC_HOST='server,another,third' -e NC_DOMAIN='example.com' -e NC_PASS='DynamicDDNSPa2w0rd' linuxshots/namecheap-ddns

and the expected result is that server.example.com, another.example.com and third.example.com should now point to my current IP. My workaround for now is to run 5-6 copies, but this calls getPubIP more than necessary.

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.