Fix: FIREWALL_VPN_INPUT_PORTS for Wireguard
This commit is contained in:
@@ -294,7 +294,8 @@ func _main(ctx context.Context, buildInfo models.BuildInformation,
|
||||
}
|
||||
|
||||
for _, vpnPort := range allSettings.Firewall.VPNInputPorts {
|
||||
err = firewallConf.SetAllowedPort(ctx, vpnPort, allSettings.VPN.OpenVPN.Interface)
|
||||
vpnIntf := allSettings.VPN.VPNInterface()
|
||||
err = firewallConf.SetAllowedPort(ctx, vpnPort, vpnIntf)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -87,3 +87,11 @@ func (settings VPN) isOpenVPNCustomConfig(env params.Interface) (ok bool) {
|
||||
s, err := env.Get("OPENVPN_CUSTOM_CONFIG")
|
||||
return err == nil && s != ""
|
||||
}
|
||||
|
||||
func (settings VPN) VPNInterface() (intf string) {
|
||||
if settings.Type == constants.Wireguard {
|
||||
return settings.Wireguard.Interface
|
||||
}
|
||||
// OpenVPN
|
||||
return settings.OpenVPN.Interface
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user