Skip to content

Commit

Permalink
fix: sync functions made password not correct (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
DVKunion authored Apr 2, 2024
1 parent 4064452 commit edddb49
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pkg/api/service/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,16 @@ func (t *tunnel) CreateTunnel(ctx context.Context, obj *models.Tunnel) (*models.
}

// 手动填充账户与密码
obj.Config.V2rayUid = tools.GenerateUUID()
obj.Config.SSRPass = tools.GenerateRandomString(12)
if obj.Config.V2rayUid == "" {
obj.Config.V2rayUid = tools.GenerateUUID()
}
if obj.Config.SSRPass == "" {
obj.Config.SSRPass = tools.GenerateRandomString(12)
}
// todo: 开放认证
obj.Config.SSRCrypt = "aes-256-gcm"
if obj.Config.SSRCrypt == "" {
obj.Config.SSRCrypt = "aes-256-gcm"
}

if err = dao.Q.Tunnel.WithContext(ctx).Create(obj); err != nil {
return nil, err
Expand Down

0 comments on commit edddb49

Please sign in to comment.