Giter VIP home page Giter VIP logo

greateme_ddns's Introduction

Golang对接阿里云域名DDNS的项目

环境要求

需要 golang 1.21.* 的环境,推荐使用 golang 1.21.9 版本,各个操作系统的该版本号下载地址:

设置国内golang代理

go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct

安装项目依赖

go mod tidy

编译代码

注意在Windows下编译的代码只能在Windows下执行,如果需要在Linux下运行则需要在Linux下从新编译,Windows下编译生成的是.exe可执行文件。执行以下代码进行编译(windows下需要安装git并且用git bash执行):

./build.sh

执行完成后会在项目 bin 录地下出现一个可执行文件,文件名各个系统不一样:

  • Windows: greateme_ddns.exe
  • Linux/MacOS: greateme_ddns

同时会在 bin/conf 目录下生成一个 config.ini 配置文件,我们需要修改一下这个配置文件:

  • accessKeyId: 改为阿里云的 accessKey
  • accessKeySecret: 改为阿里云的 accessKeySecret
  • domainEndpoint: 查询域名的Endpoint,默认为杭州,无需修改
  • dnsEndpoint: DNS的Endpoint,默认为深圳,可根据配置文件当中注释和地理位置进行修改
  • domainList: 域名列表,多个用逗号隔开
  • dnsType: 解析类型,只能填写 ipv4 和 ipv6,默认为ipv4(注意全部小写且不能为大写)
  • durationMinute: 时隔多久更新一次(单位为分钟),默认为十分钟,可无需修改

执行代码

可直接在bin目录下执行可执行文件即可

greateme_ddns's People

Contributors

xiaohh-me 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.