Maint: openvpn process user in Openvpn settings
This commit is contained in:
@@ -213,6 +213,7 @@ func _main(ctx context.Context, buildInfo models.BuildInformation,
|
|||||||
// set it for Unbound
|
// set it for Unbound
|
||||||
// TODO remove this when migrating to qdm12/dns v2
|
// TODO remove this when migrating to qdm12/dns v2
|
||||||
allSettings.DNS.Unbound.Username = nonRootUsername
|
allSettings.DNS.Unbound.Username = nonRootUsername
|
||||||
|
allSettings.VPN.OpenVPN.ProcUser = nonRootUsername
|
||||||
|
|
||||||
if err := os.Chown("/etc/unbound", puid, pgid); err != nil {
|
if err := os.Chown("/etc/unbound", puid, pgid); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -352,10 +353,10 @@ func _main(ctx context.Context, buildInfo models.BuildInformation,
|
|||||||
tickersGroupHandler.Add(pubIPTickerHandler)
|
tickersGroupHandler.Add(pubIPTickerHandler)
|
||||||
|
|
||||||
openvpnLogger := logger.NewChild(logging.Settings{Prefix: "openvpn: "})
|
openvpnLogger := logger.NewChild(logging.Settings{Prefix: "openvpn: "})
|
||||||
openvpnLooper := openvpn.NewLoop(allSettings.VPN.OpenVPN,
|
openvpnLooper := openvpn.NewLoop(allSettings.VPN.OpenVPN, allSettings.VPN.Provider,
|
||||||
allSettings.VPN.Provider, nonRootUsername, allServers,
|
allServers, ovpnConf, firewallConf, routingConf, portForwardLooper,
|
||||||
ovpnConf, firewallConf, routingConf, portForwardLooper, publicIPLooper, unboundLooper,
|
publicIPLooper, unboundLooper, openvpnLogger, httpClient,
|
||||||
openvpnLogger, httpClient, buildInfo, allSettings.VersionInformation)
|
buildInfo, allSettings.VersionInformation)
|
||||||
openvpnHandler, openvpnCtx, openvpnDone := goshutdown.NewGoRoutineHandler(
|
openvpnHandler, openvpnCtx, openvpnDone := goshutdown.NewGoRoutineHandler(
|
||||||
"openvpn", goshutdown.GoRoutineSettings{Timeout: time.Second})
|
"openvpn", goshutdown.GoRoutineSettings{Timeout: time.Second})
|
||||||
// wait for restartOpenvpn
|
// wait for restartOpenvpn
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ func (c *CLI) OpenvpnConfig(logger logging.Logger) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
lines := providerConf.BuildConf(connection, "nonrootuser", allSettings.VPN.OpenVPN)
|
lines := providerConf.BuildConf(connection, allSettings.VPN.OpenVPN)
|
||||||
fmt.Println(strings.Join(lines, "\n"))
|
fmt.Println(strings.Join(lines, "\n"))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ type OpenVPN struct {
|
|||||||
ClientKey string `json:"-"` // Cyberghost, VPNUnlimited
|
ClientKey string `json:"-"` // Cyberghost, VPNUnlimited
|
||||||
EncPreset string `json:"encryption_preset"` // PIA
|
EncPreset string `json:"encryption_preset"` // PIA
|
||||||
IPv6 bool `json:"ipv6"` // Mullvad
|
IPv6 bool `json:"ipv6"` // Mullvad
|
||||||
|
ProcUser string `json:"procuser"` // Process username
|
||||||
}
|
}
|
||||||
|
|
||||||
func (settings *OpenVPN) String() string {
|
func (settings *OpenVPN) String() string {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ func (l *Loop) processCustomConfig(settings configuration.OpenVPN) (
|
|||||||
return nil, connection, fmt.Errorf("%w: %s", errProcessCustomConfig, err)
|
return nil, connection, fmt.Errorf("%w: %s", errProcessCustomConfig, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
lines = modifyCustomConfig(lines, l.username, settings)
|
lines = modifyCustomConfig(lines, settings)
|
||||||
|
|
||||||
connection, err = extractConnectionFromLines(lines)
|
connection, err = extractConnectionFromLines(lines)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -55,7 +55,7 @@ func readCustomConfigLines(filepath string) (
|
|||||||
return strings.Split(string(b), "\n"), nil
|
return strings.Split(string(b), "\n"), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func modifyCustomConfig(lines []string, username string,
|
func modifyCustomConfig(lines []string,
|
||||||
settings configuration.OpenVPN) (modified []string) {
|
settings configuration.OpenVPN) (modified []string) {
|
||||||
// Remove some lines
|
// Remove some lines
|
||||||
for _, line := range lines {
|
for _, line := range lines {
|
||||||
@@ -98,7 +98,7 @@ func modifyCustomConfig(lines []string, username string,
|
|||||||
modified = append(modified, `pull-filter ignore "ifconfig-ipv6"`)
|
modified = append(modified, `pull-filter ignore "ifconfig-ipv6"`)
|
||||||
}
|
}
|
||||||
if !settings.Root {
|
if !settings.Root {
|
||||||
modified = append(modified, "user "+username)
|
modified = append(modified, "user "+settings.ProcUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
return modified
|
return modified
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ type Loop struct {
|
|||||||
statusManager loopstate.Manager
|
statusManager loopstate.Manager
|
||||||
state state.Manager
|
state state.Manager
|
||||||
// Fixed parameters
|
// Fixed parameters
|
||||||
username string
|
|
||||||
buildInfo models.BuildInformation
|
buildInfo models.BuildInformation
|
||||||
versionInfo bool
|
versionInfo bool
|
||||||
// Configurators
|
// Configurators
|
||||||
@@ -64,7 +63,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func NewLoop(openVPNSettings configuration.OpenVPN,
|
func NewLoop(openVPNSettings configuration.OpenVPN,
|
||||||
providerSettings configuration.Provider, username string,
|
providerSettings configuration.Provider,
|
||||||
allServers models.AllServers, conf Configurator,
|
allServers models.AllServers, conf Configurator,
|
||||||
fw firewallConfigurer, routing routing.VPNGetter,
|
fw firewallConfigurer, routing routing.VPNGetter,
|
||||||
portForward portforward.StartStopper,
|
portForward portforward.StartStopper,
|
||||||
@@ -82,7 +81,6 @@ func NewLoop(openVPNSettings configuration.OpenVPN,
|
|||||||
return &Loop{
|
return &Loop{
|
||||||
statusManager: statusManager,
|
statusManager: statusManager,
|
||||||
state: state,
|
state: state,
|
||||||
username: username,
|
|
||||||
buildInfo: buildInfo,
|
buildInfo: buildInfo,
|
||||||
versionInfo: versionInfo,
|
versionInfo: versionInfo,
|
||||||
conf: conf,
|
conf: conf,
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ func (l *Loop) Run(ctx context.Context, done chan<- struct{}) {
|
|||||||
if openVPNSettings.Config == "" {
|
if openVPNSettings.Config == "" {
|
||||||
connection, err = providerConf.GetOpenVPNConnection(providerSettings.ServerSelection)
|
connection, err = providerConf.GetOpenVPNConnection(providerSettings.ServerSelection)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
lines = providerConf.BuildConf(connection, l.username, openVPNSettings)
|
lines = providerConf.BuildConf(connection, openVPNSettings)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
lines, connection, err = l.processCustomConfig(openVPNSettings)
|
lines, connection, err = l.processCustomConfig(openVPNSettings)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (c *Cyberghost) BuildConf(connection models.OpenVPNConnection,
|
func (c *Cyberghost) BuildConf(connection models.OpenVPNConnection,
|
||||||
username string, settings configuration.OpenVPN) (lines []string) {
|
settings configuration.OpenVPN) (lines []string) {
|
||||||
if settings.Cipher == "" {
|
if settings.Cipher == "" {
|
||||||
settings.Cipher = constants.AES256cbc
|
settings.Cipher = constants.AES256cbc
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ func (c *Cyberghost) BuildConf(connection models.OpenVPNConnection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !settings.Root {
|
if !settings.Root {
|
||||||
lines = append(lines, "user "+username)
|
lines = append(lines, "user "+settings.ProcUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
if settings.MSSFix > 0 {
|
if settings.MSSFix > 0 {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (f *Fastestvpn) BuildConf(connection models.OpenVPNConnection,
|
func (f *Fastestvpn) BuildConf(connection models.OpenVPNConnection,
|
||||||
username string, settings configuration.OpenVPN) (lines []string) {
|
settings configuration.OpenVPN) (lines []string) {
|
||||||
if settings.Cipher == "" {
|
if settings.Cipher == "" {
|
||||||
settings.Cipher = constants.AES256cbc
|
settings.Cipher = constants.AES256cbc
|
||||||
}
|
}
|
||||||
@@ -59,7 +59,7 @@ func (f *Fastestvpn) BuildConf(connection models.OpenVPNConnection,
|
|||||||
lines = append(lines, utils.CipherLines(settings.Cipher, settings.Version)...)
|
lines = append(lines, utils.CipherLines(settings.Cipher, settings.Version)...)
|
||||||
|
|
||||||
if !settings.Root {
|
if !settings.Root {
|
||||||
lines = append(lines, "user "+username)
|
lines = append(lines, "user "+settings.ProcUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
if settings.IPv6 {
|
if settings.IPv6 {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (h *HideMyAss) BuildConf(connection models.OpenVPNConnection,
|
func (h *HideMyAss) BuildConf(connection models.OpenVPNConnection,
|
||||||
username string, settings configuration.OpenVPN) (lines []string) {
|
settings configuration.OpenVPN) (lines []string) {
|
||||||
if settings.Cipher == "" {
|
if settings.Cipher == "" {
|
||||||
settings.Cipher = constants.AES256cbc
|
settings.Cipher = constants.AES256cbc
|
||||||
}
|
}
|
||||||
@@ -56,7 +56,7 @@ func (h *HideMyAss) BuildConf(connection models.OpenVPNConnection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !settings.Root {
|
if !settings.Root {
|
||||||
lines = append(lines, "user "+username)
|
lines = append(lines, "user "+settings.ProcUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
if settings.IPv6 {
|
if settings.IPv6 {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (i *Ipvanish) BuildConf(connection models.OpenVPNConnection,
|
func (i *Ipvanish) BuildConf(connection models.OpenVPNConnection,
|
||||||
username string, settings configuration.OpenVPN) (lines []string) {
|
settings configuration.OpenVPN) (lines []string) {
|
||||||
if settings.Cipher == "" {
|
if settings.Cipher == "" {
|
||||||
settings.Cipher = constants.AES256cbc
|
settings.Cipher = constants.AES256cbc
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ func (i *Ipvanish) BuildConf(connection models.OpenVPNConnection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !settings.Root {
|
if !settings.Root {
|
||||||
lines = append(lines, "user "+username)
|
lines = append(lines, "user "+settings.ProcUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
if settings.IPv6 {
|
if settings.IPv6 {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (i *Ivpn) BuildConf(connection models.OpenVPNConnection,
|
func (i *Ivpn) BuildConf(connection models.OpenVPNConnection,
|
||||||
username string, settings configuration.OpenVPN) (lines []string) {
|
settings configuration.OpenVPN) (lines []string) {
|
||||||
if settings.Cipher == "" {
|
if settings.Cipher == "" {
|
||||||
settings.Cipher = constants.AES256cbc
|
settings.Cipher = constants.AES256cbc
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ func (i *Ivpn) BuildConf(connection models.OpenVPNConnection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !settings.Root {
|
if !settings.Root {
|
||||||
lines = append(lines, "user "+username)
|
lines = append(lines, "user "+settings.ProcUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
if settings.IPv6 {
|
if settings.IPv6 {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (m *Mullvad) BuildConf(connection models.OpenVPNConnection,
|
func (m *Mullvad) BuildConf(connection models.OpenVPNConnection,
|
||||||
username string, settings configuration.OpenVPN) (lines []string) {
|
settings configuration.OpenVPN) (lines []string) {
|
||||||
if settings.Cipher == "" {
|
if settings.Cipher == "" {
|
||||||
settings.Cipher = constants.AES256cbc
|
settings.Cipher = constants.AES256cbc
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ func (m *Mullvad) BuildConf(connection models.OpenVPNConnection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !settings.Root {
|
if !settings.Root {
|
||||||
lines = append(lines, "user "+username)
|
lines = append(lines, "user "+settings.ProcUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
if settings.MSSFix > 0 {
|
if settings.MSSFix > 0 {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (n *Nordvpn) BuildConf(connection models.OpenVPNConnection,
|
func (n *Nordvpn) BuildConf(connection models.OpenVPNConnection,
|
||||||
username string, settings configuration.OpenVPN) (lines []string) {
|
settings configuration.OpenVPN) (lines []string) {
|
||||||
if settings.Cipher == "" {
|
if settings.Cipher == "" {
|
||||||
settings.Cipher = constants.AES256cbc
|
settings.Cipher = constants.AES256cbc
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ func (n *Nordvpn) BuildConf(connection models.OpenVPNConnection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !settings.Root {
|
if !settings.Root {
|
||||||
lines = append(lines, "user "+username)
|
lines = append(lines, "user "+settings.ProcUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
if settings.IPv6 {
|
if settings.IPv6 {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (p *Privado) BuildConf(connection models.OpenVPNConnection,
|
func (p *Privado) BuildConf(connection models.OpenVPNConnection,
|
||||||
username string, settings configuration.OpenVPN) (lines []string) {
|
settings configuration.OpenVPN) (lines []string) {
|
||||||
if settings.Cipher == "" {
|
if settings.Cipher == "" {
|
||||||
settings.Cipher = constants.AES256cbc
|
settings.Cipher = constants.AES256cbc
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@ func (p *Privado) BuildConf(connection models.OpenVPNConnection,
|
|||||||
lines = append(lines, utils.CipherLines(settings.Cipher, settings.Version)...)
|
lines = append(lines, utils.CipherLines(settings.Cipher, settings.Version)...)
|
||||||
|
|
||||||
if !settings.Root {
|
if !settings.Root {
|
||||||
lines = append(lines, "user "+username)
|
lines = append(lines, "user "+settings.ProcUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
if settings.MSSFix > 0 {
|
if settings.MSSFix > 0 {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (p *PIA) BuildConf(connection models.OpenVPNConnection,
|
func (p *PIA) BuildConf(connection models.OpenVPNConnection,
|
||||||
username string, settings configuration.OpenVPN) (lines []string) {
|
settings configuration.OpenVPN) (lines []string) {
|
||||||
var defaultCipher, defaultAuth, X509CRL, certificate string
|
var defaultCipher, defaultAuth, X509CRL, certificate string
|
||||||
switch settings.EncPreset {
|
switch settings.EncPreset {
|
||||||
case constants.PIAEncryptionPresetNormal:
|
case constants.PIAEncryptionPresetNormal:
|
||||||
@@ -74,7 +74,7 @@ func (p *PIA) BuildConf(connection models.OpenVPNConnection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !settings.Root {
|
if !settings.Root {
|
||||||
lines = append(lines, "user "+username)
|
lines = append(lines, "user "+settings.ProcUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
if settings.MSSFix > 0 {
|
if settings.MSSFix > 0 {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (p *Privatevpn) BuildConf(connection models.OpenVPNConnection,
|
func (p *Privatevpn) BuildConf(connection models.OpenVPNConnection,
|
||||||
username string, settings configuration.OpenVPN) (lines []string) {
|
settings configuration.OpenVPN) (lines []string) {
|
||||||
if settings.Cipher == "" {
|
if settings.Cipher == "" {
|
||||||
settings.Cipher = constants.AES128gcm
|
settings.Cipher = constants.AES128gcm
|
||||||
}
|
}
|
||||||
@@ -52,7 +52,7 @@ func (p *Privatevpn) BuildConf(connection models.OpenVPNConnection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !settings.Root {
|
if !settings.Root {
|
||||||
lines = append(lines, "user "+username)
|
lines = append(lines, "user "+settings.ProcUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
if settings.MSSFix > 0 {
|
if settings.MSSFix > 0 {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (p *Protonvpn) BuildConf(connection models.OpenVPNConnection,
|
func (p *Protonvpn) BuildConf(connection models.OpenVPNConnection,
|
||||||
username string, settings configuration.OpenVPN) (lines []string) {
|
settings configuration.OpenVPN) (lines []string) {
|
||||||
if settings.Cipher == "" {
|
if settings.Cipher == "" {
|
||||||
settings.Cipher = constants.AES256cbc
|
settings.Cipher = constants.AES256cbc
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ func (p *Protonvpn) BuildConf(connection models.OpenVPNConnection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !settings.Root {
|
if !settings.Root {
|
||||||
lines = append(lines, "user "+username)
|
lines = append(lines, "user "+settings.ProcUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
if settings.IPv6 {
|
if settings.IPv6 {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import (
|
|||||||
// Provider contains methods to read and modify the openvpn configuration to connect as a client.
|
// Provider contains methods to read and modify the openvpn configuration to connect as a client.
|
||||||
type Provider interface {
|
type Provider interface {
|
||||||
GetOpenVPNConnection(selection configuration.ServerSelection) (connection models.OpenVPNConnection, err error)
|
GetOpenVPNConnection(selection configuration.ServerSelection) (connection models.OpenVPNConnection, err error)
|
||||||
BuildConf(connection models.OpenVPNConnection, username string, settings configuration.OpenVPN) (lines []string)
|
BuildConf(connection models.OpenVPNConnection, settings configuration.OpenVPN) (lines []string)
|
||||||
PortForwarder
|
PortForwarder
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (p *Purevpn) BuildConf(connection models.OpenVPNConnection,
|
func (p *Purevpn) BuildConf(connection models.OpenVPNConnection,
|
||||||
username string, settings configuration.OpenVPN) (lines []string) {
|
settings configuration.OpenVPN) (lines []string) {
|
||||||
if settings.Cipher == "" {
|
if settings.Cipher == "" {
|
||||||
settings.Cipher = constants.AES256gcm
|
settings.Cipher = constants.AES256gcm
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ func (p *Purevpn) BuildConf(connection models.OpenVPNConnection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !settings.Root {
|
if !settings.Root {
|
||||||
lines = append(lines, "user "+username)
|
lines = append(lines, "user "+settings.ProcUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
if settings.IPv6 {
|
if settings.IPv6 {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (s *Surfshark) BuildConf(connection models.OpenVPNConnection,
|
func (s *Surfshark) BuildConf(connection models.OpenVPNConnection,
|
||||||
username string, settings configuration.OpenVPN) (lines []string) {
|
settings configuration.OpenVPN) (lines []string) {
|
||||||
if settings.Cipher == "" {
|
if settings.Cipher == "" {
|
||||||
settings.Cipher = constants.AES256gcm
|
settings.Cipher = constants.AES256gcm
|
||||||
}
|
}
|
||||||
@@ -61,7 +61,7 @@ func (s *Surfshark) BuildConf(connection models.OpenVPNConnection,
|
|||||||
lines = append(lines, utils.CipherLines(settings.Cipher, settings.Version)...)
|
lines = append(lines, utils.CipherLines(settings.Cipher, settings.Version)...)
|
||||||
|
|
||||||
if !settings.Root {
|
if !settings.Root {
|
||||||
lines = append(lines, "user "+username)
|
lines = append(lines, "user "+settings.ProcUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
if settings.IPv6 {
|
if settings.IPv6 {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (t *Torguard) BuildConf(connection models.OpenVPNConnection,
|
func (t *Torguard) BuildConf(connection models.OpenVPNConnection,
|
||||||
username string, settings configuration.OpenVPN) (lines []string) {
|
settings configuration.OpenVPN) (lines []string) {
|
||||||
if settings.Cipher == "" {
|
if settings.Cipher == "" {
|
||||||
settings.Cipher = constants.AES256gcm
|
settings.Cipher = constants.AES256gcm
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ func (t *Torguard) BuildConf(connection models.OpenVPNConnection,
|
|||||||
lines = append(lines, utils.CipherLines(settings.Cipher, settings.Version)...)
|
lines = append(lines, utils.CipherLines(settings.Cipher, settings.Version)...)
|
||||||
|
|
||||||
if !settings.Root {
|
if !settings.Root {
|
||||||
lines = append(lines, "user "+username)
|
lines = append(lines, "user "+settings.ProcUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
if connection.Protocol == constants.UDP {
|
if connection.Protocol == constants.UDP {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (p *Provider) BuildConf(connection models.OpenVPNConnection,
|
func (p *Provider) BuildConf(connection models.OpenVPNConnection,
|
||||||
username string, settings configuration.OpenVPN) (lines []string) {
|
settings configuration.OpenVPN) (lines []string) {
|
||||||
lines = []string{
|
lines = []string{
|
||||||
"client",
|
"client",
|
||||||
"dev tun",
|
"dev tun",
|
||||||
@@ -52,7 +52,7 @@ func (p *Provider) BuildConf(connection models.OpenVPNConnection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !settings.Root {
|
if !settings.Root {
|
||||||
lines = append(lines, "user "+username)
|
lines = append(lines, "user "+settings.ProcUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
if settings.IPv6 {
|
if settings.IPv6 {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (v *Vyprvpn) BuildConf(connection models.OpenVPNConnection,
|
func (v *Vyprvpn) BuildConf(connection models.OpenVPNConnection,
|
||||||
username string, settings configuration.OpenVPN) (lines []string) {
|
settings configuration.OpenVPN) (lines []string) {
|
||||||
if settings.Cipher == "" {
|
if settings.Cipher == "" {
|
||||||
settings.Cipher = constants.AES256cbc
|
settings.Cipher = constants.AES256cbc
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ func (v *Vyprvpn) BuildConf(connection models.OpenVPNConnection,
|
|||||||
lines = append(lines, utils.CipherLines(settings.Cipher, settings.Version)...)
|
lines = append(lines, utils.CipherLines(settings.Cipher, settings.Version)...)
|
||||||
|
|
||||||
if !settings.Root {
|
if !settings.Root {
|
||||||
lines = append(lines, "user "+username)
|
lines = append(lines, "user "+settings.ProcUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
if settings.MSSFix > 0 {
|
if settings.MSSFix > 0 {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func (w *Windscribe) BuildConf(connection models.OpenVPNConnection,
|
func (w *Windscribe) BuildConf(connection models.OpenVPNConnection,
|
||||||
username string, settings configuration.OpenVPN) (lines []string) {
|
settings configuration.OpenVPN) (lines []string) {
|
||||||
if settings.Cipher == "" {
|
if settings.Cipher == "" {
|
||||||
settings.Cipher = constants.AES256cbc
|
settings.Cipher = constants.AES256cbc
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ func (w *Windscribe) BuildConf(connection models.OpenVPNConnection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !settings.Root {
|
if !settings.Root {
|
||||||
lines = append(lines, "user "+username)
|
lines = append(lines, "user "+settings.ProcUser)
|
||||||
}
|
}
|
||||||
|
|
||||||
if settings.MSSFix > 0 {
|
if settings.MSSFix > 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user