Update application version and enhance error handling

The commit increases the version number from 0.9.1 to 0.9.2 in version.go. Additionally, an error check has been added in x25519.go to validate the private key size. Also, panel.go has been modified to accept both "NewV2board" and "V2board" as valid panel types.
This commit is contained in:
Senis John 2023-10-17 15:36:32 +08:00
parent cac4288e07
commit 97d89549dd
No known key found for this signature in database
GPG Key ID: 845E9E4727C3E1A4
3 changed files with 6 additions and 2 deletions

View File

@ -7,7 +7,7 @@ import (
) )
var ( var (
version = "0.9.1" version = "0.9.2"
codename = "XrayR" codename = "XrayR"
intro = "A Xray backend that supports many panels" intro = "A Xray backend that supports many panels"
) )

View File

@ -3,6 +3,7 @@ package cmd
import ( import (
"crypto/rand" "crypto/rand"
"encoding/base64" "encoding/base64"
"errors"
"fmt" "fmt"
"github.com/spf13/cobra" "github.com/spf13/cobra"
@ -39,6 +40,9 @@ func x25519() error {
if err != nil { if err != nil {
return err return err
} }
if len(p) != curve25519.ScalarSize {
return errors.New("invalid private key")
}
privateKey = p privateKey = p
} }

View File

@ -177,7 +177,7 @@ func (p *Panel) Start() {
switch nodeConfig.PanelType { switch nodeConfig.PanelType {
case "SSpanel": case "SSpanel":
apiClient = sspanel.New(nodeConfig.ApiConfig) apiClient = sspanel.New(nodeConfig.ApiConfig)
case "NewV2board": case "NewV2board", "V2board":
apiClient = newV2board.New(nodeConfig.ApiConfig) apiClient = newV2board.New(nodeConfig.ApiConfig)
case "PMpanel": case "PMpanel":
apiClient = pmpanel.New(nodeConfig.ApiConfig) apiClient = pmpanel.New(nodeConfig.ApiConfig)