hotfix(custom): allow empty user and password for OpenVPN
This commit is contained in:
@@ -86,16 +86,18 @@ func (o OpenVPN) validate(vpnProvider string) (err error) {
|
|||||||
ErrOpenVPNVersionIsNotValid, o.Version, strings.Join(validVersions, ", "))
|
ErrOpenVPNVersionIsNotValid, o.Version, strings.Join(validVersions, ", "))
|
||||||
}
|
}
|
||||||
|
|
||||||
if o.User == "" {
|
isCustom := vpnProvider == constants.Custom
|
||||||
|
|
||||||
|
if !isCustom && o.User == "" {
|
||||||
return ErrOpenVPNUserIsEmpty
|
return ErrOpenVPNUserIsEmpty
|
||||||
}
|
}
|
||||||
|
|
||||||
if o.Password == "" {
|
if !isCustom && o.Password == "" {
|
||||||
return ErrOpenVPNPasswordIsEmpty
|
return ErrOpenVPNPasswordIsEmpty
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate ConfFile
|
// Validate ConfFile
|
||||||
if vpnProvider == constants.Custom {
|
if isCustom {
|
||||||
if *o.ConfFile == "" {
|
if *o.ConfFile == "" {
|
||||||
return fmt.Errorf("%w: no file path specified", ErrOpenVPNConfigFile)
|
return fmt.Errorf("%w: no file path specified", ErrOpenVPNConfigFile)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user