Openvpn get settings http route

This commit is contained in:
Quentin McGaw
2020-07-19 14:26:24 +00:00
parent 29f74df450
commit 4baf0420d6
9 changed files with 172 additions and 41 deletions

View File

@@ -8,48 +8,48 @@ import (
// ProviderSettings contains settings specific to a VPN provider
type ProviderSettings struct {
Name VPNProvider
ServerSelection ServerSelection
ExtraConfigOptions ExtraConfigOptions
PortForwarding PortForwarding
Name VPNProvider `json:"name"`
ServerSelection ServerSelection `json:"serverSelection"`
ExtraConfigOptions ExtraConfigOptions `json:"extraConfig"`
PortForwarding PortForwarding `json:"portForwarding"`
}
type ServerSelection struct { //nolint:maligned
// Common
Protocol NetworkProtocol
TargetIP net.IP
Protocol NetworkProtocol `json:"networkProtocol"`
TargetIP net.IP `json:"targetIP,omitempty"`
// Cyberghost, PIA, Surfshark, Windscribe, Vyprvpn, NordVPN
Region string
Region string `json:"region"`
// Cyberghost
Group string
Group string `json:"group"`
// Mullvad
Country string
City string
ISP string
Owned bool
Country string `json:"country"`
City string `json:"city"`
ISP string `json:"isp"`
Owned bool `json:"owned"`
// Mullvad, Windscribe
CustomPort uint16
// PIA
EncryptionPreset string
CustomPort uint16 `json:"customPort"`
// NordVPN
Number uint16
Number uint16 `json:"number"`
// PIA
EncryptionPreset string `json:"encryptionPreset"`
}
type ExtraConfigOptions struct {
ClientKey string // Cyberghost
EncryptionPreset string // PIA
ClientKey string `json:"-"` // Cyberghost
EncryptionPreset string `json:"encryptionPreset"` // PIA
}
// PortForwarding contains settings for port forwarding
type PortForwarding struct {
Enabled bool
Filepath Filepath
Enabled bool `json:"enabled"`
Filepath Filepath `json:"filepath"`
}
func (p *PortForwarding) String() string {