Skip to content

Commit

Permalink
Merge pull request #106 from mysteriumnetwork/version-1.0.45
Browse files Browse the repository at this point in the history
Version 1.0.45
  • Loading branch information
Zensey authored Jan 26, 2024
2 parents 2710581 + 0fda659 commit 405f33c
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cmd/resource/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (

var (
// fixed non-string version. used for launcher version checks
intVersion = [4]uint16{1, 0, 44, 0}
intVersion = [4]uint16{1, 0, 45, 0}
// display version
strVersion = "1.0.44"
strVersion = "1.0.45"
)

func getIcon(path string) *winres.Icon {
Expand Down
2 changes: 1 addition & 1 deletion controller/native/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewController() *Controller {
}

func (c *Controller) GetCaps() int {
return 0
return 1
}

func (c *Controller) SetApp(a model_.AppState) {
Expand Down
16 changes: 13 additions & 3 deletions controller/native/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,21 +121,31 @@ func KillPreviousLauncher() {
func (r *NodeRunner) startNode() error {
log.Println("!startNode")
fullExePath := getNodeExePath()
c := r.mod.Config
log.Println("!startNode", c.EnablePortForwarding)

portsArg := ""
if c.EnablePortForwarding {
portsArg = fmt.Sprintf("--udp.ports=%d:%d", c.PortRangeBegin, c.PortRangeEnd)
}
userspaceArg := "--userspace"
versionArg := fmt.Sprintf("--launcher.ver=%s", r.mod.GetProductVersionString())
configDirArg := fmt.Sprintf("--config-dir=%s", r.configpath)
dataDirArg := fmt.Sprintf("--data-dir=%s", r.configpath)
logDirArg := fmt.Sprintf("--log-dir=%s", r.configpath)
nodeuiDirArg := fmt.Sprintf("--node-ui-dir=%s", path.Join(r.configpath, "nodeui"))

userspaceArg := "--userspace"

args2 := make([]string, 0)
if r.mod.NodeFlags != "" {
args2 = strings.Split(r.mod.NodeFlags, " ")
}

args := []string{userspaceArg, versionArg}
args := []string{}
if portsArg != "" {
args = append(args, portsArg)
}
args = append(args, userspaceArg, versionArg)

if len(args2) > 0 {
args = append(args, args2...)
} else {
Expand Down
8 changes: 5 additions & 3 deletions gui-win32/networking_dlg.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,11 @@ func (g *Gui) NetworkingDlg() {
walk.MsgBoxTopMost|walk.MsgBoxOK|walk.MsgBoxIconExclamation)
return
}
g.model.GetConfig().EnablePortForwarding = manualPortForwarding.Checked()
g.model.GetConfig().PortRangeBegin = portRangeBegin
g.model.GetConfig().PortRangeEnd = portRangeLen
cfg := g.model.GetConfig()
cfg.EnablePortForwarding = manualPortForwarding.Checked()
cfg.PortRangeBegin = portRangeBegin
cfg.PortRangeEnd = portRangeLen
cfg.Save()

dialog.Accept()
g.model.App.TriggerAction("restart")
Expand Down
1 change: 1 addition & 0 deletions model/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ func (c *Config) Read() {

json.NewDecoder(file).Decode(&c) // for version check
c.getDefaultValues(false)
file.Seek(0, 0)
json.NewDecoder(file).Decode(&c)
}

Expand Down
15 changes: 15 additions & 0 deletions myst/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (
"io"
"log"
"os"
"path/filepath"
"runtime"
"strconv"
"strings"
"time"
Expand All @@ -24,6 +26,7 @@ import (
"github.com/docker/docker/api/types/mount"
"github.com/docker/docker/api/types/strslice"
"github.com/docker/docker/client"

"github.com/docker/go-connections/nat"
errors2 "github.com/pkg/errors"

Expand Down Expand Up @@ -60,6 +63,18 @@ type Manager struct {
}

func NewManager(model *model.UIModel) (*Manager, error) {

if runtime.GOOS == "darwin" {
// Prefer DOCKER_HOST, don't override it
_, hasDockerHost := os.LookupEnv("DOCKER_HOST")
if !hasDockerHost {
if _, err := os.Stat("/var/run/docker.sock"); os.IsNotExist(err) {
// path does not exist
os.Setenv("DOCKER_HOST", "unix://"+filepath.Join(utils.GetUserProfileDir(), ".docker/run/docker.sock"))
}
}
}

dc, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
if err != nil {
return nil, errors2.Wrap(err, ErrCouldNotConnect.Error())
Expand Down

0 comments on commit 405f33c

Please sign in to comment.