diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2020-09-08 03:46:07 +0200 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2020-09-08 20:10:14 +0200 |
commit | 85e61a7d05d2617bb1a003fdfe756f5e56520b89 (patch) | |
tree | 661213adee7847e75767d3d6bd52b5f38c74e17c | |
parent | a0e67fe3feb5b3a2d6d0f8e5f33ff96007955b17 (diff) |
[feat] expose allowEmptyPass flag for provider config
-rw-r--r-- | branding/config/vendor.conf | 1 | ||||
-rw-r--r-- | branding/scripts/provider.py | 2 | ||||
-rw-r--r-- | gui/providers/providers.json | 3 | ||||
-rw-r--r-- | pkg/bitmask/init.go | 8 | ||||
-rw-r--r-- | pkg/config/config.go | 1 |
5 files changed, 13 insertions, 2 deletions
diff --git a/branding/config/vendor.conf b/branding/config/vendor.conf index 3657c2b..b519cf8 100644 --- a/branding/config/vendor.conf +++ b/branding/config/vendor.conf @@ -71,6 +71,7 @@ name = demolib applicationName = DemoLib binaryName = demo-lib auth = sip +authEmptyPass = true providerURL = vpnlib.bitmask.net apiURL = https://api.vpnlib.bitmask.net:4430/ diff --git a/branding/scripts/provider.py b/branding/scripts/provider.py index a88179b..ffee1b3 100644 --- a/branding/scripts/provider.py +++ b/branding/scripts/provider.py @@ -18,7 +18,7 @@ def getProviderData(provider, config): c = config[provider] d = dict() - keys = ('name', 'applicationName', 'binaryName', 'auth', + keys = ('name', 'applicationName', 'binaryName', 'auth', 'authEmptyPass', 'providerURL', 'tosURL', 'helpURL', 'askForDonations', 'donateURL', 'apiURL', 'geolocationAPI', 'caCertString') diff --git a/gui/providers/providers.json b/gui/providers/providers.json index f0132f5..e0c52b8 100644 --- a/gui/providers/providers.json +++ b/gui/providers/providers.json @@ -6,6 +6,7 @@ "applicationName": "DemoLib", "binaryName": "demo-lib", "auth": "sip", + "authEmptyPass": "true", "providerURL": "vpnlib.bitmask.net", "tosURL": "https://libraryvpn.org/", "helpURL": "https://libraryvpn.org/", @@ -14,7 +15,7 @@ "apiURL": "https://api.vpnlib.bitmask.net:4430/", "geolocationAPI": "https://getmyip.vpnlib.bitmask.net/json", "caCertString": "-----BEGIN CERTIFICATE-----\nMIIBQzCB6aADAgECAgEBMAoGCCqGSM49BAMCMBcxFTATBgNVBAMTDExFQVAgUm9v\ndCBDQTAeFw0yMDA4MDYxOTA3NDRaFw0yNTA4MDYxOTEyNDRaMBcxFTATBgNVBAMT\nDExFQVAgUm9vdCBDQTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABIG5POr4cAdK\nkTavKpSJr8nW1V7HLpr27qKaShpk1TUy5ipaAlusmavGLxKsPE+i3AMlvf/f6ch3\n1MjAtIf5rYujJjAkMA4GA1UdDwEB/wQEAwICpDASBgNVHRMBAf8ECDAGAQH/AgEB\nMAoGCCqGSM49BAMCA0kAMEYCIQDXj280LNZbSbi0Y2WvtQrJBUw4wdm8qAeOeuH7\n6XiLEwIhAPBRsmst/ujcChsG2t6LpG+p8s4rfIfh8YLo/4qrcc5p\n-----END CERTIFICATE-----", - "timeStamp": "2020-09-08 01:01:08" + "timeStamp": "2020-09-08 03:42:39" } ] }
\ No newline at end of file diff --git a/pkg/bitmask/init.go b/pkg/bitmask/init.go index 4907b2f..bed98e5 100644 --- a/pkg/bitmask/init.go +++ b/pkg/bitmask/init.go @@ -40,6 +40,7 @@ type ProviderOpts struct { AppName string `json:"applicationName"` BinaryName string `json:"binaryName"` Auth string `json:"auth"` + AuthEmptyPass string `json:"authEmptyPass"` ProviderURL string `json:"providerURL"` DonateURL string `json:"donateURL"` ApiURL string `json:"apiURL"` @@ -62,6 +63,7 @@ func ConfigureProvider(opts *ProviderOpts) { config.ApplicationName = opts.AppName config.BinaryName = opts.BinaryName config.Auth = opts.Auth + config.DonateURL = opts.DonateURL config.HelpURL = opts.HelpURL config.TosURL = opts.TosURL @@ -73,6 +75,12 @@ func ConfigureProvider(opts *ProviderOpts) { 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 7815c96..c4961ab 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -6,6 +6,7 @@ var ( ApplicationName = "" BinaryName = "" Auth = "" + AuthEmptyPass = false DonateURL = "" AskForDonations = true HelpURL = "" |