diff --git a/dns.yaml b/dns.yaml new file mode 100644 index 0000000..16dfcac --- /dev/null +++ b/dns.yaml @@ -0,0 +1,28 @@ +Servers: {} +Fallbacks: + cdn-lfs.huggingface.co: + - 3.163.218.77 + - 3.163.218.75 + - 3.163.218.60 + - 3.163.218.88 + - 2600:9000:26a9:6e00:11:f807:5180:93a1 + - 2600:9000:26a9:8400:11:f807:5180:93a1 + - 2600:9000:26a9:e400:11:f807:5180:93a1 + - 2600:9000:26a9:6400:11:f807:5180:93a1 + - 2600:9000:26a9:f400:11:f807:5180:93a1 + - 2600:9000:26a9:ec00:11:f807:5180:93a1 + - 2600:9000:26a9:6600:11:f807:5180:93a1 + - 2600:9000:26a9:fa00:11:f807:5180:93a1 + huggingface.co: + - 18.65.159.75 + - 18.65.159.63 + - 18.65.159.2 + - 18.65.159.20 + - 2600:9000:2218:9200:17:b174:6d00:93a1 + - 2600:9000:2218:e00:17:b174:6d00:93a1 + - 2600:9000:2218:4800:17:b174:6d00:93a1 + - 2600:9000:2218:6c00:17:b174:6d00:93a1 + - 2600:9000:2218:b200:17:b174:6d00:93a1 + - 2600:9000:2218:6800:17:b174:6d00:93a1 + - 2600:9000:2218:c800:17:b174:6d00:93a1 + - 2600:9000:2218:2e00:17:b174:6d00:93a1 diff --git a/go.mod b/go.mod index 511e6b4..25dd89a 100644 --- a/go.mod +++ b/go.mod @@ -3,17 +3,14 @@ module rvcmd go 1.22.1 require ( + github.com/fumiama/terasu v0.0.0-20240420161109-c8c0088d72cd + github.com/gizak/termui/v3 v3.1.0 github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.9.3 golang.org/x/sys v0.19.0 gopkg.in/yaml.v3 v3.0.1 ) -require ( - github.com/fumiama/terasu v0.0.0-20240418161858-1c3273a78268 - github.com/gizak/termui/v3 v3.1.0 -) - require ( github.com/FloatTech/ttl v0.0.0-20230307105452-d6f7b2b647d1 // indirect github.com/RomiChan/syncx v0.0.0-20240418144900-b7402ffdebc7 // indirect diff --git a/go.sum b/go.sum index 3615ff9..ea9437d 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,8 @@ github.com/RomiChan/syncx v0.0.0-20240418144900-b7402ffdebc7/go.mod h1:vD7Ra3Q9o github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fumiama/terasu v0.0.0-20240418161858-1c3273a78268 h1:6R8kSGVSIoR3xm2NG8Z4ivkTpAET783RFsJOVKrI7n8= -github.com/fumiama/terasu v0.0.0-20240418161858-1c3273a78268/go.mod h1:afchyfKAb7J/zvaENtYzjIEPVbwiEjJaow05zzT4usM= +github.com/fumiama/terasu v0.0.0-20240420161109-c8c0088d72cd h1:cEUaAUdb1uVyOfEenCMtU3lUMELTVwepn/g7UL/CK54= +github.com/fumiama/terasu v0.0.0-20240420161109-c8c0088d72cd/go.mod h1:afchyfKAb7J/zvaENtYzjIEPVbwiEjJaow05zzT4usM= github.com/gizak/termui/v3 v3.1.0 h1:ZZmVDgwHl7gR7elfKf1xc4IudXZ5qqfDh4wExk4Iajc= github.com/gizak/termui/v3 v3.1.0/go.mod h1:bXQEBkJpzxUAKf0+xq9MSWAvWZlE7c+aidmyFlkYTrY= github.com/mattn/go-runewidth v0.0.2 h1:UnlwIPBGaTZfPQ6T1IGzPI0EkYAQmT9fAEJ/poFC63o= diff --git a/main.go b/main.go index b8b281c..a59bb71 100644 --- a/main.go +++ b/main.go @@ -68,7 +68,7 @@ func main() { errorln("open custom dns file", *dnsf, "err:", err) return } - m := map[string][]string{} + m := dns.DNSConfig{} err = yaml.NewDecoder(f).Decode(&m) if err != nil { errorln("decode custom dns file", *dnsf, "err:", err) @@ -76,9 +76,9 @@ func main() { } _ = f.Close() if ip.IsIPv6Available.Get() { - dns.IPv6Servers.Add(m) + dns.IPv6Servers.Add(&m) } else { - dns.IPv4Servers.Add(m) + dns.IPv4Servers.Add(&m) } infoln("custom dns file added") }