diff options
author | Ruben Pollan <meskio@sindominio.net> | 2020-09-30 12:35:07 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2020-09-30 18:31:02 +0200 |
commit | 89b148d143870161909eb6170d4fc1840277aa94 (patch) | |
tree | e94cca65f0d092bf7d0a4707dba841c02bb046a2 /pkg | |
parent | 5d102497e80f17056ce97bcc58a4906cf8a05c28 (diff) |
[feat] remove unused config 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 = "" ) |