-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DDNS support #324
Add DDNS support #324
Conversation
现在 agent 更新 IP 不及时 |
坏,那岂不是agent也要改。做这个功能主要是不想把DDNS提供商的凭据丢到小鸡上,感觉不太安全。集中在哪吒面板做的话安全性会高一点。 |
现在 30 分钟才更新一次公网 IP |
已提PR |
检测的逻辑可以考虑做到ip变动那里,不需要一个单独逻辑 |
好,我晚点有空改完提交上来 |
@naiba 改了,康康还有什么地方要动的?没咋写过go,service/rpc/nezha.go:L117是不是应该开个协程跑啥的 |
在updatedomain那个方法上开就好,可以内部加错误重试几次的逻辑 |
已完成,agent那个PR也需要看一下~ |
cmd/dashboard/main.go
Outdated
@@ -38,6 +39,20 @@ func init() { | |||
initSystem() | |||
} | |||
|
|||
func secondsToCronString(seconds uint32) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好像没用到了
已完成🚀 |
有事 晚点看 |
添加DDNS支持,可以定时检查并为设置的域名更新DNS记录
新增配置
其中
webhookurl
、webhookrequestbody
以及webhookheaders
可以使用如下参数:{ip} - 主机当前IP
{domain} - ddns域名
{type} - IP类型,可能为"ipv4"和"ipv6"
{access_id} - 凭据1
{access_secret} - 凭据2
示例:
说明
增加了一个定时任务
RefreshDDNSRecords
,增加了一个singleton模块ddns
。可以通过实现接口DDNSProvider
并修改选择函数GetDDNSProviderFromString
来实现新的Provider。例子:
效果预览
已完成Webhook DDNS功能发送的请求
新增字段效果图