del no need option

This commit is contained in:
yuzuki999 2023-06-19 09:33:20 +08:00
parent 82c1753672
commit d3fe0c8afe
3 changed files with 10 additions and 14 deletions

View File

@ -15,8 +15,6 @@ 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"`

View File

@ -58,11 +58,9 @@ 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 c.nodeInfo.Tls || c.nodeInfo.Type == "hysteria" {
err = c.requestCert()
if err != nil {

View File

@ -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)