Skip to content

Commit

Permalink
Merge pull request #1663 from mrpalide/fix/update-dmsg-for-using-dmsg…
Browse files Browse the repository at this point in the history
…curl-instead-dmsgget

replace dmsgget with dmsgcurl lib
  • Loading branch information
jdknives authored Nov 20, 2023
2 parents 826a287 + e04fef7 commit 4c03bd4
Show file tree
Hide file tree
Showing 15 changed files with 69 additions and 50 deletions.
10 changes: 5 additions & 5 deletions cmd/skywire-cli/commands/log/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

"github.com/hashicorp/go-version"
"github.com/sirupsen/logrus"
"github.com/skycoin/dmsg/pkg/dmsgget"
"github.com/skycoin/dmsg/pkg/dmsgcurl"
"github.com/skycoin/dmsg/pkg/dmsghttp"
"github.com/spf13/cobra"

Expand Down Expand Up @@ -64,8 +64,8 @@ func init() {
logCmd.Flags().Int64Var(&maxFileSize, "maxfilesize", 30, "maximum file size allowed to download during collecting logs, in KB")
logCmd.Flags().StringVarP(&dmsgDisc, "dmsg-disc", "D", skyenv.DmsgDiscAddr, "dmsg discovery url\n")
logCmd.Flags().StringVarP(&utAddr, "ut", "u", "", "custom uptime tracker url")
if os.Getenv("DMSGGET_SK") != "" {
sk.Set(os.Getenv("DMSGGET_SK")) //nolint
if os.Getenv("DMSGCURL_SK") != "" {
sk.Set(os.Getenv("DMSGCURL_SK")) //nolint
}
logCmd.Flags().VarP(&sk, "sk", "s", "a random key is generated if unspecified\n\r")
}
Expand Down Expand Up @@ -104,8 +104,8 @@ var logCmd = &cobra.Command{
return
}

// Create dmsgget instance
dg := dmsgget.New(flag.CommandLine)
// Create dmsgcurl instance
dg := dmsgcurl.New(flag.CommandLine)
flag.Parse()

// Set the uptime tracker to fetch data from
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/pterm/pterm v0.12.66
github.com/shirou/gopsutil/v3 v3.23.7
github.com/sirupsen/logrus v1.9.3
github.com/skycoin/dmsg v1.3.11
github.com/skycoin/dmsg v1.3.12-0.20231111152802-3c042d8f6c21
github.com/skycoin/skycoin v0.27.1
github.com/skycoin/skywire-utilities v1.3.11
github.com/skycoin/systray v1.10.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnj
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/skycoin/dmsg v1.3.11 h1:l2T8SuAHYrrgCfzgJIqaT/9rwlBgTyRwsfNOBbsWCX0=
github.com/skycoin/dmsg v1.3.11/go.mod h1:3j74fE5sFiMJoMfqF9qGhC6GVRqCMkX4l2EHc0OQkGc=
github.com/skycoin/dmsg v1.3.12-0.20231111152802-3c042d8f6c21 h1:ehAHmE4ceLbDs/5hA0K6oqS7ElsldQAXq3GFIhjz7XA=
github.com/skycoin/dmsg v1.3.12-0.20231111152802-3c042d8f6c21/go.mod h1:ixYNFSndWFIID5MyRnJsDwv3gtq9yhS9yfZVWlbLifw=
github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6 h1:1Nc5EBY6pjfw1kwW0duwyG+7WliWz5u9kgk1h5MnLuA=
github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:UXghlricA7J3aRD/k7p/zBObQfmBawwCxIVPVjz2Q3o=
github.com/skycoin/skycoin v0.27.1 h1:HatxsRwVSPaV4qxH6290xPBmkH/HgiuAoY2qC+e8C9I=
Expand Down
4 changes: 2 additions & 2 deletions internal/vpn/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strconv"
"strings"

"github.com/skycoin/dmsg/pkg/dmsgget"
"github.com/skycoin/dmsg/pkg/dmsgcurl"

"github.com/skycoin/skywire-utilities/pkg/cipher"
)
Expand Down Expand Up @@ -137,7 +137,7 @@ func ParseIP(addr string) (net.IP, bool, error) {
if addr == "" {
return nil, false, nil
}
var url dmsgget.URL
var url dmsgcurl.URL

// in case dmsghttp url is provided
err := url.Fill(addr)
Expand Down
4 changes: 2 additions & 2 deletions pkg/visor/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/skycoin/dmsg/pkg/direct"
dmsgdisc "github.com/skycoin/dmsg/pkg/disc"
"github.com/skycoin/dmsg/pkg/dmsg"
"github.com/skycoin/dmsg/pkg/dmsgget"
"github.com/skycoin/dmsg/pkg/dmsgcurl"
"github.com/skycoin/dmsg/pkg/dmsghttp"
"github.com/skycoin/systray"
"github.com/toqueteos/webbrowser"
Expand Down Expand Up @@ -314,7 +314,7 @@ func getAvailPublicVPNServers(conf *visorconfig.V1, httpC *http.Client, logger *
}

func getSystrayHTTPClient(ctx context.Context, conf *visorconfig.V1, logger *logging.MasterLogger) *http.Client {
var serviceURL dmsgget.URL
var serviceURL dmsgcurl.URL
serviceURL.Fill(conf.Launcher.ServiceDisc) //nolint
if serviceURL.Scheme == "dmsg" {
var keys cipher.PubKeys
Expand Down
8 changes: 4 additions & 4 deletions pkg/visor/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
dmsgdisc "github.com/skycoin/dmsg/pkg/disc"
"github.com/skycoin/dmsg/pkg/dmsg"
"github.com/skycoin/dmsg/pkg/dmsgctrl"
"github.com/skycoin/dmsg/pkg/dmsgget"
"github.com/skycoin/dmsg/pkg/dmsgcurl"
"github.com/skycoin/dmsg/pkg/dmsghttp"
"github.com/skycoin/dmsg/pkg/dmsgpty"

Expand Down Expand Up @@ -469,7 +469,7 @@ func initDmsgTrackers(ctx context.Context, v *Visor, _ *logging.Logger) error {

func initSudphClient(ctx context.Context, v *Visor, log *logging.Logger) error {

var serviceURL dmsgget.URL
var serviceURL dmsgcurl.URL
_ = serviceURL.Fill(v.conf.Transport.AddressResolver) //nolint:errcheck
// don't start sudph if we are connection to AR via dmsghttp
if serviceURL.Scheme == "dmsg" {
Expand Down Expand Up @@ -1588,7 +1588,7 @@ func getErrors(ctx context.Context) chan error {

func getHTTPClient(ctx context.Context, v *Visor, service string) (*http.Client, error) {

var serviceURL dmsgget.URL
var serviceURL dmsgcurl.URL
var delegatedServers []cipher.PubKey
err := serviceURL.Fill(service)

Expand Down Expand Up @@ -1628,7 +1628,7 @@ func getHTTPClient(ctx context.Context, v *Visor, service string) (*http.Client,
}

func getPublicIP(v *Visor, service string) (string, error) {
var serviceURL dmsgget.URL
var serviceURL dmsgcurl.URL
var pIP string
err := serviceURL.Fill(service)
// only get the IP if the url is of dmsg
Expand Down
14 changes: 7 additions & 7 deletions vendor/github.com/skycoin/dmsg/pkg/direct/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 22 additions & 4 deletions vendor/github.com/skycoin/dmsg/pkg/dmsg/server.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/github.com/skycoin/dmsg/pkg/dmsghttp/http.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/github.com/skycoin/dmsg/pkg/dmsgtest/env.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4c03bd4

Please sign in to comment.