DDNS scripts for tencent cloud
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.
- Container runtime(docker, podman, etc.)
- An existing DNS record corresponding to the subdomain in this context(for example, in
www.google.com, the DOMAIN isgoogle.com, the SUBDOMAIN iswww) - Active secret id and secret key that has the correct permission
For a first-time user with a domain already purchased, do the following:
- create a sub-user with Read/Write permission of all the Web resources and get the secret ID and secret key.
- run
signature.pywith theTC3_DNSPOD_DOMAIN,TC3_DNSPOD_SUB_DOMAIN,TC3_SECRET_ID,TC3_SECRET_KEYset through the env variables
TC3_SECRET_IDis secret id, required, from cam user detailTC3_SECRET_KEYis secret key, required, from cam user detailTC3_DNSPOD_DOMAINis your domain(for example, inwww.google.com, the DOMAIN isgoogle.com, the SUBDOMAIN iswww), required,TC3_DNSPOD_SUB_DOMAINis your subdomain(for example, inwww.google.com, the DOMAIN isgoogle.com, the SUBDOMAIN iswww), required,ENABLE_PROXYis the flag to enable http proxy, and default value isFalse, optional,HTTP_PROXYis http proxy url configuration, whenENABLE_PROXYisFalse, this configuration will be ignored, optionalHTTPS_PROXYis https proxy url configuration, whenENABLE_PROXYisFalse, this configuration will be ignored, optionalAUTO_ADD_SUB_DOMAINis the flag to enable auto add record when SUBDOMAIN not exists, default value isTrue, optionalSLEEP_SECSis the interval parameter, unit is second, default value is60, optional
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