From 726e8bf98cc9fccabdd222fadc059aa19a848067 Mon Sep 17 00:00:00 2001 From: okxlin Date: Mon, 7 Oct 2024 14:20:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E8=B0=83=E6=95=B4ddns-go?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ddns-go/6.7.0/4.5.9/data.yml | 17 -- apps/ddns-go/6.7.0/4.5.9/docker-compose.yml | 10 - apps/ddns-go/6.7.0/data.yml | 32 +- apps/ddns-go/6.7.0/docker-compose.yml | 2 +- apps/ddns-go/README.md | 274 +----------------- apps/ddns-go/data.yml | 5 +- .../4.5.9 => latest-bridge}/.env.sample | 0 apps/ddns-go/latest-bridge/data.yml | 17 ++ apps/ddns-go/latest-bridge/docker-compose.yml | 17 ++ apps/ddns-go/latest/data.yml | 32 +- apps/ddns-go/latest/docker-compose.yml | 2 +- 11 files changed, 71 insertions(+), 337 deletions(-) delete mode 100644 apps/ddns-go/6.7.0/4.5.9/data.yml delete mode 100644 apps/ddns-go/6.7.0/4.5.9/docker-compose.yml rename apps/ddns-go/{6.7.0/4.5.9 => latest-bridge}/.env.sample (100%) create mode 100644 apps/ddns-go/latest-bridge/data.yml create mode 100644 apps/ddns-go/latest-bridge/docker-compose.yml diff --git a/apps/ddns-go/6.7.0/4.5.9/data.yml b/apps/ddns-go/6.7.0/4.5.9/data.yml deleted file mode 100644 index e47981d1..00000000 --- a/apps/ddns-go/6.7.0/4.5.9/data.yml +++ /dev/null @@ -1,17 +0,0 @@ -additionalProperties: - formFields: - - default: 9876 - edit: true - envKey: PANEL_APP_PORT_HTTP - labelEn: WebUI Port - labelZh: 网页端口 - required: true - rule: paramPort - type: number - - default: ./data - edit: true - envKey: DATA_PATH - labelEn: Data folder path - labelZh: 数据文件夹路径 - required: true - type: text \ No newline at end of file diff --git a/apps/ddns-go/6.7.0/4.5.9/docker-compose.yml b/apps/ddns-go/6.7.0/4.5.9/docker-compose.yml deleted file mode 100644 index 441a925a..00000000 --- a/apps/ddns-go/6.7.0/4.5.9/docker-compose.yml +++ /dev/null @@ -1,10 +0,0 @@ -services: - ddns-go: - container_name: ${CONTAINER_NAME} - restart: always - network_mode: "host" - volumes: - - "${DATA_PATH}:/root" - image: jeessy/ddns-go:v6.7.0 - labels: - createdBy: "Apps" diff --git a/apps/ddns-go/6.7.0/data.yml b/apps/ddns-go/6.7.0/data.yml index e47981d1..8554c42e 100644 --- a/apps/ddns-go/6.7.0/data.yml +++ b/apps/ddns-go/6.7.0/data.yml @@ -1,17 +1,17 @@ additionalProperties: - formFields: - - default: 9876 - edit: true - envKey: PANEL_APP_PORT_HTTP - labelEn: WebUI Port - labelZh: 网页端口 - required: true - rule: paramPort - type: number - - default: ./data - edit: true - envKey: DATA_PATH - labelEn: Data folder path - labelZh: 数据文件夹路径 - required: true - type: text \ No newline at end of file + formFields: + - default: "9876" + edit: true + envKey: PANEL_APP_PORT_HTTP + labelEn: Port + labelZh: 端口 + required: true + rule: paramPort + type: number + - default: "./data" + disabled: true + envKey: DATA_PATH + labelEn: Data Path + labelZh: 数据路径 + required: true + type: text \ No newline at end of file diff --git a/apps/ddns-go/6.7.0/docker-compose.yml b/apps/ddns-go/6.7.0/docker-compose.yml index 441a925a..ed4bc0d7 100644 --- a/apps/ddns-go/6.7.0/docker-compose.yml +++ b/apps/ddns-go/6.7.0/docker-compose.yml @@ -6,5 +6,5 @@ services: volumes: - "${DATA_PATH}:/root" image: jeessy/ddns-go:v6.7.0 - labels: + labels: createdBy: "Apps" diff --git a/apps/ddns-go/README.md b/apps/ddns-go/README.md index 6eccefbd..72c53a15 100644 --- a/apps/ddns-go/README.md +++ b/apps/ddns-go/README.md @@ -1,277 +1,5 @@ -# 使用说明 - -默认以`--net=host`网络模式运行,方便获取`IPV6`地址,默认管理界面端口`9876` - -如果因为端口冲突,需要以桥接网络模式运行,不需要获取`IPV6`,请将原始`docker-compose.yml`做修改, - -> 已经保留了面板设置桥接模式端口的设置,有需要的直接粘贴覆盖原`docker-compose.yml`文件里的内容,重建应用即可。 - -- `--net=host`网络模式设置 -``` - network_mode: "host" -``` - -- 桥接网络模式 -``` - networks: - - 1panel-network - ports: - - "${PANEL_APP_PORT_HTTP}:9876" -``` - - -完整桥接网络模式配置如下 -``` -version: "3" -services: - ddns-go: - container_name: ${CONTAINER_NAME} - restart: always - networks: - - 1panel-network - ports: - - "${PANEL_APP_PORT_HTTP}:9876" - volumes: - - "${DATA_PATH}:/root" - image: jeessy/ddns-go:v5.3.7 - labels: - createdBy: "Apps" - -networks: - 1panel-network: - external: true -``` - - -# 原始相关 - # ddns-go -[![GitHub release](https://img.shields.io/github/release/jeessy2/ddns-go.svg?logo=github&style=flat-square) ![GitHub release downloads](https://img.shields.io/github/downloads/jeessy2/ddns-go/total?logo=github)](https://github.com/jeessy2/ddns-go/releases/latest) [![Go version](https://img.shields.io/github/go-mod/go-version/jeessy2/ddns-go)](https://github.com/jeessy2/ddns-go/blob/master/go.mod) [![](https://goreportcard.com/badge/github.com/jeessy2/ddns-go/v5)](https://goreportcard.com/report/github.com/jeessy2/ddns-go/v5) [![](https://img.shields.io/docker/image-size/jeessy/ddns-go)](https://registry.hub.docker.com/r/jeessy/ddns-go) [![](https://img.shields.io/docker/pulls/jeessy/ddns-go)](https://registry.hub.docker.com/r/jeessy/ddns-go) +中文 | [English](https://github.com/jeessy2/ddns-go/blob/master/README_EN.md) 自动获得你的公网 IPv4 或 IPv6 地址,并解析到对应的域名服务。 - -- [使用说明](#使用说明) -- [原始相关](#原始相关) -- [ddns-go](#ddns-go) - - [特性](#特性) - - [系统中使用](#系统中使用) - - [Docker中使用](#docker中使用) - - [使用IPv6](#使用ipv6) - - [Webhook](#webhook) - - [Callback](#callback) - - [界面](#界面) - - [开发\&自行编译](#开发自行编译) - -## 特性 - -- 支持Mac、Windows、Linux系统,支持ARM、x86架构 -- 支持的域名服务商 `Alidns(阿里云)` `Dnspod(腾讯云)` `Cloudflare` `华为云` `Callback` `百度云` `Porkbun` `GoDaddy` `Google Domain` -- 支持接口/网卡/[命令](https://github.com/jeessy2/ddns-go/wiki/通过命令获取IP参考)获取IP -- 支持以服务的方式运行 -- 默认间隔5分钟同步一次 -- 支持同时配置多个DNS服务商 -- 支持多个域名同时解析 -- 支持多级域名 -- 网页中配置,简单又方便,默认勾选`禁止从公网访问` -- 网页中方便快速查看最近50条日志 -- 支持Webhook通知 -- 支持TTL -- 支持部分DNS服务商[传递自定义参数](https://github.com/jeessy2/ddns-go/wiki/传递自定义参数),实现地域解析等功能 - -> **Note** 建议在启用公网访问时,使用 Nginx 等反向代理软件启用 HTTPS 访问,以保证安全性。[FAQ](https://github.com/jeessy2/ddns-go/wiki/FAQ) - -## 系统中使用 - -- 从 [Releases](https://github.com/jeessy2/ddns-go/releases) 下载并解压 ddns-go -- 双击运行, 如没有找到配置, 程序将自动打开 http://127.0.0.1:9876 -- [可选] 安装服务 - - Mac/Linux: `sudo ./ddns-go -s install` - - Win(以管理员打开cmd): `.\ddns-go.exe -s install` -- [可选] 服务卸载 - - Mac/Linux: `sudo ./ddns-go -s uninstall` - - Win(以管理员打开cmd): `.\ddns-go.exe -s uninstall` -- [可选] 支持安装或启动时带参数 `-l`监听地址 `-f`同步间隔时间(秒) `-c`自定义配置文件路径 `-noweb`不启动web服务 `-skipVerify`跳过证书验证。如:`./ddns-go -s install -l :9877 -f 600 -c /Users/name/ddns-go.yaml` - -## Docker中使用 - -- 挂载主机目录, 使用docker host模式。可把 `/opt/ddns-go` 替换为你主机任意目录, 配置文件为隐藏文件 - - ```bash - docker run -d --name ddns-go --restart=always --net=host -v /opt/ddns-go:/root jeessy/ddns-go - ``` - -- 在浏览器中打开`http://主机IP:9876`,修改你的配置,成功 - -- [可选] 使用 `ghcr.io` 镜像 - - ```bash - docker run -d --name ddns-go --restart=always --net=host -v /opt/ddns-go:/root ghcr.io/jeessy2/ddns-go - ``` - -- [可选] 支持启动带参数 `-l`监听地址 `-f`间隔时间(秒) - - ```bash - docker run -d --name ddns-go --restart=always --net=host -v /opt/ddns-go:/root jeessy/ddns-go -l :9877 -f 600 - ``` - -- [可选] 不使用docker host模式 - - ```bash - docker run -d --name ddns-go --restart=always -p 9876:9876 -v /opt/ddns-go:/root jeessy/ddns-go - ``` - -## 使用IPv6 - -- 前提:你的电脑或终端能正常获取IPv6,并能正常访问IPv6 -- Windows/Mac:推荐 [系统中使用](#系统中使用),Windows/Mac桌面版的docker不支持`--net=host` -- 群晖: - - 套件中心下载docker并打开 - - 注册表中搜索`ddns-go`并下载 - - 映像 -> 选择`jeessy/ddns-go` -> 启动 -> 高级设置 -> 网络中勾选`使用与 Docker Host 相同的网络`,高级设置中勾选`启动自动重新启动` - - 在浏览器中打开`http://群晖IP:9876`,修改你的配置,成功 -- Linux的x86或arm架构,推荐使用Docker的`--net=host`模式。参考 [Docker中使用](#Docker中使用) -- 虚拟机中使用有可能正常获取IPv6,但不能正常访问IPv6 - -## Webhook - -- 支持webhook, 域名更新成功或不成功时, 会回调填写的URL -- 支持的变量 - - | 变量名 | 说明 | - | ---- | ---- | - | #{ipv4Addr} | 新的IPv4地址 | - | #{ipv4Result} | IPv4地址更新结果: `未改变` `失败` `成功`| - | #{ipv4Domains} | IPv4的域名,多个以`,`分割 | - | #{ipv6Addr} | 新的IPv6地址 | - | #{ipv6Result} | IPv6地址更新结果: `未改变` `失败` `成功`| - | #{ipv6Domains} | IPv6的域名,多个以`,`分割 | - -- 如 RequestBody 为空则为 GET 请求,否则为 POST 请求 --
Server酱 - - ``` - https://sctapi.ftqq.com/[SendKey].send?title=你的公网IP变了&desp=主人IPv4变了#{ipv4Addr},域名更新结果:#{ipv4Result} - ``` --
Bark - - ``` - https://api.day.app/[YOUR_KEY]/主人IPv4变了#{ipv4Addr},域名更新结果:#{ipv4Result} - ``` -
--
钉钉 - - - 钉钉电脑端 -> 群设置 -> 智能群助手 -> 添加机器人 -> 自定义 - - 只勾选 `自定义关键词`, 输入的关键字必须包含在RequestBody的content中, 如:`你的公网IP变了` - - URL中输入钉钉给你的 `Webhook地址` - - RequestBody中输入 - ```json - { - "msgtype": "markdown", - "markdown": { - "title": "你的公网IP变了", - "text": "#### 你的公网IP变了 \n - IPv4地址:#{ipv4Addr} \n - 域名更新结果:#{ipv4Result} \n" - } - } - ``` -
--
飞书 - - - 飞书电脑端 -> 群设置 -> 添加机器人 -> 自定义机器人 - - 安全设置只勾选 `自定义关键词`, 输入的关键字必须包含在RequestBody的content中, 如:`你的公网IP变了` - - URL中输入飞书给你的 `Webhook地址` - - RequestBody中输入 - ```json - { - "msg_type": "post", - "content": { - "post": { - "zh_cn": { - "title": "你的公网IP变了", - "content": [ - [ - { - "tag": "text", - "text": "IPv4地址:#{ipv4Addr}" - } - ], - [ - { - "tag": "text", - "text": "域名更新结果:#{ipv4Result}" - } - ] - ] - } - } - } - } - ``` -
--
Telegram - - [ddns-telegram-bot](https://github.com/WingLim/ddns-telegram-bot) -
--
plusplus 推送加 - - - [获取token](https://www.pushplus.plus/push1.html) - - URL中输入 `https://www.pushplus.plus/send` - - RequestBody中输入 - ```json - { - "token": "your token", - "title": "你的公网IP变了", - "content": "你的公网IP变了 \n - IPv4地址:#{ipv4Addr} \n - 域名更新结果:#{ipv4Result} \n" - } - ``` -
--
Discord - - - Discord任意客户端 -> 伺服器 -> 频道设置 -> 整合 -> 查看Webhook -> 新Webhook -> 复制Webhook网址 - - URL中输入Discord复制的 `Webhook网址` - - RequestBody中输入 - ```json - { - "content": "域名 #{ipv4Domains} 动态解析 #{ipv4Result}.", - "embeds": [ - { - "description": "#{ipv4Domains} 的动态解析 #{ipv4Result}, IP: #{ipv4Addr}", - "color": 15258703, - "author": { - "name": "DDNS" - }, - "footer": { - "text": "DDNS #{ipv4Result}" - } - } - ] - } - ``` -
- -- [查看更多Webhook配置参考](https://github.com/jeessy2/ddns-go/issues/327) - -## Callback - -- 通过自定义回调可支持更多的第三方DNS服务商 -- 配置的域名有几行, 就会回调几次 -- 支持的变量 - - | 变量名 | 说明 | - | ---- | ---- | - | #{ip} | 新的IPv4/IPv6地址 | - | #{domain} | 当前域名 | - | #{recordType} | 记录类型 `A`或`AAAA` | - | #{ttl} | ttl | -- 如 RequestBody 为空则为 GET 请求,否则为 POST 请求 -- [Callback配置参考](https://github.com/jeessy2/ddns-go/wiki/Callback配置参考) - -## 界面 - -![screenshots](https://raw.githubusercontent.com/jeessy2/ddns-go/master/ddns-web.png) - -## 开发&自行编译 - -- 如果喜欢从源代码编译自己的版本,可以使用本项目提供的 Makefile 构建 -- 使用 `make build` 生成本地编译后的 `ddns-go` 可执行文件 -- 使用 `make build_docker_image` 自行编译 Docker 镜像 diff --git a/apps/ddns-go/data.yml b/apps/ddns-go/data.yml index ce1250a6..dc1a9b7a 100644 --- a/apps/ddns-go/data.yml +++ b/apps/ddns-go/data.yml @@ -1,8 +1,7 @@ name: ddns-go tags: - - 工具 + - 实用工具 title: 自动获得你的公网 IPv4 或 IPv6 地址,并解析到对应的域名服务 -type: 工具 description: 自动获得你的公网 IPv4 或 IPv6 地址,并解析到对应的域名服务 additionalProperties: key: ddns-go @@ -13,7 +12,7 @@ additionalProperties: shortDescEn: Automatically obtain your public IPv4 or IPv6 address and resolve it to the corresponding domain name service type: tool crossVersionUpdate: true - limit: 1 + limit: 0 recommend: 0 website: https://github.com/jeessy2/ddns-go github: https://github.com/jeessy2/ddns-go diff --git a/apps/ddns-go/6.7.0/4.5.9/.env.sample b/apps/ddns-go/latest-bridge/.env.sample similarity index 100% rename from apps/ddns-go/6.7.0/4.5.9/.env.sample rename to apps/ddns-go/latest-bridge/.env.sample diff --git a/apps/ddns-go/latest-bridge/data.yml b/apps/ddns-go/latest-bridge/data.yml new file mode 100644 index 00000000..ab54dea6 --- /dev/null +++ b/apps/ddns-go/latest-bridge/data.yml @@ -0,0 +1,17 @@ +additionalProperties: + formFields: + - default: "9876" + edit: true + envKey: PANEL_APP_PORT_HTTP + labelEn: Port + labelZh: 端口 + required: true + rule: paramPort + type: number + - default: "./data" + edit: true + envKey: DATA_PATH + labelEn: Data Path + labelZh: 数据路径 + required: true + type: text \ No newline at end of file diff --git a/apps/ddns-go/latest-bridge/docker-compose.yml b/apps/ddns-go/latest-bridge/docker-compose.yml new file mode 100644 index 00000000..763cbd48 --- /dev/null +++ b/apps/ddns-go/latest-bridge/docker-compose.yml @@ -0,0 +1,17 @@ +services: + ddns-go: + container_name: ${CONTAINER_NAME} + restart: always + networks: + - 1panel-network + ports: + - "${PANEL_APP_PORT_HTTP}:9876" + volumes: + - "${DATA_PATH}:/root" + image: jeessy/ddns-go:latest + labels: + createdBy: "Apps" + +networks: + 1panel-network: + external: true \ No newline at end of file diff --git a/apps/ddns-go/latest/data.yml b/apps/ddns-go/latest/data.yml index e47981d1..8554c42e 100644 --- a/apps/ddns-go/latest/data.yml +++ b/apps/ddns-go/latest/data.yml @@ -1,17 +1,17 @@ additionalProperties: - formFields: - - default: 9876 - edit: true - envKey: PANEL_APP_PORT_HTTP - labelEn: WebUI Port - labelZh: 网页端口 - required: true - rule: paramPort - type: number - - default: ./data - edit: true - envKey: DATA_PATH - labelEn: Data folder path - labelZh: 数据文件夹路径 - required: true - type: text \ No newline at end of file + formFields: + - default: "9876" + edit: true + envKey: PANEL_APP_PORT_HTTP + labelEn: Port + labelZh: 端口 + required: true + rule: paramPort + type: number + - default: "./data" + disabled: true + envKey: DATA_PATH + labelEn: Data Path + labelZh: 数据路径 + required: true + type: text \ No newline at end of file diff --git a/apps/ddns-go/latest/docker-compose.yml b/apps/ddns-go/latest/docker-compose.yml index ea2ec2c1..d5dea970 100644 --- a/apps/ddns-go/latest/docker-compose.yml +++ b/apps/ddns-go/latest/docker-compose.yml @@ -6,5 +6,5 @@ services: volumes: - "${DATA_PATH}:/root" image: jeessy/ddns-go:latest - labels: + labels: createdBy: "Apps"