Fix: Openvpn custom config: remove user set

This commit is contained in:
Quentin McGaw (desktop)
2021-08-18 17:41:53 +00:00
parent 14c3b6429b
commit c515603d2f
2 changed files with 3 additions and 1 deletions

View File

@@ -28,7 +28,8 @@ func Test_OpenVPN_JSON(t *testing.T) {
"custom_config": "", "custom_config": "",
"version": "", "version": "",
"encryption_preset": "", "encryption_preset": "",
"ipv6": false "ipv6": false,
"procuser": ""
}`, string(data)) }`, string(data))
var out OpenVPN var out OpenVPN
err = json.Unmarshal(data, &out) err = json.Unmarshal(data, &out)

View File

@@ -64,6 +64,7 @@ func modifyCustomConfig(lines []string,
strings.HasPrefix(line, "down "), strings.HasPrefix(line, "down "),
strings.HasPrefix(line, "verb "), strings.HasPrefix(line, "verb "),
strings.HasPrefix(line, "auth-user-pass "), strings.HasPrefix(line, "auth-user-pass "),
strings.HasPrefix(line, "user "),
len(settings.Cipher) > 0 && strings.HasPrefix(line, "cipher "), len(settings.Cipher) > 0 && strings.HasPrefix(line, "cipher "),
len(settings.Cipher) > 0 && strings.HasPrefix(line, "data-ciphers"), len(settings.Cipher) > 0 && strings.HasPrefix(line, "data-ciphers"),
len(settings.Auth) > 0 && strings.HasPrefix(line, "auth "), len(settings.Auth) > 0 && strings.HasPrefix(line, "auth "),