Fix: FIREWALL_VPN_INPUT_PORTS for Wireguard

This commit is contained in:
Quentin McGaw (desktop)
2021-08-26 19:54:48 +00:00
parent 501ae2741b
commit f706071048
2 changed files with 10 additions and 1 deletions

View File

@@ -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
}

View File

@@ -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
}