chore: OpenVPN user and password as nullable

- Username and password can be the empty string for custom provider
This commit is contained in:
Quentin McGaw
2022-08-13 16:44:38 +00:00
parent 8e101d49a1
commit 1ab74e6bb3
9 changed files with 50 additions and 46 deletions

View File

@@ -27,8 +27,8 @@ func setupOpenVPN(ctx context.Context, fw Firewall,
return nil, "", fmt.Errorf("failed writing configuration to file: %w", err)
}
if settings.OpenVPN.User != "" {
err := openvpnConf.WriteAuthFile(settings.OpenVPN.User, settings.OpenVPN.Password)
if *settings.OpenVPN.User != "" {
err := openvpnConf.WriteAuthFile(*settings.OpenVPN.User, *settings.OpenVPN.Password)
if err != nil {
return nil, "", fmt.Errorf("failed writing auth to file: %w", err)
}