mirror of
https://github.com/okxlin/appstore.git
synced 2025-07-14 05:12:19 +08:00
feat:调整ddns-go
This commit is contained in:
parent
19eb8393d4
commit
726e8bf98c
@ -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
|
|
@ -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"
|
|
@ -1,17 +1,17 @@
|
|||||||
additionalProperties:
|
additionalProperties:
|
||||||
formFields:
|
formFields:
|
||||||
- default: 9876
|
- default: "9876"
|
||||||
edit: true
|
edit: true
|
||||||
envKey: PANEL_APP_PORT_HTTP
|
envKey: PANEL_APP_PORT_HTTP
|
||||||
labelEn: WebUI Port
|
labelEn: Port
|
||||||
labelZh: 网页端口
|
labelZh: 端口
|
||||||
required: true
|
required: true
|
||||||
rule: paramPort
|
rule: paramPort
|
||||||
type: number
|
type: number
|
||||||
- default: ./data
|
- default: "./data"
|
||||||
edit: true
|
disabled: true
|
||||||
envKey: DATA_PATH
|
envKey: DATA_PATH
|
||||||
labelEn: Data folder path
|
labelEn: Data Path
|
||||||
labelZh: 数据文件夹路径
|
labelZh: 数据路径
|
||||||
required: true
|
required: true
|
||||||
type: text
|
type: text
|
@ -6,5 +6,5 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- "${DATA_PATH}:/root"
|
- "${DATA_PATH}:/root"
|
||||||
image: jeessy/ddns-go:v6.7.0
|
image: jeessy/ddns-go:v6.7.0
|
||||||
labels:
|
labels:
|
||||||
createdBy: "Apps"
|
createdBy: "Apps"
|
||||||
|
@ -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
|
# ddns-go
|
||||||
|
|
||||||
[ ](https://github.com/jeessy2/ddns-go/releases/latest) [](https://github.com/jeessy2/ddns-go/blob/master/go.mod) [](https://goreportcard.com/report/github.com/jeessy2/ddns-go/v5) [](https://registry.hub.docker.com/r/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 地址,并解析到对应的域名服务。
|
自动获得你的公网 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 请求
|
|
||||||
- <details><summary>Server酱</summary>
|
|
||||||
|
|
||||||
```
|
|
||||||
https://sctapi.ftqq.com/[SendKey].send?title=你的公网IP变了&desp=主人IPv4变了#{ipv4Addr},域名更新结果:#{ipv4Result}
|
|
||||||
```
|
|
||||||
- <details><summary>Bark</summary>
|
|
||||||
|
|
||||||
```
|
|
||||||
https://api.day.app/[YOUR_KEY]/主人IPv4变了#{ipv4Addr},域名更新结果:#{ipv4Result}
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
- <details><summary>钉钉</summary>
|
|
||||||
|
|
||||||
- 钉钉电脑端 -> 群设置 -> 智能群助手 -> 添加机器人 -> 自定义
|
|
||||||
- 只勾选 `自定义关键词`, 输入的关键字必须包含在RequestBody的content中, 如:`你的公网IP变了`
|
|
||||||
- URL中输入钉钉给你的 `Webhook地址`
|
|
||||||
- RequestBody中输入
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"msgtype": "markdown",
|
|
||||||
"markdown": {
|
|
||||||
"title": "你的公网IP变了",
|
|
||||||
"text": "#### 你的公网IP变了 \n - IPv4地址:#{ipv4Addr} \n - 域名更新结果:#{ipv4Result} \n"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
- <details><summary>飞书</summary>
|
|
||||||
|
|
||||||
- 飞书电脑端 -> 群设置 -> 添加机器人 -> 自定义机器人
|
|
||||||
- 安全设置只勾选 `自定义关键词`, 输入的关键字必须包含在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}"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
- <details><summary>Telegram</summary>
|
|
||||||
|
|
||||||
[ddns-telegram-bot](https://github.com/WingLim/ddns-telegram-bot)
|
|
||||||
</details>
|
|
||||||
- <details><summary>plusplus 推送加</summary>
|
|
||||||
|
|
||||||
- [获取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"
|
|
||||||
}
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
- <details><summary>Discord</summary>
|
|
||||||
|
|
||||||
- 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}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
|
|
||||||
- [查看更多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配置参考)
|
|
||||||
|
|
||||||
## 界面
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## 开发&自行编译
|
|
||||||
|
|
||||||
- 如果喜欢从源代码编译自己的版本,可以使用本项目提供的 Makefile 构建
|
|
||||||
- 使用 `make build` 生成本地编译后的 `ddns-go` 可执行文件
|
|
||||||
- 使用 `make build_docker_image` 自行编译 Docker 镜像
|
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
name: ddns-go
|
name: ddns-go
|
||||||
tags:
|
tags:
|
||||||
- 工具
|
- 实用工具
|
||||||
title: 自动获得你的公网 IPv4 或 IPv6 地址,并解析到对应的域名服务
|
title: 自动获得你的公网 IPv4 或 IPv6 地址,并解析到对应的域名服务
|
||||||
type: 工具
|
|
||||||
description: 自动获得你的公网 IPv4 或 IPv6 地址,并解析到对应的域名服务
|
description: 自动获得你的公网 IPv4 或 IPv6 地址,并解析到对应的域名服务
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
key: ddns-go
|
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
|
shortDescEn: Automatically obtain your public IPv4 or IPv6 address and resolve it to the corresponding domain name service
|
||||||
type: tool
|
type: tool
|
||||||
crossVersionUpdate: true
|
crossVersionUpdate: true
|
||||||
limit: 1
|
limit: 0
|
||||||
recommend: 0
|
recommend: 0
|
||||||
website: https://github.com/jeessy2/ddns-go
|
website: https://github.com/jeessy2/ddns-go
|
||||||
github: https://github.com/jeessy2/ddns-go
|
github: https://github.com/jeessy2/ddns-go
|
||||||
|
17
apps/ddns-go/latest-bridge/data.yml
Normal file
17
apps/ddns-go/latest-bridge/data.yml
Normal file
@ -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
|
17
apps/ddns-go/latest-bridge/docker-compose.yml
Normal file
17
apps/ddns-go/latest-bridge/docker-compose.yml
Normal file
@ -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
|
@ -1,17 +1,17 @@
|
|||||||
additionalProperties:
|
additionalProperties:
|
||||||
formFields:
|
formFields:
|
||||||
- default: 9876
|
- default: "9876"
|
||||||
edit: true
|
edit: true
|
||||||
envKey: PANEL_APP_PORT_HTTP
|
envKey: PANEL_APP_PORT_HTTP
|
||||||
labelEn: WebUI Port
|
labelEn: Port
|
||||||
labelZh: 网页端口
|
labelZh: 端口
|
||||||
required: true
|
required: true
|
||||||
rule: paramPort
|
rule: paramPort
|
||||||
type: number
|
type: number
|
||||||
- default: ./data
|
- default: "./data"
|
||||||
edit: true
|
disabled: true
|
||||||
envKey: DATA_PATH
|
envKey: DATA_PATH
|
||||||
labelEn: Data folder path
|
labelEn: Data Path
|
||||||
labelZh: 数据文件夹路径
|
labelZh: 数据路径
|
||||||
required: true
|
required: true
|
||||||
type: text
|
type: text
|
@ -6,5 +6,5 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- "${DATA_PATH}:/root"
|
- "${DATA_PATH}:/root"
|
||||||
image: jeessy/ddns-go:latest
|
image: jeessy/ddns-go:latest
|
||||||
labels:
|
labels:
|
||||||
createdBy: "Apps"
|
createdBy: "Apps"
|
||||||
|
Loading…
Reference in New Issue
Block a user