Giter Site home page Giter Site logo

qetesh / go-simple-ddns-tencent Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 40 KB

学习golang后的第一个程序,致力于用最简单直接的代码实现。通过cloudflare接口获取当前网络环境IPv4、IPv6,并更新腾讯云SDK添加或更新DNS记录,实现DNSPOD、腾讯云DDNS。

License: Apache License 2.0

Go 94.67% Dockerfile 5.33%
ddns tencent-cloud golang dns dnspod

go-simple-ddns-tencent's Introduction

go-simple-ddns-tencent

学习golang后的第一个程序,致力于用最简单直接的代码实现。 通过cloudflare接口获取当前网络环境IPv4、IPv6,并通过腾讯云SDK添加或更新DNS记录,实现腾讯云DDNS。

腾讯云接口 cloudflare获取IP接口,如果使用cloudflare warp,会导致地址错误

功能

  • DNS服务商:

    • 腾讯云、DNSPOD(需腾讯云密钥)
  • 客户端平台:

    • Windows
    • Linux
    • macOS
  • IP协议栈:

    • IPv4
    • IPv6
  • 其他:

    • Golang强制使用IPv4
    • 自动添加、删除、更新IPv4与IPv6
    • 首先解析当前地址判断是否需要更新,防止无效更新API
    • 源码运行
    • github打tag后自动通过Action生成二进制,推送到release
    • 启动后定时每10分钟运行一次
    • TTL设置
    • 日志
    • 设置系统服务
    • Docker
    • 通知(邮箱、PushDeer)

Quick start

  • 源码运行
  • 二进制运行
    • 根据平台下载releases对应二进制,配置配置文件或环境变量运行
  • 容器运行

使用Dockerfile生成镜像,并指定环境变量运行,默认架构为amd64,通过Dockerfile指定架构运行。

由于默认docker不支持IPv6,所以需要使用host模式。

资源占用如下图,大约5MB内存左右,定时600秒检测更新一次。 img.png

  • 运行格式:docker build -t go-simple-ddns-tencent . && docker run --env secretid=<secretid> --env secretkey=<secretkey> --env configDomain=<域名> --env configSubdomain=<子域名> --env enableIPv6=<true 或 false> --name go-simple-ddns-tencent --net host go-simple-ddns-tencent
  • 举例:docker build -t go-simple-ddns-tencent . && docker run --env secretid=AKID****** --env secretkey=***** --env configDomain=domain.com --env configSubdomain=www --env enableIPv6=true --name go-simple-ddns-tencent --net host go-simple-ddns-tencent

go-simple-ddns-tencent's People

Contributors

qetesh avatar

Stargazers

 avatar  avatar

Watchers

 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.