summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gui/providers/providers.json6
-rw-r--r--pkg/backend/init.go8
-rw-r--r--pkg/bitmask/init.go22
-rw-r--r--pkg/config/config.go6
4 files changed, 9 insertions, 33 deletions
diff --git a/gui/providers/providers.json b/gui/providers/providers.json
index 30d39b0..3951bdd 100644
--- a/gui/providers/providers.json
+++ b/gui/providers/providers.json
@@ -6,11 +6,11 @@
"applicationName": "DemoLibVPN",
"binaryName": "demolib-vpn",
"auth": "sip",
- "authEmptyPass": "true",
+ "authEmptyPass": true,
"providerURL": "vpnlib.bitmask.net",
"tosURL": "https://libraryvpn.org/",
"helpURL": "https://libraryvpn.org/",
- "askForDonations": "false",
+ "askForDonations": false,
"donateURL": "",
"apiURL": "https://api.vpnlib.bitmask.net:4430/",
"geolocationAPI": "https://getmyip.vpnlib.bitmask.net/json",
@@ -18,4 +18,4 @@
"timeStamp": "2020-09-25 13:05:47"
}
]
-} \ No newline at end of file
+}
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 = ""
)