@cryptotaxi247 / kubo / commits / c932e6b70

go-ipfs-config: add default empty config for DNS, rename struct from DNSConfig to DNS

vyzo committed Apr 14, 2021 at 18:46 UTC c932e6b7008901e2dea8e8dd4e4bafa9fb2fe77d
3 files changed +9 -6
config/config.go
+1 -1
@@ -28,7 +28,7 @@ type Config struct {
28 AutoNAT AutoNATConfig
29 Pubsub PubsubConfig
30 Peering Peering
31 - DNS DNSConfig
31 + DNS DNS
32
33 Provider Provider
34 Reprovider Reprovider
config/dns.go
+5 -5
@@ -1,13 +1,13 @@
1 package config
2
3 -// DNSConfig specifies DNS resolution rules using custom resolvers
4 -type DNSConfig struct {
5 - // Resolvers is a map of FQDNs to URLs for custom DNS resolution.
3 +// DNS specifies DNS resolution rules using custom resolvers
4 +type DNS struct {
5 + // Resolvers is a map of FQDNs to URLs for custom DNS resolution.
6 // URLs starting with `https://` indicate DoH endpoints.
7 // Support for other resolver types can be added in the future.
8 // https://en.wikipedia.org/wiki/Fully_qualified_domain_name
9 - // https://en.wikipedia.org/wiki/DNS_over_HTTPS
10 - //
9 + // https://en.wikipedia.org/wiki/DNS_over_HTTPS
10 + //
11 // Example:
12 // - Custom resolver for ENS: `eth.` → `https://eth.link/dns-query`
13 // - Override the default OS resolver: `.` → `https://doh.applied-privacy.net/query`
config/init.go
+3
@@ -89,6 +89,9 @@ func InitWithIdentity(identity Identity) (*Config, error) {
89 Pinning: Pinning{
90 RemoteServices: map[string]RemotePinningService{},
91 },
92 + DNS: DNS{
93 + Resolvers: map[string]string{},
94 + },
95 }
96
97 return conf, nil