Parcourir la source

Remove mentioning of DC overrides

tags/v2.1.11^2^2
9seconds il y a 2 mois
Parent
révision
e4a9a96309

+ 0
- 9
example.config.toml Voir le fichier

@@ -80,15 +80,6 @@ tolerate-time-skewness = "5s"
80 80
 # Otherwise, chose a new DC.
81 81
 allow-fallback-on-unknown-dc = false
82 82
 
83
-# Telegram uses different DCs for different purposes. Unfortunately, most of
84
-# DCs are not public, and dependent on a location of the current user, so
85
-# mtg cannot know upfront about all of them, and how to access them. It has
86
-# a default list of DCs, including some CDN IPs, but it is possible that some
87
-# of them are not working for you. In this case, you can override them here.
88
-[[dc-overrides]]
89
-dc = 101
90
-ips = ["127.0.0.1:443"]
91
-
92 83
 # network defines different network-related settings
93 84
 [network]
94 85
 # please be aware that mtg needs to do some external requests. For

+ 0
- 9
internal/cli/run_proxy.go Voir le fichier

@@ -242,14 +242,6 @@ func runProxy(conf *config.Config, version string) error { //nolint: funlen
242 242
 		return fmt.Errorf("cannot build ip allowlist: %w", err)
243 243
 	}
244 244
 
245
-	dcOverrides := map[int][]string{}
246
-	for _, override := range conf.DCOverrides {
247
-		dcid := override.DC.Get()
248
-		for _, addr := range override.IPs {
249
-			dcOverrides[dcid] = append(dcOverrides[dcid], addr.Get(""))
250
-		}
251
-	}
252
-
253 245
 	opts := mtglib.ProxyOpts{
254 246
 		Logger:          logger,
255 247
 		Network:         ntw,
@@ -264,7 +256,6 @@ func runProxy(conf *config.Config, version string) error { //nolint: funlen
264 256
 
265 257
 		AllowFallbackOnUnknownDC: conf.AllowFallbackOnUnknownDC.Get(false),
266 258
 		TolerateTimeSkewness:     conf.TolerateTimeSkewness.Value,
267
-		DCOverrides:              dcOverrides,
268 259
 	}
269 260
 
270 261
 	proxy, err := mtglib.NewProxy(opts)

+ 0
- 4
internal/config/config.go Voir le fichier

@@ -65,10 +65,6 @@ type Config struct {
65 65
 			MetricPrefix TypeMetricPrefix `json:"metricPrefix"`
66 66
 		} `json:"prometheus"`
67 67
 	} `json:"stats"`
68
-	DCOverrides []struct {
69
-		DC  TypeDC         `json:"dc"`
70
-		IPs []TypeHostPort `json:"ips"`
71
-	} `json:"dcOverrides"`
72 68
 }
73 69
 
74 70
 func (c *Config) Validate() error {

+ 0
- 4
internal/config/parse.go Voir le fichier

@@ -60,10 +60,6 @@ type tomlConfig struct {
60 60
 			MetricPrefix string `toml:"metric-prefix" json:"metricPrefix,omitempty"`
61 61
 		} `toml:"prometheus" json:"prometheus,omitempty"`
62 62
 	} `toml:"stats" json:"stats,omitempty"`
63
-	DCOverrides []struct {
64
-		DC  uint     `toml:"dc" json:"dc"`
65
-		IPs []string `toml:"ips" json:"ips"`
66
-	} `toml:"dc-overrides" json:"dcOverrides,omitempty"`
67 63
 }
68 64
 
69 65
 func Parse(rawData []byte) (*Config, error) {

+ 0
- 3
mtglib/internal/dc/view.go Voir le fichier

@@ -2,12 +2,10 @@ package dc
2 2
 
3 3
 type dcView struct {
4 4
 	publicConfigs dcAddrSet
5
-	ownConfigs    dcAddrSet
6 5
 }
7 6
 
8 7
 func (d dcView) getV4(dc int) []Addr {
9 8
 	addrs := d.publicConfigs.getV4(dc)
10
-	addrs = append(addrs, d.ownConfigs.getV4(dc)...)
11 9
 	addrs = append(addrs, defaultDCAddrSet.getV4(dc)...)
12 10
 
13 11
 	return addrs
@@ -15,7 +13,6 @@ func (d dcView) getV4(dc int) []Addr {
15 13
 
16 14
 func (d dcView) getV6(dc int) []Addr {
17 15
 	addrs := d.publicConfigs.getV6(dc)
18
-	addrs = append(addrs, d.ownConfigs.getV6(dc)...)
19 16
 	addrs = append(addrs, defaultDCAddrSet.getV6(dc)...)
20 17
 
21 18
 	return addrs

+ 1
- 1
mtglib/proxy_opts.go Voir le fichier

@@ -117,7 +117,7 @@ type ProxyOpts struct {
117 117
 	// DCOverrides defines a set of IP addresses that should be used
118 118
 	// with a higher priority to those that are calculated somehow by mtg.
119 119
 	//
120
-	// This is an optional setting
120
+	// OBSOLETE and DEPRECATED. Ignored.
121 121
 	DCOverrides map[int][]string
122 122
 }
123 123
 

Chargement…
Annuler
Enregistrer