From a4127588f72055f45b7706ff9cf66c15ab88315d Mon Sep 17 00:00:00 2001 From: yuzuki999 Date: Sat, 4 Jun 2022 16:59:10 +0800 Subject: [PATCH] update config --- api/api.go | 38 +++++++++++++++++++------------------- api/utils.go | 1 - main/config.yml.example | 4 +--- main/main.go | 6 +++--- panel/config.go | 2 +- 5 files changed, 24 insertions(+), 27 deletions(-) diff --git a/api/api.go b/api/api.go index ecc8902..c210255 100644 --- a/api/api.go +++ b/api/api.go @@ -14,13 +14,13 @@ import ( // API is the interface for different panel's api. type Config struct { - APIHost string `mapstructure:"ApiHost"` - NodeID int `mapstructure:"NodeID"` - Key string `mapstructure:"ApiKey"` - NodeType string `mapstructure:"NodeType"` - EnableVless bool `mapstructure:"EnableVless"` - EnableXTLS bool `mapstructure:"EnableXTLS"` - EnableSS2022 bool `mapstructure:"EnableSS2022"` + APIHost string `mapstructure:"ApiHost"` + NodeID int `mapstructure:"NodeID"` + Key string `mapstructure:"ApiKey"` + NodeType string `mapstructure:"NodeType"` + EnableVless bool `mapstructure:"EnableVless"` + EnableXTLS bool `mapstructure:"EnableXTLS"` + //EnableSS2022 bool `mapstructure:"EnableSS2022"` Timeout int `mapstructure:"Timeout"` SpeedLimit float64 `mapstructure:"SpeedLimit"` DeviceLimit int `mapstructure:"DeviceLimit"` @@ -36,12 +36,12 @@ type ClientInfo struct { } type Client struct { - client *resty.Client - APIHost string - NodeID int - Key string - NodeType string - EnableSS2022 bool + client *resty.Client + APIHost string + NodeID int + Key string + NodeType string + //EnableSS2022 bool EnableVless bool EnableXTLS bool SpeedLimit float64 @@ -78,12 +78,12 @@ func New(apiConfig *Config) API { // Read local rule list localRuleList := readLocalRuleList(apiConfig.RuleListPath) apiClient := &Client{ - client: client, - NodeID: apiConfig.NodeID, - Key: apiConfig.Key, - APIHost: apiConfig.APIHost, - NodeType: apiConfig.NodeType, - EnableSS2022: apiConfig.EnableSS2022, + client: client, + NodeID: apiConfig.NodeID, + Key: apiConfig.Key, + APIHost: apiConfig.APIHost, + NodeType: apiConfig.NodeType, + //EnableSS2022: apiConfig.EnableSS2022, EnableVless: apiConfig.EnableVless, EnableXTLS: apiConfig.EnableXTLS, SpeedLimit: apiConfig.SpeedLimit, diff --git a/api/utils.go b/api/utils.go index 497d1bd..6669389 100644 --- a/api/utils.go +++ b/api/utils.go @@ -18,7 +18,6 @@ func (c *Client) Debug() { func (c *Client) assembleURL(path string) string { return c.APIHost + path } - func (c *Client) checkResponse(res *resty.Response, path string, err error) error { if err != nil { return fmt.Errorf("request %s failed: %s", c.assembleURL(path), err) diff --git a/main/config.yml.example b/main/config.yml.example index a25a019..78129c2 100644 --- a/main/config.yml.example +++ b/main/config.yml.example @@ -14,12 +14,11 @@ ConnetionConfig: BufferSize: 64 # The internal cache size of each connection, kB Nodes: - - PanelType: "SSpanel" # Panel type: SSpanel, V2board, PMpanel, Proxypanel ApiConfig: ApiHost: "http://127.0.0.1:667" ApiKey: "123" NodeID: 41 - NodeType: V2ray # Node type: V2ray, Shadowsocks, Trojan, Shadowsocks-Plugin + NodeType: V2ray # Node type: V2ray, Shadowsocks, Trojan Timeout: 30 # Timeout for the api request EnableVless: false # Enable Vless for V2ray Type EnableXTLS: false # Enable XTLS for V2ray and Trojan @@ -52,7 +51,6 @@ Nodes: ALICLOUD_ACCESS_KEY: aaa ALICLOUD_SECRET_KEY: bbb # - - # PanelType: "V2board" # Panel type: SSpanel, V2board # ApiConfig: # ApiHost: "http://127.0.0.1:668" # ApiKey: "123" diff --git a/main/main.go b/main/main.go index 75735b5..8f38242 100644 --- a/main/main.go +++ b/main/main.go @@ -23,9 +23,9 @@ var ( ) var ( - version = "0.8.2.6" - codename = "XrayR" - intro = "A Xray backend that supports many panels" + version = "v0.0.1" + codename = "V2bX" + intro = "A V2board backend based on Xray" ) func showVersion() { diff --git a/panel/config.go b/panel/config.go index 12f88d4..021ad3e 100644 --- a/panel/config.go +++ b/panel/config.go @@ -16,7 +16,7 @@ type Config struct { } type NodesConfig struct { - PanelType string `mapstructure:"PanelType"` + //PanelType string `mapstructure:"PanelType"` ApiConfig *api.Config `mapstructure:"ApiConfig"` ControllerConfig *controller.Config `mapstructure:"ControllerConfig"` }