From d3fe0c8afec23dc00e3b0d66e19ce7656465dc65 Mon Sep 17 00:00:00 2001 From: yuzuki999 Date: Mon, 19 Jun 2023 09:33:20 +0800 Subject: [PATCH] del no need option --- conf/node.go | 16 +++++++--------- node/controller.go | 6 ++---- node/user.go | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/conf/node.go b/conf/node.go index ac1b134..074f738 100644 --- a/conf/node.go +++ b/conf/node.go @@ -15,15 +15,13 @@ type ApiConfig struct { } type ControllerConfig struct { - DisableUploadTraffic bool `yaml:"DisableUploadTraffic"` - DisableGetRule bool `yaml:"DisableGetRule"` - ListenIP string `yaml:"ListenIP"` - SendIP string `yaml:"SendIP"` - EnableProxyProtocol bool `yaml:"EnableProxyProtocol"` - XrayOptions XrayOptions `yaml:"XrayOptions"` - HyOptions HyOptions `yaml:"HyOptions"` - LimitConfig LimitConfig `yaml:"LimitConfig"` - CertConfig *CertConfig `yaml:"CertConfig"` + ListenIP string `yaml:"ListenIP"` + SendIP string `yaml:"SendIP"` + EnableProxyProtocol bool `yaml:"EnableProxyProtocol"` + XrayOptions XrayOptions `yaml:"XrayOptions"` + HyOptions HyOptions `yaml:"HyOptions"` + LimitConfig LimitConfig `yaml:"LimitConfig"` + CertConfig *CertConfig `yaml:"CertConfig"` } type XrayOptions struct { diff --git a/node/controller.go b/node/controller.go index e633832..85b0b4a 100644 --- a/node/controller.go +++ b/node/controller.go @@ -58,10 +58,8 @@ func (c *Controller) Start() error { // add limiter l := limiter.AddLimiter(c.Tag, &c.LimitConfig, c.userList) // add rule limiter - if !c.DisableGetRule { - if err = l.UpdateRule(c.nodeInfo.Rules); err != nil { - return fmt.Errorf("update rule error: %s", err) - } + if err = l.UpdateRule(c.nodeInfo.Rules); err != nil { + return fmt.Errorf("update rule error: %s", err) } if c.nodeInfo.Tls || c.nodeInfo.Type == "hysteria" { err = c.requestCert() diff --git a/node/user.go b/node/user.go index 25b1318..d832b09 100644 --- a/node/user.go +++ b/node/user.go @@ -22,7 +22,7 @@ func (c *Controller) reportUserTrafficTask() (err error) { Download: down}) } } - if len(userTraffic) > 0 && !c.DisableUploadTraffic { + if len(userTraffic) > 0 { err = c.apiClient.ReportUserTraffic(userTraffic) if err != nil { log.Printf("Report user traffic faild: %s", err)