diff options
author | Ruben Pollan <meskio@sindominio.net> | 2020-09-24 12:24:48 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2020-09-24 16:50:04 +0200 |
commit | 998b5cb54ad23be1f6df0ee8abd08af5614f38db (patch) | |
tree | aafb1c6f11ba23da120b29170ed712d6a07d5336 /pkg/backend/api.go | |
parent | 3a74c28cce41fe783d9dde707ebb6de941d5cf0a (diff) |
[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
Diffstat (limited to 'pkg/backend/api.go')
-rw-r--r-- | pkg/backend/api.go | 12 |
1 files changed, 8 insertions, 4 deletions
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) { |