update to singbox 1.9.0 and update to warp-plus

This commit is contained in:
Hiddify
2024-05-29 17:38:13 +02:00
parent dd0c3614c9
commit ed423fec45
14 changed files with 168 additions and 172 deletions

View File

@@ -162,6 +162,7 @@ func Parse(in *pb.ParseRequest) (*pb.ParseResponse, error) {
Log(pb.LogLevel_FATAL, pb.LogType_CONFIG, err.Error())
StopAndAlert(pb.MessageType_UNEXPECTED_ERROR, err.Error())
})
content := in.Content
if in.TempPath != "" {
contentBytes, err := os.ReadFile(in.TempPath)
@@ -173,7 +174,7 @@ func Parse(in *pb.ParseRequest) (*pb.ParseResponse, error) {
}
config, err := config.ParseConfigContent(content, true, false)
config, err := config.ParseConfigContent(content, true, nil, false)
if err != nil {
return &pb.ParseResponse{
ResponseCode: pb.ResponseCode_FAILED,

View File

@@ -143,7 +143,7 @@ func extractRefreshInterval(header http.Header, bodyStr string) (int, error) {
return 0, nil
}
func buildConfig(configContent string, options config.ConfigOptions) (string, error) {
parsedContent, err := config.ParseConfigContent(configContent, true, options.EnableFullConfig)
parsedContent, err := config.ParseConfigContent(configContent, true, &options, false)
if err != nil {
return "", fmt.Errorf("failed to parse config content: %w", err)
}

View File

@@ -11,14 +11,14 @@ func (s *CoreService) GenerateWarpConfig(ctx context.Context, in *pb.GenerateWar
return GenerateWarpConfig(in)
}
func GenerateWarpConfig(in *pb.GenerateWarpConfigRequest) (*pb.WarpGenerationResponse, error) {
account, log, wg, err := config.GenerateWarpInfo(in.LicenseKey, in.AccountId, in.AccessToken)
identity, log, wg, err := config.GenerateWarpInfo(in.LicenseKey, in.AccountId, in.AccessToken)
if err != nil {
return nil, err
}
return &pb.WarpGenerationResponse{
Account: &pb.WarpAccount{
AccountId: account.AccountID,
AccessToken: account.AccessToken,
AccountId: identity.ID,
AccessToken: identity.Token,
},
Config: &pb.WarpWireguardConfig{
PrivateKey: wg.PrivateKey,