From f5a3bf4e992af6a2e3eb8b65c9ac4f775daab4aa Mon Sep 17 00:00:00 2001 From: Srinivas Baride Date: Tue, 14 Mar 2023 13:20:01 +0530 Subject: [PATCH 1/7] Update codeql.yml --- .github/workflows/codeql.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 212a2eb..417ea07 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -3,6 +3,7 @@ name: "CodeQL" on: schedule: - cron: '0 0 * * 0' + workflow_dispatch: jobs: analyze: From 9562c43aac2d03a0e07fd9cbe22de6e80778c502 Mon Sep 17 00:00:00 2001 From: Srinivas Baride Date: Tue, 14 Mar 2023 18:07:31 +0530 Subject: [PATCH 2/7] Removed unnecessary modules in encoding --- cmd/config.go | 4 +-- cmd/keys.go | 8 +++--- cmd/start.go | 13 ++++----- go.mod | 2 +- go.sum | 2 -- lite/encoding.go | 49 -------------------------------- services/v2ray/cli/config.go | 4 +-- services/wireguard/cli/config.go | 4 +-- types/keys.go | 1 + utils/{errors.go => error.go} | 0 10 files changed, 18 insertions(+), 69 deletions(-) rename utils/{errors.go => error.go} (100%) diff --git a/cmd/config.go b/cmd/config.go index 92b7258..51f5571 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -48,7 +48,7 @@ func configInit() *cobra.Command { } } - if err := os.MkdirAll(home, 0700); err != nil { + if err = os.MkdirAll(home, 0700); err != nil { return err } @@ -109,7 +109,7 @@ func configSet() *cobra.Command { v.Set(args[0], args[1]) - if err := v.Unmarshal(config); err != nil { + if err = v.Unmarshal(config); err != nil { return err } diff --git a/cmd/keys.go b/cmd/keys.go index 6416304..5ddba7b 100644 --- a/cmd/keys.go +++ b/cmd/keys.go @@ -61,7 +61,7 @@ func keysAdd() *cobra.Command { } if !skipConfigValidation { - if err := config.Validate(); err != nil { + if err = config.Validate(); err != nil { return err } } @@ -178,7 +178,7 @@ func keysShow() *cobra.Command { } if !skipConfigValidation { - if err := config.Validate(); err != nil { + if err = config.Validate(); err != nil { return err } } @@ -238,7 +238,7 @@ func keysList() *cobra.Command { } if !skipConfigValidation { - if err := config.Validate(); err != nil { + if err = config.Validate(); err != nil { return err } } @@ -300,7 +300,7 @@ func keysDelete() *cobra.Command { } if !skipConfigValidation { - if err := config.Validate(); err != nil { + if err = config.Validate(); err != nil { return err } } diff --git a/cmd/start.go b/cmd/start.go index 8e02342..7ba0e5d 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -12,7 +12,6 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/gin-contrib/cors" "github.com/gin-gonic/gin" - "github.com/go-kit/kit/transport/http/jsonrpc" "github.com/spf13/cobra" "github.com/spf13/viper" "gorm.io/driver/sqlite" @@ -73,7 +72,7 @@ func StartCmd() *cobra.Command { if !skipConfigValidation { log.Info("Validating the configuration", "data", config) - if err := config.Validate(); err != nil { + if err = config.Validate(); err != nil { return err } } @@ -162,12 +161,12 @@ func StartCmd() *cobra.Command { } log.Info("Initializing the VPN service", "type", service.Type()) - if err := service.Init(home); err != nil { + if err = service.Init(home); err != nil { return err } log.Info("Starting the VPN service", "type", service.Type()) - if err := service.Start(); err != nil { + if err = service.Start(); err != nil { return err } @@ -184,7 +183,7 @@ func StartCmd() *cobra.Command { } log.Info("Migrating the database models...") - if err := database.AutoMigrate(&types.Session{}); err != nil { + if err = database.AutoMigrate(&types.Session{}); err != nil { return err } @@ -199,7 +198,7 @@ func StartCmd() *cobra.Command { http.MethodPost, }, AllowHeaders: []string{ - jsonrpc.ContentType, + types.ContentType, }, }, ) @@ -218,7 +217,7 @@ func StartCmd() *cobra.Command { WithService(service) n := node.NewNode(ctx) - if err := n.Initialize(); err != nil { + if err = n.Initialize(); err != nil { return err } diff --git a/go.mod b/go.mod index b69fd28..eba2005 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,6 @@ require ( github.com/avast/retry-go/v4 v4.3.3 github.com/cosmos/cosmos-sdk v0.45.11 github.com/cosmos/go-bip39 v1.0.0 - github.com/cosmos/ibc-go/v3 v3.4.0 github.com/gin-contrib/cors v1.4.0 github.com/gin-gonic/gin v1.9.0 github.com/go-kit/kit v0.12.0 @@ -61,6 +60,7 @@ require ( github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-kit/kit v0.12.0 // indirect github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/go-playground/locales v0.14.1 // indirect diff --git a/go.sum b/go.sum index e7fb2fe..ab4db1c 100644 --- a/go.sum +++ b/go.sum @@ -188,8 +188,6 @@ github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4 github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.19.4 h1:t82sN+Y0WeqxDLJRSpNd8YFX5URIrT+p8n6oJbJ2Dok= github.com/cosmos/iavl v0.19.4/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= -github.com/cosmos/ibc-go/v3 v3.4.0 h1:ha3cqEG36pqMWqA1D+kxDWBTZXpeFMd/aZIQF7I0xro= -github.com/cosmos/ibc-go/v3 v3.4.0/go.mod h1:VwB/vWu4ysT5DN2aF78d17LYmx3omSAdq6gpKvM7XRA= github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= diff --git a/lite/encoding.go b/lite/encoding.go index 2ed2e79..ff0f303 100644 --- a/lite/encoding.go +++ b/lite/encoding.go @@ -5,30 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth" authvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting" - authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" - "github.com/cosmos/cosmos-sdk/x/bank" - "github.com/cosmos/cosmos-sdk/x/capability" - "github.com/cosmos/cosmos-sdk/x/crisis" - "github.com/cosmos/cosmos-sdk/x/distribution" - distributionclient "github.com/cosmos/cosmos-sdk/x/distribution/client" - "github.com/cosmos/cosmos-sdk/x/evidence" - feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module" - "github.com/cosmos/cosmos-sdk/x/genutil" - "github.com/cosmos/cosmos-sdk/x/gov" - "github.com/cosmos/cosmos-sdk/x/mint" - "github.com/cosmos/cosmos-sdk/x/params" - paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" - "github.com/cosmos/cosmos-sdk/x/slashing" - "github.com/cosmos/cosmos-sdk/x/staking" - "github.com/cosmos/cosmos-sdk/x/upgrade" - upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" - ibcica "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts" - ibctransfer "github.com/cosmos/ibc-go/v3/modules/apps/transfer" - ibc "github.com/cosmos/ibc-go/v3/modules/core" - ibcclientclient "github.com/cosmos/ibc-go/v3/modules/core/02-client/client" hubparams "github.com/sentinel-official/hub/params" - custommint "github.com/sentinel-official/hub/x/mint" - "github.com/sentinel-official/hub/x/swap" "github.com/sentinel-official/hub/x/vpn" ) @@ -38,32 +15,6 @@ func EncodingConfig() hubparams.EncodingConfig { modules = module.NewBasicManager( auth.AppModuleBasic{}, authvesting.AppModuleBasic{}, - authzmodule.AppModuleBasic{}, - bank.AppModuleBasic{}, - capability.AppModule{}, - crisis.AppModuleBasic{}, - distribution.AppModuleBasic{}, - evidence.AppModuleBasic{}, - feegrantmodule.AppModuleBasic{}, - genutil.AppModuleBasic{}, - gov.NewAppModuleBasic( - distributionclient.ProposalHandler, - ibcclientclient.UpdateClientProposalHandler, - ibcclientclient.UpgradeProposalHandler, - paramsclient.ProposalHandler, - upgradeclient.ProposalHandler, - upgradeclient.CancelProposalHandler, - ), - ibc.AppModuleBasic{}, - ibcica.AppModuleBasic{}, - ibctransfer.AppModuleBasic{}, - mint.AppModuleBasic{}, - params.AppModuleBasic{}, - slashing.AppModuleBasic{}, - staking.AppModuleBasic{}, - upgrade.AppModuleBasic{}, - custommint.AppModule{}, - swap.AppModuleBasic{}, vpn.AppModuleBasic{}, ) ) diff --git a/services/v2ray/cli/config.go b/services/v2ray/cli/config.go index 5e175c8..ea8f11c 100644 --- a/services/v2ray/cli/config.go +++ b/services/v2ray/cli/config.go @@ -49,7 +49,7 @@ func configInit() *cobra.Command { } } - if err := os.MkdirAll(home, 0700); err != nil { + if err = os.MkdirAll(home, 0700); err != nil { return err } @@ -110,7 +110,7 @@ func configSet() *cobra.Command { v.Set(args[0], args[1]) - if err := v.Unmarshal(cfg); err != nil { + if err = v.Unmarshal(cfg); err != nil { return err } diff --git a/services/wireguard/cli/config.go b/services/wireguard/cli/config.go index 73fdcef..72d7037 100644 --- a/services/wireguard/cli/config.go +++ b/services/wireguard/cli/config.go @@ -49,7 +49,7 @@ func configInit() *cobra.Command { } } - if err := os.MkdirAll(home, 0700); err != nil { + if err = os.MkdirAll(home, 0700); err != nil { return err } @@ -110,7 +110,7 @@ func configSet() *cobra.Command { v.Set(args[0], args[1]) - if err := v.Unmarshal(cfg); err != nil { + if err = v.Unmarshal(cfg); err != nil { return err } diff --git a/types/keys.go b/types/keys.go index 992343e..0581454 100644 --- a/types/keys.go +++ b/types/keys.go @@ -7,6 +7,7 @@ import ( const ( ConfigFileName = "config.toml" + ContentType = "application/json; charset=utf-8" DatabaseFileName = "data.db" IPv4CIDR = "10.8.0.2/24" IPv6CIDR = "fd86:ea04:1115::2/120" diff --git a/utils/errors.go b/utils/error.go similarity index 100% rename from utils/errors.go rename to utils/error.go From 8aa81f2fa290bd0bc78e78ba0f8ac4205e2b053b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 12:34:41 +0000 Subject: [PATCH 3/7] Bump google.golang.org/protobuf from 1.29.0 to 1.29.1 Bumps [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) from 1.29.0 to 1.29.1. - [Release notes](https://github.com/protocolbuffers/protobuf-go/releases) - [Changelog](https://github.com/protocolbuffers/protobuf-go/blob/master/release.bash) - [Commits](https://github.com/protocolbuffers/protobuf-go/compare/v1.29.0...v1.29.1) --- updated-dependencies: - dependency-name: google.golang.org/protobuf dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index eba2005..2bc8320 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/v2fly/v2ray-core/v5 v5.4.0 golang.org/x/crypto v0.7.0 google.golang.org/grpc v1.53.0 - google.golang.org/protobuf v1.29.0 + google.golang.org/protobuf v1.29.1 gorm.io/driver/sqlite v1.4.4 gorm.io/gorm v1.24.6 ) diff --git a/go.sum b/go.sum index ab4db1c..f9d9ed5 100644 --- a/go.sum +++ b/go.sum @@ -1330,8 +1330,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.29.0 h1:44S3JjaKmLEE4YIkjzexaP+NzZsudE3Zin5Njn/pYX0= -google.golang.org/protobuf v1.29.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.29.1 h1:7QBf+IK2gx70Ap/hDsOmam3GE0v9HicjfEdAxE62UoM= +google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 26ef27fb8d6d2c58eddda0b3413250d5a5eebb05 Mon Sep 17 00:00:00 2001 From: Srinivas Baride Date: Tue, 14 Mar 2023 19:50:32 +0530 Subject: [PATCH 4/7] Refactored utils package --- .dockerignore | 1 + .gitignore | 1 + cmd/start.go | 3 ++- context/context.go | 21 ++++++++++--------- {utils => libs/geoip}/geoip.go | 6 +++--- .../geoip.go => libs/geoip/types/location.go | 0 lite/query.go | 12 +++++------ node/node.go | 4 ++-- services/v2ray/types/config.go | 4 ++-- services/wireguard/types/config.go | 4 ++-- types/config.go | 4 ++-- {utils => types}/error.go | 2 +- types/session.go | 4 ++-- utils/{http/server.go => http.go} | 2 +- utils/{rand/int.go => rand.go} | 2 +- 15 files changed, 37 insertions(+), 33 deletions(-) rename {utils => libs/geoip}/geoip.go (86%) rename types/geoip.go => libs/geoip/types/location.go (100%) rename {utils => types}/error.go (92%) rename utils/{http/server.go => http.go} (98%) rename utils/{rand/int.go => rand.go} (93%) diff --git a/.dockerignore b/.dockerignore index 3abf337..22a8ee7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,5 @@ /.idea/ /.github/ +/.vscode/ /bin/ /vendor/ \ No newline at end of file diff --git a/.gitignore b/.gitignore index 424b322..9864947 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store* /.idea/ +/.vscode/ /bin/ /vendor/ \ No newline at end of file diff --git a/cmd/start.go b/cmd/start.go index 7ba0e5d..dec4729 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -20,6 +20,7 @@ import ( "github.com/sentinel-official/dvpn-node/api" "github.com/sentinel-official/dvpn-node/context" + "github.com/sentinel-official/dvpn-node/libs/geoip" "github.com/sentinel-official/dvpn-node/lite" "github.com/sentinel-official/dvpn-node/node" "github.com/sentinel-official/dvpn-node/services/v2ray" @@ -136,7 +137,7 @@ func StartCmd() *cobra.Command { } log.Info("Fetching the GeoIP location info...") - location, err := utils.FetchGeoIPLocation() + location, err := geoip.Location() if err != nil { return err } diff --git a/context/context.go b/context/context.go index 89f145e..950c729 100644 --- a/context/context.go +++ b/context/context.go @@ -10,6 +10,7 @@ import ( tmlog "github.com/tendermint/tendermint/libs/log" "gorm.io/gorm" + geoiptypes "github.com/sentinel-official/dvpn-node/libs/geoip/types" "github.com/sentinel-official/dvpn-node/lite" "github.com/sentinel-official/dvpn-node/types" ) @@ -20,7 +21,7 @@ type Context struct { config *types.Config database *gorm.DB handler http.Handler - location *types.GeoIPLocation + location *geoiptypes.GeoIPLocation logger tmlog.Logger service types.Service } @@ -29,14 +30,14 @@ func NewContext() *Context { return &Context{} } -func (c *Context) WithBandwidth(v *hubtypes.Bandwidth) *Context { c.bandwidth = v; return c } -func (c *Context) WithClient(v *lite.Client) *Context { c.client = v; return c } -func (c *Context) WithConfig(v *types.Config) *Context { c.config = v; return c } -func (c *Context) WithDatabase(v *gorm.DB) *Context { c.database = v; return c } -func (c *Context) WithHandler(v http.Handler) *Context { c.handler = v; return c } -func (c *Context) WithLocation(v *types.GeoIPLocation) *Context { c.location = v; return c } -func (c *Context) WithLogger(v tmlog.Logger) *Context { c.logger = v; return c } -func (c *Context) WithService(v types.Service) *Context { c.service = v; return c } +func (c *Context) WithBandwidth(v *hubtypes.Bandwidth) *Context { c.bandwidth = v; return c } +func (c *Context) WithClient(v *lite.Client) *Context { c.client = v; return c } +func (c *Context) WithConfig(v *types.Config) *Context { c.config = v; return c } +func (c *Context) WithDatabase(v *gorm.DB) *Context { c.database = v; return c } +func (c *Context) WithHandler(v http.Handler) *Context { c.handler = v; return c } +func (c *Context) WithLocation(v *geoiptypes.GeoIPLocation) *Context { c.location = v; return c } +func (c *Context) WithLogger(v tmlog.Logger) *Context { c.logger = v; return c } +func (c *Context) WithService(v types.Service) *Context { c.service = v; return c } func (c *Context) Address() hubtypes.NodeAddress { return c.Operator().Bytes() } func (c *Context) Bandwidth() *hubtypes.Bandwidth { return c.bandwidth } @@ -47,7 +48,7 @@ func (c *Context) Handler() http.Handler { return c.handler } func (c *Context) IntervalSetSessions() time.Duration { return c.Config().Node.IntervalSetSessions } func (c *Context) IntervalUpdateStatus() time.Duration { return c.Config().Node.IntervalUpdateStatus } func (c *Context) ListenOn() string { return c.Config().Node.ListenOn } -func (c *Context) Location() *types.GeoIPLocation { return c.location } +func (c *Context) Location() *geoiptypes.GeoIPLocation { return c.location } func (c *Context) Log() tmlog.Logger { return c.logger } func (c *Context) Moniker() string { return c.Config().Node.Moniker } func (c *Context) Operator() sdk.AccAddress { return c.client.FromAddress() } diff --git a/utils/geoip.go b/libs/geoip/geoip.go similarity index 86% rename from utils/geoip.go rename to libs/geoip/geoip.go index 0ac0474..26d2dc9 100644 --- a/utils/geoip.go +++ b/libs/geoip/geoip.go @@ -1,14 +1,14 @@ -package utils +package geoip import ( "encoding/json" "net/http" "time" - "github.com/sentinel-official/dvpn-node/types" + "github.com/sentinel-official/dvpn-node/libs/geoip/types" ) -func FetchGeoIPLocation() (*types.GeoIPLocation, error) { +func Location() (*types.GeoIPLocation, error) { var ( client = &http.Client{Timeout: 15 * time.Second} path = "http://ip-api.com/json" diff --git a/types/geoip.go b/libs/geoip/types/location.go similarity index 100% rename from types/geoip.go rename to libs/geoip/types/location.go diff --git a/lite/query.go b/lite/query.go index 97cda02..cc452eb 100644 --- a/lite/query.go +++ b/lite/query.go @@ -13,7 +13,7 @@ import ( vpntypes "github.com/sentinel-official/hub/x/vpn/types" rpchttp "github.com/tendermint/tendermint/rpc/client/http" - "github.com/sentinel-official/dvpn-node/utils" + "github.com/sentinel-official/dvpn-node/types" ) func (c *Client) queryAccount(remote string, accAddr sdk.AccAddress) (authtypes.AccountI, error) { @@ -36,7 +36,7 @@ func (c *Client) queryAccount(remote string, accAddr sdk.AccAddress) (authtypes. }, ) if err != nil { - return nil, utils.QueryError(err) + return nil, types.QueryError(err) } var result authtypes.AccountI @@ -80,7 +80,7 @@ func (c *Client) queryNode(remote string, nodeAddr hubtypes.NodeAddress) (*nodet nodetypes.NewQueryNodeRequest(nodeAddr), ) if err != nil { - return nil, utils.QueryError(err) + return nil, types.QueryError(err) } return &res.Node, nil @@ -119,7 +119,7 @@ func (c *Client) querySubscription(remote string, id uint64) (*subscriptiontypes subscriptiontypes.NewQuerySubscriptionRequest(id), ) if err != nil { - return nil, utils.QueryError(err) + return nil, types.QueryError(err) } return &res.Subscription, nil @@ -158,7 +158,7 @@ func (c *Client) queryQuota(remote string, id uint64, accAddr sdk.AccAddress) (* subscriptiontypes.NewQueryQuotaRequest(id, accAddr), ) if err != nil { - return nil, utils.QueryError(err) + return nil, types.QueryError(err) } return &res.Quota, nil @@ -197,7 +197,7 @@ func (c *Client) querySession(remote string, id uint64) (*sessiontypes.Session, sessiontypes.NewQuerySessionRequest(id), ) if err != nil { - return nil, utils.QueryError(err) + return nil, types.QueryError(err) } return &res.Session, nil diff --git a/node/node.go b/node/node.go index 8363ee6..f384a2d 100644 --- a/node/node.go +++ b/node/node.go @@ -7,7 +7,7 @@ import ( "github.com/spf13/viper" "github.com/sentinel-official/dvpn-node/context" - httputils "github.com/sentinel-official/dvpn-node/utils/http" + "github.com/sentinel-official/dvpn-node/utils" ) type Node struct { @@ -57,7 +57,7 @@ func (n *Node) Start() error { keyFile = path.Join(viper.GetString(flags.FlagHome), "tls.key") ) - return httputils.ListenAndServeTLS( + return utils.ListenAndServeTLS( n.ListenOn(), certFile, keyFile, diff --git a/services/v2ray/types/config.go b/services/v2ray/types/config.go index 50c2d4b..fdb520c 100644 --- a/services/v2ray/types/config.go +++ b/services/v2ray/types/config.go @@ -9,7 +9,7 @@ import ( "github.com/pkg/errors" "github.com/spf13/viper" - randutil "github.com/sentinel-official/dvpn-node/utils/rand" + "github.com/sentinel-official/dvpn-node/utils" ) var ( @@ -42,7 +42,7 @@ func NewVMessConfig() *VMessConfig { } func (c *VMessConfig) WithDefaultValues() *VMessConfig { - c.ListenPort = randutil.RandomPort() + c.ListenPort = utils.RandomPort() c.Transport = "grpc" return c diff --git a/services/wireguard/types/config.go b/services/wireguard/types/config.go index 5adbadd..e9438ff 100644 --- a/services/wireguard/types/config.go +++ b/services/wireguard/types/config.go @@ -9,7 +9,7 @@ import ( "github.com/pkg/errors" "github.com/spf13/viper" - randutil "github.com/sentinel-official/dvpn-node/utils/rand" + "github.com/sentinel-official/dvpn-node/utils" ) var ( @@ -68,7 +68,7 @@ func (c *Config) WithDefaultValues() *Config { } c.Interface = "wg0" - c.ListenPort = randutil.RandomPort() + c.ListenPort = utils.RandomPort() c.PrivateKey = key.String() return c diff --git a/types/config.go b/types/config.go index 58d6f3e..028474b 100644 --- a/types/config.go +++ b/types/config.go @@ -16,7 +16,7 @@ import ( hubtypes "github.com/sentinel-official/hub/types" "github.com/spf13/viper" - randutil "github.com/sentinel-official/dvpn-node/utils/rand" + "github.com/sentinel-official/dvpn-node/utils" ) const ( @@ -346,7 +346,7 @@ func (c *NodeConfig) WithDefaultValues() *NodeConfig { c.IntervalSetSessions = 10 * time.Second c.IntervalUpdateSessions = MaxIntervalUpdateSessions c.IntervalUpdateStatus = MaxIntervalUpdateStatus - c.ListenOn = fmt.Sprintf("0.0.0.0:%d", randutil.RandomPort()) + c.ListenOn = fmt.Sprintf("0.0.0.0:%d", utils.RandomPort()) c.Type = "wireguard" return c diff --git a/utils/error.go b/types/error.go similarity index 92% rename from utils/error.go rename to types/error.go index 6c7198c..45ab53a 100644 --- a/utils/error.go +++ b/types/error.go @@ -1,4 +1,4 @@ -package utils +package types import ( "google.golang.org/grpc/codes" diff --git a/types/session.go b/types/session.go index 89f1867..5d89060 100644 --- a/types/session.go +++ b/types/session.go @@ -21,10 +21,10 @@ func (s *Session) GetAddress() sdk.AccAddress { return nil } - address, err := sdk.AccAddressFromBech32(s.Address) + v, err := sdk.AccAddressFromBech32(s.Address) if err != nil { panic(err) } - return address + return v } diff --git a/utils/http/server.go b/utils/http.go similarity index 98% rename from utils/http/server.go rename to utils/http.go index ec5430f..1c6d7c6 100644 --- a/utils/http/server.go +++ b/utils/http.go @@ -1,4 +1,4 @@ -package http +package utils import ( "crypto/rand" diff --git a/utils/rand/int.go b/utils/rand.go similarity index 93% rename from utils/rand/int.go rename to utils/rand.go index c35085f..fc79287 100644 --- a/utils/rand/int.go +++ b/utils/rand.go @@ -1,4 +1,4 @@ -package rand +package utils import ( "crypto/rand" From 8f6e8365dfe5dbcd10371eaccb281c972d919710 Mon Sep 17 00:00:00 2001 From: Srinivas Baride Date: Tue, 14 Mar 2023 20:21:27 +0530 Subject: [PATCH 5/7] Moved WriteKeys to utils --- cmd/keys.go | 38 +++++++++----------------------------- go.mod | 1 - utils/keys.go | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 30 deletions(-) create mode 100644 utils/keys.go diff --git a/cmd/keys.go b/cmd/keys.go index 5ddba7b..e0622a7 100644 --- a/cmd/keys.go +++ b/cmd/keys.go @@ -4,20 +4,19 @@ import ( "bufio" "fmt" "path/filepath" - "text/tabwriter" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/input" - "github.com/cosmos/cosmos-sdk/crypto/hd" + cryptohd "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/go-bip39" "github.com/pkg/errors" - hubtypes "github.com/sentinel-official/hub/types" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/sentinel-official/dvpn-node/types" + "github.com/sentinel-official/dvpn-node/utils" ) func KeysCmd() *cobra.Command { @@ -121,27 +120,20 @@ func keysAdd() *cobra.Command { } var ( - hdPath = hd.CreateHDPath(sdk.GetConfig().GetCoinType(), account, index) - algorithms, _ = kr.SupportedAlgorithms() + coinType = sdk.GetConfig().GetCoinType() + path = cryptohd.CreateHDPath(coinType, account, index) ) - algorithm, err := keyring.NewSigningAlgoFromString(string(hd.Secp256k1Type), algorithms) + key, err := kr.NewAccount(name, mnemonic, "", path.String(), cryptohd.Secp256k1) if err != nil { return err } - key, err := kr.NewAccount(name, mnemonic, "", hdPath.String(), algorithm) - if err != nil { - return err - } - - _, _ = fmt.Fprintf(cmd.ErrOrStderr(), "operator: %s\n", key.GetAddress()) - _, _ = fmt.Fprintf(cmd.ErrOrStderr(), "address: %s\n", hubtypes.NodeAddress(key.GetAddress())) - _, _ = fmt.Fprintf(cmd.ErrOrStderr(), "\n") _, _ = fmt.Fprintf(cmd.ErrOrStderr(), "**Important** write this mnemonic phrase in a safe place\n") _, _ = fmt.Fprintf(cmd.ErrOrStderr(), "%s\n", mnemonic) + _, _ = fmt.Fprintf(cmd.ErrOrStderr(), "\n") - return nil + return utils.WriteKeys(cmd.OutOrStdout(), key) }, } @@ -202,10 +194,7 @@ func keysShow() *cobra.Command { return err } - fmt.Printf("operator: %s\n", key.GetAddress()) - fmt.Printf("address: %s\n", hubtypes.NodeAddress(key.GetAddress())) - - return nil + return utils.WriteKeys(cmd.OutOrStdout(), key) }, } @@ -257,16 +246,7 @@ func keysList() *cobra.Command { return err } - w := tabwriter.NewWriter(cmd.OutOrStdout(), 1, 1, 1, ' ', 0) - for _, key := range keys { - _, _ = fmt.Fprintf(w, "%s\t%s\t%s\n", - key.GetName(), - key.GetAddress(), - hubtypes.NodeAddress(key.GetAddress().Bytes()), - ) - } - - return w.Flush() + return utils.WriteKeys(cmd.OutOrStdout(), keys...) }, } diff --git a/go.mod b/go.mod index 2bc8320..9656081 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,6 @@ require ( github.com/cosmos/go-bip39 v1.0.0 github.com/gin-contrib/cors v1.4.0 github.com/gin-gonic/gin v1.9.0 - github.com/go-kit/kit v0.12.0 github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.29.0 github.com/sentinel-official/hub v0.10.1 diff --git a/utils/keys.go b/utils/keys.go new file mode 100644 index 0000000..ad1e592 --- /dev/null +++ b/utils/keys.go @@ -0,0 +1,37 @@ +package utils + +import ( + "fmt" + "io" + "text/tabwriter" + + "github.com/cosmos/cosmos-sdk/crypto/keyring" + hubtypes "github.com/sentinel-official/hub/types" +) + +func WriteKeys(w io.Writer, keys ...keyring.Info) error { + tw := tabwriter.NewWriter(w, 1, 1, 1, ' ', 0) + if _, err := fmt.Fprintf( + tw, "%s\t%s\t%s\n", + "Name", "Address", "Operator", + ); err != nil { + return err + } + + for i := 0; i < len(keys); i++ { + var ( + name = keys[i].GetName() + address = hubtypes.NodeAddress(keys[i].GetAddress().Bytes()).String() + operator = keys[i].GetAddress().String() + ) + + if _, err := fmt.Fprintf( + tw, "%s\t%s\t%s\n", + name, address, operator, + ); err != nil { + return err + } + } + + return tw.Flush() +} From afefe79f4c916ab367961abda130a45f20f53f25 Mon Sep 17 00:00:00 2001 From: Srinivas Baride Date: Sat, 18 Mar 2023 10:52:36 +0530 Subject: [PATCH 6/7] Bumped dependency speedtest-go --- go.mod | 2 +- go.sum | 4 ++-- utils/speedtest.go | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index b40701c..8cd556c 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.29.0 github.com/sentinel-official/hub v0.10.1 - github.com/showwin/speedtest-go v1.5.2 + github.com/showwin/speedtest-go v1.6.0 github.com/soheilhy/cmux v0.1.5 github.com/spf13/cobra v1.6.1 github.com/spf13/viper v1.15.0 diff --git a/go.sum b/go.sum index b0522af..5e3ddf7 100644 --- a/go.sum +++ b/go.sum @@ -784,8 +784,8 @@ github.com/seiflotfy/cuckoofilter v0.0.0-20220411075957-e3b120b3f5fb/go.mod h1:b github.com/sentinel-official/hub v0.10.1 h1:DcXrd7dGJnbRS0r7uOltzjATo2ImuPqLrRsSfaxa6G4= github.com/sentinel-official/hub v0.10.1/go.mod h1:WX64FXc/7qNnE2I3yOMjcKeek02zE/mZFbZvJBweOHk= github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/showwin/speedtest-go v1.5.2 h1:drXsmaGC36VXi6biSZ+vyo/tYCkaoTU2mAF2b6wQmlk= -github.com/showwin/speedtest-go v1.5.2/go.mod h1:Y7c+pxzaNAlo4mYP+x83pnYY8IM3bkHGDhTdrgUnkNE= +github.com/showwin/speedtest-go v1.6.0 h1:WEL7957o8Y/wrUsZdcVNcCCH0nKdBHeYoR3lmU8XOtc= +github.com/showwin/speedtest-go v1.6.0/go.mod h1:XuGWHfAyS57C+8bKUxrDM696ffrQtgi01r7l8wipw9I= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= diff --git a/utils/speedtest.go b/utils/speedtest.go index 89a55d7..fe66a0e 100644 --- a/utils/speedtest.go +++ b/utils/speedtest.go @@ -9,12 +9,12 @@ import ( ) func FindInternetSpeed() (*hubtypes.Bandwidth, error) { - user, err := speedtest.FetchUserInfo() + _, err := speedtest.FetchUserInfo() if err != nil { return nil, err } - servers, err := speedtest.FetchServers(user) + servers, err := speedtest.FetchServers() if err != nil { return nil, err } @@ -31,7 +31,7 @@ func FindInternetSpeed() (*hubtypes.Bandwidth, error) { for _, s := range servers { s.Context.Reset() - if err = s.PingTest(); err != nil { + if err = s.PingTest(nil); err != nil { continue } @@ -39,9 +39,11 @@ func FindInternetSpeed() (*hubtypes.Bandwidth, error) { continue } s.Context.Wait() + if err = s.UploadTest(); err != nil { continue } + s.Context.Wait() upload = sdk.MustNewDecFromStr(fmt.Sprintf("%f", s.ULSpeed)) download = sdk.MustNewDecFromStr(fmt.Sprintf("%f", s.DLSpeed)) From 3d0aad7c939a8d8f2c34f39b185e3298a2ee71cc Mon Sep 17 00:00:00 2001 From: Srinivas Baride Date: Mon, 20 Mar 2023 11:40:59 +0530 Subject: [PATCH 7/7] Updated dependencies --- go.mod | 6 +++--- go.sum | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 8cd556c..9e2a5ef 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/spf13/cobra v1.6.1 github.com/spf13/viper v1.15.0 github.com/tendermint/tendermint v0.34.23 - github.com/v2fly/v2ray-core/v5 v5.4.0 + github.com/v2fly/v2ray-core/v5 v5.4.1 golang.org/x/crypto v0.7.0 google.golang.org/grpc v1.53.0 google.golang.org/protobuf v1.30.0 @@ -64,8 +64,8 @@ require ( github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect - github.com/go-playground/validator/v10 v10.11.2 // indirect - github.com/goccy/go-json v0.10.1 // indirect + github.com/go-playground/validator/v10 v10.12.0 // indirect + github.com/goccy/go-json v0.10.2 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/gogo/gateway v1.1.0 // indirect github.com/gogo/protobuf v1.3.3 // indirect diff --git a/go.sum b/go.sum index 5e3ddf7..e88b902 100644 --- a/go.sum +++ b/go.sum @@ -136,6 +136,7 @@ github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= +github.com/bufbuild/protocompile v0.2.1-0.20230123224550-da57cd758c2f h1:IXSA5gow10s7zIOJfPOpXDtNBWCTA0715BDAhoJBXEs= github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= github.com/bytedance/sonic v1.8.5 h1:kjX0/vo5acEQ/sinD/18SkA/lDDUk23F0RcaHvI7omc= github.com/bytedance/sonic v1.8.5/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= @@ -307,8 +308,8 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= -github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= -github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= +github.com/go-playground/validator/v10 v10.12.0 h1:E4gtWgxWxp8YSxExrQFv5BpCahla0PVF2oTTEYaWQGI= +github.com/go-playground/validator/v10 v10.12.0/go.mod h1:hCAPuzYvKdP33pxWa+2+6AIKXEKqjIUyqsNCtbsSJrA= github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= @@ -320,8 +321,8 @@ github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6Wezm github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/goccy/go-json v0.10.1 h1:lEs5Ob+oOG/Ze199njvzHbhn6p9T+h64F5hRj69iTTo= -github.com/goccy/go-json v0.10.1/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= @@ -490,7 +491,7 @@ github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jhump/protoreflect v1.14.0 h1:MBbQK392K3u8NTLbKOCIi3XdI+y+c6yt5oMq0X3xviw= +github.com/jhump/protoreflect v1.15.0 h1:U5T5/2LF0AZQFP9T4W5GfBjBaTruomrKobiR4E+oA/Q= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.4/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= @@ -740,13 +741,13 @@ github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0 github.com/quic-go/qtls-go1-18 v0.2.0 h1:5ViXqBZ90wpUcZS0ge79rf029yx0dYB0McyPJwqqj7U= github.com/quic-go/qtls-go1-19 v0.2.1 h1:aJcKNMkH5ASEJB9FXNeZCyTEIHU1J7MmHyz1Q1TSG1A= github.com/quic-go/qtls-go1-20 v0.1.1 h1:KbChDlg82d3IHqaj2bn6GfKRj84Per2VGf5XV3wSwQk= -github.com/quic-go/quic-go v0.32.0 h1:lY02md31s1JgPiiyfqJijpu/UX/Iun304FI3yUqX7tA= +github.com/quic-go/quic-go v0.33.0 h1:ItNoTDN/Fm/zBlq769lLJc8ECe9gYaW40veHCCco7y0= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/refraction-networking/utls v1.2.2 h1:uBE6V173CwG8MQrSBpNZHAix1fxOvuLKYyjFAu3uqo0= +github.com/refraction-networking/utls v1.3.1 h1:3zVomUqx7nCmyGuU/6kYA/jp5NcqX8KQSGko8pY5Ch4= github.com/regen-network/cosmos-proto v0.3.1 h1:rV7iM4SSFAagvy8RiyhiACbWEGotmqzywPxOvwMdxcg= github.com/regen-network/cosmos-proto v0.3.1/go.mod h1:jO0sVX6a1B36nmE8C9xBFXpNwWejXC7QqCOnH3O0+YM= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= @@ -883,8 +884,8 @@ github.com/v2fly/BrowserBridge v0.0.0-20210430233438-0570fc1d7d08 h1:4Yh46CVE3k/ github.com/v2fly/VSign v0.0.0-20201108000810-e2adc24bf848 h1:p1UzXK6VAutXFFQMnre66h7g1BjRKUnLv0HfmmRoz7w= github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e h1:5QefA066A1tF8gHIiADmOVOV5LS43gt3ONnlEl3xkwI= github.com/v2fly/ss-bloomring v0.0.0-20210312155135-28617310f63e/go.mod h1:5t19P9LBIrNamL6AcMQOncg/r10y3Pc01AbHeMhwlpU= -github.com/v2fly/v2ray-core/v5 v5.4.0 h1:MbsXS8DtjN2HDpmv37ZxuaRhEPshkwYBWPCgzmHKpBA= -github.com/v2fly/v2ray-core/v5 v5.4.0/go.mod h1:VCQWeAX8WIYbptEK+ZnjtNYkFLxZyn6iJQ7jLgiJMu8= +github.com/v2fly/v2ray-core/v5 v5.4.1 h1:1l3KIFKoOlZkUp6D9MUlN/gz6aOEx09YfRVmnwnoGIQ= +github.com/v2fly/v2ray-core/v5 v5.4.1/go.mod h1:8JUFMS/1biOF9rWV7V5IU3NKU8GhCd442MqW3DgdFKw= github.com/vmihailenco/msgpack/v5 v5.1.4/go.mod h1:C5gboKD0TJPqWDTVTtrQNfRbiBwHZGo8UTqP/9/XvLI= github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees=