mirror of
https://github.com/jeessy2/ddns-go.git
synced 2025-10-20 15:33:46 +08:00
修复火山引擎的两个问题 (#1497)
* fix(traffic_route): 通过精确获取DNS记录解决找不到历史记录的问题 * fix(traffic_route): IP 未更新时,不要发送 Webhook * fix(config): 修复日志输出格式,使用占位符输出匹配到的IPv6地址
This commit is contained in:
@ -357,7 +357,7 @@ func (conf *DnsConfig) getIpv6AddrFromInterface() string {
|
|||||||
for i := 0; i < len(netInterface.Address); i++ {
|
for i := 0; i < len(netInterface.Address); i++ {
|
||||||
matched, err := regexp.MatchString(conf.Ipv6.Ipv6Reg, netInterface.Address[i])
|
matched, err := regexp.MatchString(conf.Ipv6.Ipv6Reg, netInterface.Address[i])
|
||||||
if matched && err == nil {
|
if matched && err == nil {
|
||||||
util.Log("匹配成功! 匹配到地址: ", netInterface.Address[i])
|
util.Log("匹配成功! 匹配到地址: %s", netInterface.Address[i])
|
||||||
return netInterface.Address[i]
|
return netInterface.Address[i]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ type TrafficRouteListZonesParams struct {
|
|||||||
Key string `json:"Key,omitempty"` // 获取包含特定关键字的域名(默认模糊搜索)
|
Key string `json:"Key,omitempty"` // 获取包含特定关键字的域名(默认模糊搜索)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TrafficRouteListZonesResp
|
// TrafficRouteListZonesResp
|
||||||
type TrafficRouteListZonesResp struct {
|
type TrafficRouteListZonesResp struct {
|
||||||
ZID int `json:"ZID"` // 域名ID
|
ZID int `json:"ZID"` // 域名ID
|
||||||
}
|
}
|
||||||
@ -201,7 +201,7 @@ func (tr *TrafficRoute) create(zoneID int, domain *config.Domain, recordType, ip
|
|||||||
func (tr *TrafficRoute) modify(record TrafficRouteMeta, domain *config.Domain, ipAddr string) {
|
func (tr *TrafficRoute) modify(record TrafficRouteMeta, domain *config.Domain, ipAddr string) {
|
||||||
if record.Value == ipAddr {
|
if record.Value == ipAddr {
|
||||||
util.Log("IP %s 没有变化,域名 %s", ipAddr, domain)
|
util.Log("IP %s 没有变化,域名 %s", ipAddr, domain)
|
||||||
domain.UpdateStatus = config.UpdatedSuccess
|
domain.UpdateStatus = config.UpdatedNothing
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user