diff options
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/backend/init.go | 8 | ||||
-rw-r--r-- | pkg/bitmask/init.go | 22 | ||||
-rw-r--r-- | pkg/config/config.go | 6 |
3 files changed, 6 insertions, 30 deletions
diff --git a/pkg/backend/init.go b/pkg/backend/init.go index 842c91b..f7dd87a 100644 --- a/pkg/backend/init.go +++ b/pkg/backend/init.go @@ -22,10 +22,10 @@ func initializeContext(opts *InitOpts) { ctx = &connectionCtx{ AppName: opts.ProviderOptions.AppName, Provider: opts.ProviderOptions.Provider, - TosURL: config.TosURL, - HelpURL: config.HelpURL, - DonateURL: config.DonateURL, - AskForDonations: config.AskForDonations, + TosURL: opts.ProviderOptions.TosURL, + HelpURL: opts.ProviderOptions.HelpURL, + DonateURL: opts.ProviderOptions.DonateURL, + AskForDonations: opts.ProviderOptions.AskForDonations, DonateDialog: false, Version: version.VERSION, Status: st, diff --git a/pkg/bitmask/init.go b/pkg/bitmask/init.go index 3e040b4..727d62a 100644 --- a/pkg/bitmask/init.go +++ b/pkg/bitmask/init.go @@ -19,7 +19,6 @@ import ( "log" "os" "path" - "strconv" "0xacab.org/leap/bitmask-vpn/pkg/config" "0xacab.org/leap/bitmask-vpn/pkg/vpn" @@ -35,14 +34,14 @@ type ProviderOpts struct { AppName string `json:"applicationName"` BinaryName string `json:"binaryName"` Auth string `json:"auth"` - AuthEmptyPass string `json:"authEmptyPass"` + AuthEmptyPass bool `json:"authEmptyPass"` ProviderURL string `json:"providerURL"` DonateURL string `json:"donateURL"` ApiURL string `json:"apiURL"` TosURL string `json:"tosURL"` HelpURL string `json:"helpURL"` GeolocationURL string `json:"geolocationAPI"` - AskForDonations string `json:"askForDonations"` + AskForDonations bool `json:"askForDonations"` CaCert string `json:"caCertString"` } @@ -54,28 +53,11 @@ func GetConfiguredProvider() *ProviderInfo { func ConfigureProvider(opts *ProviderOpts) { config.Provider = opts.ProviderURL - config.ProviderName = opts.Provider config.ApplicationName = opts.AppName config.BinaryName = opts.BinaryName config.Auth = opts.Auth - - config.DonateURL = opts.DonateURL - config.HelpURL = opts.HelpURL - config.TosURL = opts.TosURL - config.APIURL = opts.ApiURL config.GeolocationAPI = opts.GeolocationURL config.CaCert = []byte(opts.CaCert) - - wantsDonations, err := strconv.ParseBool(opts.AskForDonations) - if err == nil { - config.AskForDonations = wantsDonations - } - - emptyPass, err := strconv.ParseBool(opts.AuthEmptyPass) - if err == nil { - config.AuthEmptyPass = emptyPass - log.Println("DEBUG: provider allows empty pass:", emptyPass) - } } func InitializeLogger() { diff --git a/pkg/config/config.go b/pkg/config/config.go index c4961ab..c756672 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -2,15 +2,9 @@ package config var ( Provider = "" - ProviderName = "" ApplicationName = "" BinaryName = "" Auth = "" - AuthEmptyPass = false - DonateURL = "" - AskForDonations = true - HelpURL = "" - TosURL = "" APIURL = "" GeolocationAPI = "" ) |