mirror of
https://github.com/qdm12/gluetun.git
synced 2026-07-24 19:36:24 +02:00
chore(updater): move updater packages to pkg/updaters/<name>
This commit is contained in:
@@ -7,7 +7,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||
"github.com/qdm12/gluetun/internal/constants/vpn"
|
||||
"github.com/qdm12/gluetun/pkg/updaters/constants"
|
||||
"github.com/qdm12/gosettings"
|
||||
"github.com/qdm12/gosettings/reader"
|
||||
"github.com/qdm12/gosettings/validate"
|
||||
@@ -31,9 +31,9 @@ func (p *Provider) validate(vpnType string, filterChoicesGetter FilterChoicesGet
|
||||
// Validate Name
|
||||
var validNames []string
|
||||
switch vpnType {
|
||||
case vpn.AmneziaWg:
|
||||
case constants.AmneziaWg:
|
||||
validNames = []string{providers.Custom}
|
||||
case vpn.OpenVPN:
|
||||
case constants.OpenVPN:
|
||||
validNames = providers.AllWithCustom()
|
||||
validNames = append(validNames, "pia") // Retro-compatibility
|
||||
// Remove Mullvad since it no longer supports OpenVPN as of January 15th, 2026
|
||||
@@ -41,7 +41,7 @@ func (p *Provider) validate(vpnType string, filterChoicesGetter FilterChoicesGet
|
||||
validNames[mullvadIndex], validNames[len(validNames)-1] = validNames[len(validNames)-1], validNames[mullvadIndex]
|
||||
validNames = validNames[:len(validNames)-1]
|
||||
sort.Strings(validNames)
|
||||
case vpn.Wireguard:
|
||||
case constants.Wireguard:
|
||||
validNames = []string{
|
||||
providers.Airvpn,
|
||||
providers.Custom,
|
||||
@@ -122,7 +122,7 @@ func (p *Provider) read(r *reader.Reader, vpnType string) (err error) {
|
||||
func readVPNServiceProvider(r *reader.Reader, vpnType string) (vpnProvider string) {
|
||||
vpnProvider = r.String("VPN_SERVICE_PROVIDER", reader.RetroKeys("VPNSP"))
|
||||
if vpnProvider == "" {
|
||||
if vpnType != vpn.Wireguard && r.Get("OPENVPN_CUSTOM_CONFIG") != nil {
|
||||
if vpnType != constants.Wireguard && r.Get("OPENVPN_CUSTOM_CONFIG") != nil {
|
||||
// retro compatibility
|
||||
return providers.Custom
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user