mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-24 07:28:27 +00:00
Usage reporting should recognize new discovery server IP:s
This commit is contained in:
parent
185b0690c8
commit
8d421a62d2
@ -189,12 +189,11 @@ func reportData(m *model.Model) map[string]interface{} {
|
|||||||
|
|
||||||
defaultAnnounceServersDNS, defaultAnnounceServersIP, otherAnnounceServers := 0, 0, 0
|
defaultAnnounceServersDNS, defaultAnnounceServersIP, otherAnnounceServers := 0, 0, 0
|
||||||
for _, addr := range cfg.Options().GlobalAnnServers {
|
for _, addr := range cfg.Options().GlobalAnnServers {
|
||||||
switch addr {
|
if addr == "default" {
|
||||||
case "udp4://announce.syncthing.net:22027", "udp6://announce-v6.syncthing.net:22027":
|
|
||||||
defaultAnnounceServersDNS++
|
defaultAnnounceServersDNS++
|
||||||
case "udp4://194.126.249.5:22027", "udp6://[2001:470:28:4d6::5]:22027":
|
} else if stringIn(addr, config.DefaultDiscoveryServersIP) {
|
||||||
defaultAnnounceServersIP++
|
defaultAnnounceServersIP++
|
||||||
default:
|
} else {
|
||||||
otherAnnounceServers++
|
otherAnnounceServers++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -229,6 +228,15 @@ func reportData(m *model.Model) map[string]interface{} {
|
|||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func stringIn(needle string, haystack []string) bool {
|
||||||
|
for _, s := range haystack {
|
||||||
|
if needle == s {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
type usageReportingService struct {
|
type usageReportingService struct {
|
||||||
model *model.Model
|
model *model.Model
|
||||||
stop chan struct{}
|
stop chan struct{}
|
||||||
|
@ -44,6 +44,17 @@ var (
|
|||||||
"https://discovery-v6-2.syncthing.net/?id=AQEHEO2-XOS7QRA-X2COH5K-PO6OPVA-EWOSEGO-KZFMD32-XJ4ZV46-CUUVKAS", // 2604:a880:800:10::182:a001, USA
|
"https://discovery-v6-2.syncthing.net/?id=AQEHEO2-XOS7QRA-X2COH5K-PO6OPVA-EWOSEGO-KZFMD32-XJ4ZV46-CUUVKAS", // 2604:a880:800:10::182:a001, USA
|
||||||
"https://discovery-v6-3.syncthing.net/?id=7WT2BVR-FX62ZOW-TNVVW25-6AHFJGD-XEXQSBW-VO3MPL2-JBTLL4T-P4572Q4", // 2400:6180:0:d0::d9:d001, Singapore
|
"https://discovery-v6-3.syncthing.net/?id=7WT2BVR-FX62ZOW-TNVVW25-6AHFJGD-XEXQSBW-VO3MPL2-JBTLL4T-P4572Q4", // 2400:6180:0:d0::d9:d001, Singapore
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DefaultDiscoveryServerIPs is used by the usage reporting.
|
||||||
|
// XXX: Detect Android, and use this is we still don't have working DNS?
|
||||||
|
DefaultDiscoveryServersIP = []string{
|
||||||
|
"https://194.126.249.5/?id=SR7AARM-TCBUZ5O-VFAXY4D-CECGSDE-3Q6IZ4G-XG7AH75-OBIXJQV-QJ6NLQA",
|
||||||
|
"https://45.55.230.38/?id=AQEHEO2-XOS7QRA-X2COH5K-PO6OPVA-EWOSEGO-KZFMD32-XJ4ZV46-CUUVKAS",
|
||||||
|
"https://128.199.95.124/?id=7WT2BVR-FX62ZOW-TNVVW25-6AHFJGD-XEXQSBW-VO3MPL2-JBTLL4T-P4572Q4",
|
||||||
|
"https://[2001:470:28:4d6::5]/?id=SR7AARM-TCBUZ5O-VFAXY4D-CECGSDE-3Q6IZ4G-XG7AH75-OBIXJQV-QJ6NLQA",
|
||||||
|
"https://[2604:a880:800:10::182:a001]/?id=AQEHEO2-XOS7QRA-X2COH5K-PO6OPVA-EWOSEGO-KZFMD32-XJ4ZV46-CUUVKAS",
|
||||||
|
"https://[2400:6180:0:d0::d9:d001]/?id=7WT2BVR-FX62ZOW-TNVVW25-6AHFJGD-XEXQSBW-VO3MPL2-JBTLL4T-P4572Q4",
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
type Configuration struct {
|
type Configuration struct {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user