mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 14:44:02 +03:00
Remove mentioning of DC overrides
This commit is contained in:
@@ -242,14 +242,6 @@ func runProxy(conf *config.Config, version string) error { //nolint: funlen
|
||||
return fmt.Errorf("cannot build ip allowlist: %w", err)
|
||||
}
|
||||
|
||||
dcOverrides := map[int][]string{}
|
||||
for _, override := range conf.DCOverrides {
|
||||
dcid := override.DC.Get()
|
||||
for _, addr := range override.IPs {
|
||||
dcOverrides[dcid] = append(dcOverrides[dcid], addr.Get(""))
|
||||
}
|
||||
}
|
||||
|
||||
opts := mtglib.ProxyOpts{
|
||||
Logger: logger,
|
||||
Network: ntw,
|
||||
@@ -264,7 +256,6 @@ func runProxy(conf *config.Config, version string) error { //nolint: funlen
|
||||
|
||||
AllowFallbackOnUnknownDC: conf.AllowFallbackOnUnknownDC.Get(false),
|
||||
TolerateTimeSkewness: conf.TolerateTimeSkewness.Value,
|
||||
DCOverrides: dcOverrides,
|
||||
}
|
||||
|
||||
proxy, err := mtglib.NewProxy(opts)
|
||||
|
||||
@@ -65,10 +65,6 @@ type Config struct {
|
||||
MetricPrefix TypeMetricPrefix `json:"metricPrefix"`
|
||||
} `json:"prometheus"`
|
||||
} `json:"stats"`
|
||||
DCOverrides []struct {
|
||||
DC TypeDC `json:"dc"`
|
||||
IPs []TypeHostPort `json:"ips"`
|
||||
} `json:"dcOverrides"`
|
||||
}
|
||||
|
||||
func (c *Config) Validate() error {
|
||||
|
||||
@@ -60,10 +60,6 @@ type tomlConfig struct {
|
||||
MetricPrefix string `toml:"metric-prefix" json:"metricPrefix,omitempty"`
|
||||
} `toml:"prometheus" json:"prometheus,omitempty"`
|
||||
} `toml:"stats" json:"stats,omitempty"`
|
||||
DCOverrides []struct {
|
||||
DC uint `toml:"dc" json:"dc"`
|
||||
IPs []string `toml:"ips" json:"ips"`
|
||||
} `toml:"dc-overrides" json:"dcOverrides,omitempty"`
|
||||
}
|
||||
|
||||
func Parse(rawData []byte) (*Config, error) {
|
||||
|
||||
Reference in New Issue
Block a user