chore(validation): move functions from constants
- Move validation functions from `internal/constants` to `internal/configuration/settings/validation` - Concatenate all OpenVPN constants in `internal/constants/openvpn.go`
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
"github.com/qdm12/golibs/format"
|
||||
)
|
||||
@@ -33,7 +33,13 @@ var (
|
||||
func (p *PIA) PortForward(ctx context.Context, client *http.Client,
|
||||
logger utils.Logger, gateway net.IP, serverName string) (
|
||||
port uint16, err error) {
|
||||
server := constants.PIAServerWhereName(p.servers, serverName)
|
||||
var server models.PIAServer
|
||||
for _, server = range p.servers {
|
||||
if server.ServerName == serverName {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !server.PortForward {
|
||||
logger.Error("The server " + serverName +
|
||||
" (region " + server.Region + ") does not support port forwarding")
|
||||
|
||||
Reference in New Issue
Block a user