diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6bd5f45..1c3a294 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,14 +22,13 @@ jobs: with: go-version: 1.17 - - name: "Build" run: | pushd .. git clone https://github.com/mysteriumnetwork/myst-launcher pushd myst-launcher git fetch --all --tags - git checkout tags/1.0.30 + git checkout tags/1.0.36-mac popd popd @@ -94,6 +93,7 @@ jobs: uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: + prerelease: true files: | mysterium_launcher_macos.dmg env: diff --git a/gobridge/go.mod b/gobridge/go.mod index b28f0d6..cbc9c78 100644 --- a/gobridge/go.mod +++ b/gobridge/go.mod @@ -2,6 +2,11 @@ module github.com/mysteriumnetwork/fff go 1.16 -require github.com/mysteriumnetwork/myst-launcher v0.0.0 +require ( + code.cloudfoundry.org/archiver v0.0.0-20220328120804-99329f9bbb8b // indirect + github.com/docker/go-connections v0.4.0 // indirect + github.com/mysteriumnetwork/myst-launcher v0.0.0 + github.com/sirupsen/logrus v1.8.1 // indirect +) replace github.com/mysteriumnetwork/myst-launcher => ../../myst-launcher diff --git a/gobridge/go.sum b/gobridge/go.sum index 51c04b7..1082e76 100644 --- a/gobridge/go.sum +++ b/gobridge/go.sum @@ -22,6 +22,8 @@ cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIA cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +code.cloudfoundry.org/archiver v0.0.0-20220328120804-99329f9bbb8b h1:Np7cHsChFfUO+7YW8XhrgroiSlrFfAH4S4ClTilRLec= +code.cloudfoundry.org/archiver v0.0.0-20220328120804-99329f9bbb8b/go.mod h1:FmRz8OtDs+EU1y/BNvHeGzVOW92ieW5OAB5cZXKWXe8= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= @@ -38,6 +40,7 @@ github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935 github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= @@ -72,6 +75,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/artdarek/go-unzip v1.0.0 h1:Ja9wfhiXyl67z5JT37rWjTSb62KXDP+9jHRkdSREUvg= +github.com/artdarek/go-unzip v1.0.0/go.mod h1:KhX4LV7e4UwWCTo7orBYnJ6LJ/dZTI6jXxUg69hO/C8= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP9/R33ZaagQtAM4EkkSYnIAlOG5EI8gkM= github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= @@ -118,6 +123,8 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/codingsince1985/checksum v1.2.4 h1:kQUpBE1b43jrthLR/RYO4ucEXcZJCq3LpGsMfPDVJYQ= +github.com/codingsince1985/checksum v1.2.4/go.mod h1:c9FdM+lYMC4fx7uCOy+0DQaFWM6sbU9R/jnm9AHZD50= github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= github.com/containerd/aufs v0.0.0-20210316121734-20793ff83c97/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= @@ -223,6 +230,8 @@ github.com/creachadair/staticfile v0.1.3/go.mod h1:a3qySzCIXEprDGxk6tSxSI+dBBdLz github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= +github.com/cyphar/filepath-securejoin v0.2.3 h1:YX6ebbZCZP7VkM3scTTokDgBL2TY741X51MTk3ycuNI= +github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= @@ -298,6 +307,7 @@ github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8 github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/godbus/dbus v0.0.0-20151105175453-c7fdd8b5cd55/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= @@ -349,10 +359,14 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/cabbie v1.0.2 h1:UtB+Nn6fPB43wGg5xs4tgU+P3hTZ6KsulgtaHtqZZfs= github.com/google/cabbie v1.0.2/go.mod h1:6MmHaUrgfabehCHAIaxdrbmvHSxUVXj3Abs08FMABSo= +github.com/google/cabbie v1.0.3 h1:Drn0UIVTkmjUiq/Sty8sJyd/6GXAH2CmW+hdSuoKTWU= +github.com/google/cabbie v1.0.3/go.mod h1:6MmHaUrgfabehCHAIaxdrbmvHSxUVXj3Abs08FMABSo= github.com/google/glazier v0.0.0-20210617205946-bf91b619f5d4/go.mod h1:g7oyIhindbeebnBh0hbFua5rv6XUt/nweDwIWdvxirg= github.com/google/glazier v0.0.0-20211029225403-9f766cca891d/go.mod h1:h2R3DLUecGbLSyi6CcxBs5bdgtJhgK+lIffglvAcGKg= github.com/google/glazier v0.0.0-20211213200644-0506347f83ee h1:0bF6euv4SrrpV0UvSLTQnjdEHH9Det00RTfoC83HjDk= github.com/google/glazier v0.0.0-20211213200644-0506347f83ee/go.mod h1:h2R3DLUecGbLSyi6CcxBs5bdgtJhgK+lIffglvAcGKg= +github.com/google/glazier v0.0.0-20220830195856-e8bb738d64fd h1:pdu2dZ/5le8rUjujomxT5fT7oWxOhjI6GTlltQb6kEY= +github.com/google/glazier v0.0.0-20220830195856-e8bb738d64fd/go.mod h1:h2R3DLUecGbLSyi6CcxBs5bdgtJhgK+lIffglvAcGKg= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -375,6 +389,7 @@ github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OI github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -413,7 +428,10 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/iamacarpet/go-win64api v0.0.0-20210311141720-fe38760bed28/go.mod h1:oGJx9dz0Ny7HC7U55RZ0Smd6N9p3hXP/+hOFtuYrAxM= github.com/iamacarpet/go-win64api v0.0.0-20211130162011-82e31fe23f80 h1:UOuVxO8DxSote09McZFyO1Wxd/DA93gfHiNReP7c5wU= github.com/iamacarpet/go-win64api v0.0.0-20211130162011-82e31fe23f80/go.mod h1:B7zFQPAznj+ujXel5X+LUoK3LgY6VboCdVYHZNn7gpg= +github.com/iamacarpet/go-win64api v0.0.0-20220720120512-241a9064deec h1:y9s6kHAovwyzFLhemqf99/gG1fLTmd8LpyQEMlasj/A= +github.com/iamacarpet/go-win64api v0.0.0-20220720120512-241a9064deec/go.mod h1:B7zFQPAznj+ujXel5X+LUoK3LgY6VboCdVYHZNn7gpg= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.10/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= @@ -489,7 +507,10 @@ github.com/mysteriumnetwork/go-fileversion v1.0.0-fix1 h1:5hXvl45QKdd+IY9rVbFLnZ github.com/mysteriumnetwork/go-fileversion v1.0.0-fix1/go.mod h1:VM+SiWjSJROa/fvPsFV24bWoHcCvyXnI0mmwKv9dVjc= github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= +github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= +github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -499,12 +520,18 @@ github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -656,6 +683,7 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= @@ -686,6 +714,9 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871 h1:/pEO3GD/ABYAjuakUS6xSEmmlyVS4kxBNkeA9tLJiTI= +golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -696,6 +727,7 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp/typeparams v0.0.0-20220218215828-6cf2b201936e/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20201208152932-35266b937fa6/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -717,6 +749,7 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -754,9 +787,14 @@ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211118161319-6a13c67c3ce4 h1:DZshvxDdVoeKIbudAdFEKi+f70l51luSy/7b76ibTY0= golang.org/x/net v0.0.0-20211118161319-6a13c67c3ce4/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -771,6 +809,7 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -830,6 +869,7 @@ golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -837,14 +877,20 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210601080250-7ecdf8ef093b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211107104306-e0b2ad06fe42/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211213223007-03aa0b5f6827 h1:A0Qkn7Z/n8zC1xd9LTw17AiKlBRK64tw3ejWQiEqca0= golang.org/x/sys v0.0.0-20211213223007-03aa0b5f6827/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27 h1:XDXtA5hveEEV8JB2l7nhMTp3t3cHp9ZpwcdjqyEWLlo= golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220909162455-aba9fc2a8ff2 h1:wM1k/lXfpc5HdkJJyW9GELpd8ERGdnh8sMGL6Gzq3Ho= +golang.org/x/sys v0.0.0-20220909162455-aba9fc2a8ff2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -898,7 +944,9 @@ golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.11-0.20220513221640-090b14e8501f/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -997,6 +1045,8 @@ gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.3.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= +gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2 h1:MZF6J7CV6s/h0HBkfqebrYfKCVEo5iN+wzE4QhV3Evo= +gopkg.in/toast.v1 v1.0.0-20180812000517-0a84660828b2/go.mod h1:s1Sn2yZos05Qfs7NKt867Xe18emOmtsO3eAKbDaon0o= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -1020,6 +1070,7 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.3.2/go.mod h1:jzwdWgg7Jdq75wlfblQxO4neNaFFSvgc1tD5Wv8U0Yw= k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= diff --git a/gobridge/gobridge.go b/gobridge/gobridge.go index b411aa1..8d0816d 100644 --- a/gobridge/gobridge.go +++ b/gobridge/gobridge.go @@ -17,6 +17,7 @@ import ( "github.com/mysteriumnetwork/myst-launcher/app" "github.com/mysteriumnetwork/myst-launcher/model" "github.com/mysteriumnetwork/myst-launcher/myst" + "github.com/mysteriumnetwork/myst-launcher/utils" ) var ( @@ -53,9 +54,10 @@ func copyFile(sourceFile, destinationFile string) { //export GoInit func GoInit(resPath *C.char, prodVer *C.char) { + utils.SetProductVersion(C.GoString(prodVer)) + mod = model.NewUIModel() mod.SetProductVersion(C.GoString(prodVer)) - // set product repo targetDir := os.Getenv("HOME") + "/Library/LaunchAgents/" os.MkdirAll(targetDir, 0755) @@ -89,9 +91,7 @@ func GoStart() { ap.SetModel(mod) ap.SetUI(ui) - ap.WaitGroup.Add(1) - go ap.SuperviseDockerNode() - go ap.CheckLauncherUpdates(gitHubOrg, gitHubRepo) + ap.StartAppController() } @@ -128,6 +128,7 @@ func sendConfig() { cf.autoUpgrade = C.bool(mod.Config.AutoUpgrade) cf.enabled = C.bool(mod.Config.Enabled) cf.network = C.CString(mod.Config.Network) + cf.backend = C.CString(mod.Config.Backend) C.macSendConfig(&cf) } @@ -146,10 +147,8 @@ func GoDialogueComplete() { //export GoOnAppExit func GoOnAppExit() { - ap.TriggerAction("stop") - // wait for SuperviseDockerNode to finish its work - ap.WaitGroup.Wait() + ap.StopAppController() } //export GoTriggerUpgrade @@ -166,12 +165,16 @@ func GoSetState(s *C.NSConfig) { } if mod.Config.Enabled != bool(s.enabled) { - if bool(s.enabled) { - ap.TriggerAction("enable") - } else { - ap.TriggerAction("disable") - } + mod.TriggerNodeEnableAction() + } + + if mod.Config.Backend != C.GoString(s.backend) { + mod.Config.Backend = C.GoString(s.backend) + mod.Config.Save() + + mod.Bus2.Publish("backend") } + sendConfig() } //export GoSetNetworkConfig diff --git a/gobridge/interface.h b/gobridge/interface.h index de2772e..c187179 100644 --- a/gobridge/interface.h +++ b/gobridge/interface.h @@ -29,6 +29,7 @@ typedef struct _NSConfig { int portRangeBegin; int portRangeEnd; char *network; + char *backend; } NSConfig; typedef struct _NSModal { diff --git a/gobridge/interface.m b/gobridge/interface.m index 9c4d464..a9ad157 100644 --- a/gobridge/interface.m +++ b/gobridge/interface.m @@ -41,8 +41,10 @@ void macSendConfig(NSConfig *s) { @"portRangeEnd": @(s->portRangeEnd), @"autoUpgrade": @(s->autoUpgrade), @"network": @(s->network), + @"backend": @(s->backend), }; - + free(s->backend); + dispatch_async(dispatch_get_main_queue(),^{ [[NSNotificationCenter defaultCenter] postNotificationName:@"config" object:nil userInfo:dict]; }); diff --git a/launcher.xcodeproj/project.pbxproj b/launcher.xcodeproj/project.pbxproj index 4f20b42..ee6f6f4 100644 --- a/launcher.xcodeproj/project.pbxproj +++ b/launcher.xcodeproj/project.pbxproj @@ -223,9 +223,9 @@ 9A1B3A8D273BA4780084DF92 /* UpdateNetwork.xib */, 9A1B3A8F273BA5840084DF92 /* UpdateNetworkModalDelegate.h */, 9A1B3A90273BA5840084DF92 /* UpdateNetworkModalDelegate.m */, - 9A1B3A96273BD7AC0084DF92 /* UpdateLauncher.xib */, 9A1B3A95273BD7AC0084DF92 /* UpdateLauncherModalDelegate.h */, 9A1B3A94273BD7AC0084DF92 /* UpdateLauncherModalDelegate.m */, + 9A1B3A96273BD7AC0084DF92 /* UpdateLauncher.xib */, ); path = launcher; sourceTree = ""; @@ -578,7 +578,7 @@ "$(PROJECT_DIR)/gobridge", "$(PROJECT_DIR)", ); - MARKETING_VERSION = 1.0.30; + MARKETING_VERSION = 1.0.36; PRODUCT_BUNDLE_IDENTIFIER = com.mysterium.launcher; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -606,7 +606,7 @@ "$(PROJECT_DIR)/gobridge", "$(PROJECT_DIR)", ); - MARKETING_VERSION = 1.0.30; + MARKETING_VERSION = 1.0.36; PRODUCT_BUNDLE_IDENTIFIER = com.mysterium.launcher; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/launcher/AppDelegate.h b/launcher/AppDelegate.h index 46e9cbc..ec17001 100644 --- a/launcher/AppDelegate.h +++ b/launcher/AppDelegate.h @@ -16,6 +16,8 @@ @interface AppDelegate : NSObject @property (weak) IBOutlet NSMenuItem *itemEnableNode; +@property (weak) IBOutlet NSMenuItem *itemEnableNative; +@property (weak) IBOutlet NSMenuItem *itemEnableDocker; @property (weak) IBOutlet NSMenu *statusBarMenu; @property (strong) NSWindowController *mainWin; @@ -27,6 +29,8 @@ - (IBAction)enableNode:(id)sender; - (IBAction)openNodeUIAction:(id)sender; +- (IBAction)enableNative:(id)sender; +- (IBAction)enableDocker:(id)sender; @end diff --git a/launcher/AppDelegate.m b/launcher/AppDelegate.m index 7136bcd..b002041 100644 --- a/launcher/AppDelegate.m +++ b/launcher/AppDelegate.m @@ -101,16 +101,31 @@ - (IBAction)showNetworkingDlg:(id)sender { - (IBAction)enableNode:(id)sender { NSLog(@"enableNode %@", mod.enabled); - if ([mod.enabled isEqualToNumber:@0]) { - mod.enabled = @1; - } else { - mod.enabled = @0; + mod.enabled = [mod.enabled isEqualToNumber:@0]? @1 : @0; + [mod setState]; + [self setMenuItemState]; +} + +- (IBAction)enableNative:(NSButton*)sender { + + switch (sender.tag) { + case 1: + mod.backend = @"native"; + break; + case 2: + mod.backend = @"docker"; + break; } + [mod setState]; [self setMenuItemState]; } - (void)setMenuItemState { [self.itemEnableNode setState:(NSControlStateValue) [mod.enabled intValue]]; + + [self.itemEnableNative setState:(NSControlStateValue) [mod.backend isEqualToString:@"native"]?1:0]; + [self.itemEnableDocker setState:(NSControlStateValue) [mod.backend isEqualToString:@"docker"]?1:0]; } + @end diff --git a/launcher/Base.lproj/MainMenu.xib b/launcher/Base.lproj/MainMenu.xib index d611cd7..4ab4937 100644 --- a/launcher/Base.lproj/MainMenu.xib +++ b/launcher/Base.lproj/MainMenu.xib @@ -1,8 +1,8 @@ - + - + @@ -15,6 +15,8 @@ + + @@ -57,7 +59,25 @@ - + + + + + + + + + + + + + + + + + + + @@ -85,13 +105,13 @@ - + - + diff --git a/launcher/MainWindow.xib b/launcher/MainWindow.xib index 38e36b2..50aa5b7 100644 --- a/launcher/MainWindow.xib +++ b/launcher/MainWindow.xib @@ -1,14 +1,14 @@ - + - + - + @@ -16,14 +16,15 @@ + - + @@ -40,13 +41,13 @@ - + - + @@ -55,7 +56,7 @@ - + @@ -64,7 +65,7 @@ - + @@ -72,17 +73,8 @@ - - - - - - - - - - + @@ -100,7 +92,7 @@ - + @@ -109,7 +101,7 @@ - + @@ -129,16 +121,16 @@ - + - + - + @@ -177,25 +169,16 @@ - + - - - - - - - - - - + - + @@ -211,7 +194,7 @@ - + @@ -220,7 +203,7 @@ - + @@ -229,7 +212,7 @@ - + @@ -238,7 +221,7 @@ - - - - - - - + - - + + - + - + - - - @@ -349,11 +318,11 @@ - + - + - + @@ -431,11 +400,11 @@ - + - + - + diff --git a/launcher/MainWindowDelegate.h b/launcher/MainWindowDelegate.h index 9b452a0..b6d2a09 100644 --- a/launcher/MainWindowDelegate.h +++ b/launcher/MainWindowDelegate.h @@ -16,7 +16,7 @@ } @property (weak) IBOutlet NSButton *checkBoxAutoUpgrade; -@property (weak) IBOutlet NSButton *btnUpdateToMainnet; +@property (weak) IBOutlet NSButton *btnNetworkConfig; @property (weak) IBOutlet NSTextField *labelImageName; @property (weak) IBOutlet NSTextField *labelCurrentVersion; @@ -25,9 +25,9 @@ @property (weak) IBOutlet NSTextField *labelNetworkMode; @property (weak) IBOutlet NSTextField *labelDocker; @property (weak) IBOutlet NSTextField *labelContainer; -@property (weak) IBOutlet NSTextField *labelNetwork; @property (weak) IBOutlet NSTextField *labelLauncherUpdate; - +@property (weak) IBOutlet NSTextField *labelBackend; +@property (weak) IBOutlet NSTextField *labelStatus; @property (weak) IBOutlet NSImageView *img; diff --git a/launcher/MainWindowDelegate.m b/launcher/MainWindowDelegate.m index 9d09700..80ec0b5 100644 --- a/launcher/MainWindowDelegate.m +++ b/launcher/MainWindowDelegate.m @@ -24,6 +24,7 @@ - (id)init [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notificationHandlerMode:) name:@"new_mode" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notificationHandlerState:) name:@"new_state" object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notificationHandlerState:) name:@"new_config" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notificationHandlerLog:) name:@"log" object:nil]; } @@ -40,13 +41,26 @@ - (void) windowDidLoad { - (void) refreshFrame { + [self.labelBackend setObjectValue: mod.backend]; + + if ([mod.backend isEqualToString:@"native"]) { + [self.btnNetworkConfig setEnabled:0]; + [self.statusDocker setHidden:1]; + [self.labelDocker setHidden:1]; + [self.labelStatus setHidden:1]; + } else { + // docker or unset + [self.btnNetworkConfig setEnabled:1]; + [self.statusDocker setHidden:0]; + [self.labelStatus setHidden:0]; + } + switch ([mod.mode intValue]) { case UIState_Initial: { [self.labelCurrentVersion setObjectValue: mod.currentVersion]; [self.labelLatestVersion setObjectValue: mod.latestVersion]; [self.labelImageName setObjectValue: mod.imageName]; - [self.labelNetwork setObjectValue: mod.networkCaption]; NSString *v = nil; if (mod.hasUpdate) { @@ -57,15 +71,14 @@ - (void) refreshFrame { v = [mod.enablePortForwarding intValue] ? @"Port forwarding mode" : @"Port restricted cone NAT"; [self.labelNetworkMode setObjectValue: v]; - [self.labelDocker setObjectValue: [Utils getRunStateString:mod.isDockerRunning] ]; - [self.labelContainer setObjectValue: [Utils getRunStateString:mod.isContainerRunning] ]; + [self.labelDocker setObjectValue: [Utils getRunStateString:mod.isDockerRunning ]]; + [self.labelContainer setObjectValue: [Utils getRunStateString:mod.isContainerRunning ]]; [self.checkBoxAutoUpgrade setState: [mod.autoUpgrade boolValue]]; [self.statusDocker setState: [Utils getStateViewStatus: mod.isDockerRunning ]]; [self.statusNode setState: [Utils getStateViewStatus: mod.isContainerRunning ]]; [self.labelLauncherUpdate setHidden:(![mod.launcherHasUpdate boolValue])]; - [self.btnUpdateToMainnet setHidden:([mod currentNetIsMainnet])]; } break; diff --git a/launcher/Model.h b/launcher/Model.h index 91ae970..6accf8c 100644 --- a/launcher/Model.h +++ b/launcher/Model.h @@ -19,6 +19,8 @@ NSNumber *enablePortForwarding; NSNumber *autoUpgrade; NSNumber *enabled; + NSString *backend; + NSString *network; NSString *networkCaption; @@ -49,6 +51,7 @@ @property (readwrite, copy) NSNumber *enablePortForwarding; @property (readwrite, copy) NSNumber *autoUpgrade; @property (readwrite, copy) NSNumber *enabled; +@property (readwrite, copy) NSString *backend; @property (readwrite, copy) NSString *network; @property (readwrite, copy) NSString *networkCaption; diff --git a/launcher/Model.m b/launcher/Model.m index 0e72313..96b6499 100644 --- a/launcher/Model.m +++ b/launcher/Model.m @@ -19,6 +19,7 @@ @implementation LauncherState @synthesize enablePortForwarding; @synthesize autoUpgrade; @synthesize enabled; +@synthesize backend; @synthesize hasUpdate; @synthesize isDockerRunning; @@ -79,13 +80,14 @@ - (void)notificationHandlerState:(NSNotification *) notification{ } - (void)notificationHandlerConfig:(NSNotification *) notification{ - //NSLog(@"notificationHandlerState > %@", notification.userInfo); + NSLog(@"notificationHandlerState > %@", notification.userInfo); self.portBegin = notification.userInfo[@"portRangeBegin"]; self.portEnd = notification.userInfo[@"portRangeEnd"]; self.enablePortForwarding = notification.userInfo[@"enablePortForwarding"]; self.autoUpgrade = notification.userInfo[@"autoUpgrade"]; self.enabled = notification.userInfo[@"enabled"]; + self.backend = notification.userInfo[@"backend"]; self.network = notification.userInfo[@"network"]; [[NSNotificationCenter defaultCenter] postNotificationName:@"new_config" object:nil]; @@ -138,9 +140,14 @@ - (void)notificationHandlerDialogue:(NSNotification *) notification - (void)setState { NSConfig s; - + s.autoUpgrade = [self.autoUpgrade boolValue]; s.enabled = [self.enabled boolValue]; + + const char *b = [self.backend UTF8String]; + // copy string, as we work in a managed env. + s.backend = malloc(10); + strcpy(s.backend, b); GoSetState(&s); } diff --git a/launcher/NetworkingModal.xib b/launcher/NetworkingModal.xib index 9c3c7c4..4158bbf 100644 --- a/launcher/NetworkingModal.xib +++ b/launcher/NetworkingModal.xib @@ -1,8 +1,8 @@ - + - + @@ -21,7 +21,7 @@ - + diff --git a/launcher/UpgradeModal.xib b/launcher/UpgradeModal.xib index d9af965..7a60764 100644 --- a/launcher/UpgradeModal.xib +++ b/launcher/UpgradeModal.xib @@ -1,8 +1,8 @@ - + - + @@ -21,7 +21,7 @@ - + @@ -55,9 +55,9 @@ Gw - + - +