From 998b5cb54ad23be1f6df0ee8abd08af5614f38db Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Thu, 24 Sep 2020 12:24:48 +0200 Subject: [feat] send cmd flags to the go backend Also disable autostart if manual quit, remove custom printer that was used for i18n and disable previous autostart if -disable-autostart We didn't disable autostart after the migration to qt. - Resolves: #355 #289 --- pkg/backend/api.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'pkg/backend/api.go') diff --git a/pkg/backend/api.go b/pkg/backend/api.go index 9706bdf..a8d16a3 100644 --- a/pkg/backend/api.go +++ b/pkg/backend/api.go @@ -11,8 +11,8 @@ import ( "0xacab.org/leap/bitmask-vpn/pkg/bitmask" "0xacab.org/leap/bitmask-vpn/pkg/config/version" - "0xacab.org/leap/bitmask-vpn/pkg/pid" "0xacab.org/leap/bitmask-vpn/pkg/pickle" + "0xacab.org/leap/bitmask-vpn/pkg/pid" ) func Login(username, password string) { @@ -48,6 +48,7 @@ func SwitchOff() { } func Quit() { + ctx.autostart.Disable() if ctx.Status != off { go setStatus(stopping) ctx.cfg.SetUserStoppedVPN(false) @@ -74,8 +75,11 @@ type Providers struct { } type InitOpts struct { - ProviderOptions *bitmask.ProviderOpts - SkipLaunch bool + ProviderOptions *bitmask.ProviderOpts + SkipLaunch bool + Obfs4 bool + DisableAutostart bool + StartVPN string } func InitOptsFromJSON(provider, providersJSON string) *InitOpts { @@ -88,7 +92,7 @@ func InitOptsFromJSON(provider, providersJSON string) *InitOpts { panic("BUG: we do not support multi-provider yet") } providerOpts := &providers.Data[0] - return &InitOpts{providerOpts, false} + return &InitOpts{ProviderOptions: providerOpts} } func InitializeBitmaskContext(opts *InitOpts) { -- cgit v1.2.3