mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
merge upstream, improve geoip pkg
This commit is contained in:
@@ -212,10 +212,9 @@ func (s *NezhaHandler) LookupGeoIP(c context.Context, r *pb.GeoIP) (*pb.GeoIP, e
|
||||
}
|
||||
|
||||
// 根据内置数据库查询 IP 地理位置
|
||||
record := &geoip.IPInfo{}
|
||||
ip := r.GetIp()
|
||||
netIP := net.ParseIP(ip)
|
||||
location, err := geoip.Lookup(netIP, record)
|
||||
location, err := geoip.Lookup(netIP)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/libdns/cloudflare"
|
||||
"github.com/libdns/tencentcloud"
|
||||
tencentcloud "github.com/nezhahq/libdns-tencentcloud"
|
||||
|
||||
"github.com/naiba/nezha/model"
|
||||
ddns2 "github.com/naiba/nezha/pkg/ddns"
|
||||
@@ -76,6 +76,7 @@ func GetDDNSProvidersFromProfiles(profileId []uint64, ip *ddns2.IP) ([]*ddns2.Pr
|
||||
if profile, ok := DDNSCache[id]; ok {
|
||||
profiles = append(profiles, profile)
|
||||
} else {
|
||||
DDNSCacheLock.RUnlock()
|
||||
return nil, fmt.Errorf("无法找到DDNS配置 ID %d", id)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user