Skip to content

Jasecharloote/auto-ddns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

auto-ddns

DDNS scripts for tencent cloud

Author

Jasecharloote

Dockerhub link

auto-ddns

Goal

update DNS record automatically from the server. The record is updated every minute.

Combined with the restart policy of docker, the script keeps running as long as the docker service is active.

Tencent Cloud API version

  1. Signature API version is V3
  2. DNSPod version is 2021-03-23

Requirements

  1. Container runtime(docker, podman, etc.)
  2. An existing DNS record corresponding to the subdomain in this context(for example, in www.google.com, the DOMAIN is google.com, the SUBDOMAIN is www)
  3. Active secret id and secret key that has the correct permission

Usage

For a first-time user with a domain already purchased, do the following:

  1. create a sub-user with Read/Write permission of all the Web resources and get the secret ID and secret key.
  2. run signature.py with the TC3_DNSPOD_DOMAIN, TC3_DNSPOD_SUB_DOMAIN, TC3_SECRET_ID, TC3_SECRET_KEY set through the env variables

Environment variables

  • TC3_SECRET_ID is secret id, required, from cam user detail
  • TC3_SECRET_KEY is secret key, required, from cam user detail
  • TC3_DNSPOD_DOMAIN is your domain(for example, in www.google.com, the DOMAIN is google.com, the SUBDOMAIN is www), required,
  • TC3_DNSPOD_SUB_DOMAIN is your subdomain(for example, in www.google.com, the DOMAIN is google.com, the SUBDOMAIN is www), required,
  • ENABLE_PROXY is the flag to enable http proxy, and default value is False, optional,
  • HTTP_PROXY is http proxy url configuration, when ENABLE_PROXY is False, this configuration will be ignored, optional
  • HTTPS_PROXY is https proxy url configuration, when ENABLE_PROXY is False, this configuration will be ignored, optional
  • AUTO_ADD_SUB_DOMAIN is the flag to enable auto add record when SUBDOMAIN not exists, default value is True, optional
  • SLEEP_SECS is the interval parameter, unit is second, default value is 60, optional

Command

The following steps must be run every time this container is manually started:

docker run -e TC3_DNSPOD_DOMAIN=<TC3_DNSPOD_SUB_DOMAIN> -e TC3_DNSPOD_SUB_DOMAIN=<TC3_DNSPOD_SUB_DOMAIN> -e TC3_SECRET_ID=<TC3_SECRET_ID> -e TC3_SECRET_KEY=<TC3_SECRET_KEY> -d --restart always --name auto-ddns jasecharloote/auto-ddns:slim

About

auto-ddns

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors