Maint: make VPN connection not specific to OpenVPN

- Add VPN field to ServerSelection struct
- Set VPN type to server selection at start using VPN_TYPE
- Change OpenVPNConnection to Connection with Type field
- Rename Provider GetOpenVPNConnection to GetConnection
- Rename GetTargetIPOpenVPNConnection to GetTargetIPConnection
- Rename PickRandomOpenVPNConnection to PickRandomConnection
- Add 'OpenVPN' prefix to OpenVPN specific methods on connection
This commit is contained in:
Quentin McGaw (desktop)
2021-08-19 14:09:41 +00:00
parent 105d81c018
commit 3d8e61900b
54 changed files with 283 additions and 255 deletions

View File

@@ -9,7 +9,7 @@ import (
"github.com/qdm12/gluetun/internal/provider/utils"
)
func (p *Protonvpn) BuildConf(connection models.OpenVPNConnection,
func (p *Protonvpn) BuildConf(connection models.Connection,
settings configuration.OpenVPN) (lines []string) {
if settings.Cipher == "" {
settings.Cipher = constants.AES256cbc
@@ -51,8 +51,8 @@ func (p *Protonvpn) BuildConf(connection models.OpenVPNConnection,
// Modified variables
"verb " + strconv.Itoa(settings.Verbosity),
"auth-user-pass " + constants.OpenVPNAuthConf,
connection.ProtoLine(),
connection.RemoteLine(),
connection.OpenVPNProtoLine(),
connection.OpenVPNRemoteLine(),
"auth " + settings.Auth,
}