Skip to content

Commit

Permalink
disable public autoconnect logic for config gen -b (#1440)
Browse files Browse the repository at this point in the history
* config gen -b disable public autoconnect if dmsg is used

* fix link in changelog

* reflect changed variable name isDisablePublicAutoConn in declaration

* make format

* fix goimports errors in appveyor

* add accidentally omitted variable declaration
  • Loading branch information
0pcom authored Jan 20, 2023
1 parent 393b8ce commit 4add537
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## 1.3.0

- disable public autoconnect logic for `config gen -b` [#1440](https://github.com/skycoin/skywire/pull/1440)
- Add changelog generation script [#1439](https://github.com/skycoin/skywire/pull/1439)
- Fix GetRewardAddress API [#1438](https://github.com/skycoin/skywire/pull/1438)
- fix release issues [#1432](https://github.com/skycoin/skywire/pull/1432) [#1434](https://github.com/skycoin/skywire/pull/1434) [#1433](https://github.com/skycoin/skywire/pull/1433)
Expand Down
8 changes: 5 additions & 3 deletions cmd/skywire-cli/commands/config/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func init() {
gHiddenFlags = append(gHiddenFlags, "url")
genConfigCmd.Flags().StringVar(&logLevel, "log-level", "info", "level of logging in config")
gHiddenFlags = append(gHiddenFlags, "log-level")
genConfigCmd.Flags().BoolVarP(&isBestProtocol, "bestproto", "b", false, "best protocol (dmsg | direct) based on location")
genConfigCmd.Flags().BoolVarP(&isBestProtocol, "bestproto", "b", false, "best protocol (dmsg | direct) based on location") //this will also disable public autoconnect based on location
genConfigCmd.Flags().BoolVarP(&isDisableAuth, "noauth", "c", false, "disable authentication for hypervisor UI")
gHiddenFlags = append(gHiddenFlags, "noauth")
genConfigCmd.Flags().BoolVarP(&isDmsgHTTP, "dmsghttp", "d", false, "use dmsg connection to skywire services")
Expand Down Expand Up @@ -80,7 +80,7 @@ func init() {
gHiddenFlags = append(gHiddenFlags, "hide")
genConfigCmd.Flags().BoolVarP(&isRetainHypervisors, "retainhv", "x", false, "retain existing hypervisors with regen")
gHiddenFlags = append(gHiddenFlags, "retainhv")
genConfigCmd.Flags().BoolVarP(&isPublicAutoConn, "autoconn", "y", false, "disable autoconnect to public visors")
genConfigCmd.Flags().BoolVarP(&disablePublicAutoConn, "autoconn", "y", false, "disable autoconnect to public visors")
gHiddenFlags = append(gHiddenFlags, "hide")
genConfigCmd.Flags().BoolVarP(&isPublic, "public", "z", false, "publicize visor in service discovery")
gHiddenFlags = append(gHiddenFlags, "public")
Expand Down Expand Up @@ -247,7 +247,9 @@ var genConfigCmd = &cobra.Command{

//determine best protocol
if isBestProtocol && netutil.LocalProtocol() {
disablePublicAutoConn = true
isDmsgHTTP = true

}

//create the conf
Expand Down Expand Up @@ -372,7 +374,7 @@ var genConfigCmd = &cobra.Command{
if ver != "" {
conf.Common.Version = ver
}
if isPublicAutoConn {
if disablePublicAutoConn {
conf.Transport.PublicAutoconnect = false
}
if isPublic {
Expand Down
2 changes: 1 addition & 1 deletion cmd/skywire-cli/commands/config/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var (
conf *visorconfig.V1
isUsr bool
isPublic bool
isPublicAutoConn bool
disablePublicAutoConn bool
isDisplayNodeIP bool
addExampleApps bool
)
Expand Down
1 change: 0 additions & 1 deletion cmd/skywire-cli/commands/visor/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/spf13/cobra"

clirpc "github.com/skycoin/skywire/cmd/skywire-cli/commands/rpc"

"github.com/skycoin/skywire/cmd/skywire-cli/internal"
"github.com/skycoin/skywire/pkg/visor"
)
Expand Down
3 changes: 1 addition & 2 deletions cmd/skywire-systray/skywire-systray.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ import (
"sync"
"time"

"github.com/skycoin/systray"

"github.com/bitfield/script"
cc "github.com/ivanpirog/coloredcobra"
"github.com/skycoin/skycoin/src/util/logging"
"github.com/skycoin/systray"
"github.com/spf13/cobra"

"github.com/skycoin/skywire/pkg/visor/visorconfig"
Expand Down
3 changes: 1 addition & 2 deletions pkg/visor/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ import (
"sync/atomic"
"time"

"github.com/skycoin/systray"

"github.com/gen2brain/dlgs"
"github.com/sirupsen/logrus"
"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/dmsghttp"
"github.com/skycoin/systray"
"github.com/toqueteos/webbrowser"

"github.com/skycoin/skywire-utilities/pkg/cipher"
Expand Down

0 comments on commit 4add537

Please sign in to comment.