Config: Remove legacy config fields again (#3782)

* Remove more lecacy fields

* Patch missing bracket

* Fix tests

* Fix missing comma

* Fix buried test bomb

* Cleanup test after removed legacy test content
This commit is contained in:
Kobe Arthur Scofield 2024-09-11 22:37:25 +08:00 committed by GitHub
parent c90affe7db
commit 6b1bf312d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 55 additions and 152 deletions

View file

@ -361,11 +361,6 @@ func (c *StatsConfig) Build() (*stats.Config, error) {
}
type Config struct {
// Port of this Point server.
// Deprecated: Port exists for historical compatibility
// and should not be used.
Port uint16 `json:"port"`
// Deprecated: Global transport config is no longer used
// left for returning error
Transport map[string]json.RawMessage `json:"transport"`
@ -597,14 +592,6 @@ func (c *Config) Build() (*core.Config, error) {
inbounds = append(inbounds, c.InboundConfigs...)
}
// Backward compatibility.
if len(inbounds) > 0 && inbounds[0].PortList == nil && c.Port > 0 {
inbounds[0].PortList = &PortList{[]PortRange{{
From: uint32(c.Port),
To: uint32(c.Port),
}}}
}
if len(c.Transport) > 0 {
return nil, errors.New("Global transport config is deprecated")
}