chore(provider): use type assertion for port forwarders
This commit is contained in:
@@ -7,23 +7,20 @@ import (
|
|||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/airvpn/updater"
|
"github.com/qdm12/gluetun/internal/provider/airvpn/updater"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(storage common.Storage, randSource rand.Source,
|
func New(storage common.Storage, randSource rand.Source,
|
||||||
client *http.Client) *Provider {
|
client *http.Client) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Example),
|
Fetcher: updater.New(client),
|
||||||
Fetcher: updater.New(client),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,15 +8,13 @@ import (
|
|||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
extractor Extractor
|
extractor Extractor
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(extractor Extractor) *Provider {
|
func New(extractor Extractor) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
extractor: extractor,
|
extractor: extractor,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Custom),
|
Fetcher: utils.NewNoFetcher(providers.Custom),
|
||||||
Fetcher: utils.NewNoFetcher(providers.Custom),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,23 +6,20 @@ import (
|
|||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/cyberghost/updater"
|
"github.com/qdm12/gluetun/internal/provider/cyberghost/updater"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(storage common.Storage, randSource rand.Source,
|
func New(storage common.Storage, randSource rand.Source,
|
||||||
parallelResolver common.ParallelResolver) *Provider {
|
parallelResolver common.ParallelResolver) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Cyberghost),
|
Fetcher: updater.New(parallelResolver),
|
||||||
Fetcher: updater.New(parallelResolver),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,13 +7,11 @@ import (
|
|||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/example/updater"
|
"github.com/qdm12/gluetun/internal/provider/example/updater"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22,10 +20,9 @@ func New(storage common.Storage, randSource rand.Source,
|
|||||||
updaterWarner common.Warner, client *http.Client,
|
updaterWarner common.Warner, client *http.Client,
|
||||||
unzipper common.Unzipper, parallelResolver common.ParallelResolver) *Provider {
|
unzipper common.Unzipper, parallelResolver common.ParallelResolver) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Example),
|
Fetcher: updater.New(updaterWarner, unzipper, client, parallelResolver),
|
||||||
Fetcher: updater.New(updaterWarner, unzipper, client, parallelResolver),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ import (
|
|||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/expressvpn/updater"
|
"github.com/qdm12/gluetun/internal/provider/expressvpn/updater"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,10 +18,9 @@ func New(storage common.Storage, randSource rand.Source,
|
|||||||
unzipper common.Unzipper, updaterWarner common.Warner,
|
unzipper common.Unzipper, updaterWarner common.Warner,
|
||||||
parallelResolver common.ParallelResolver) *Provider {
|
parallelResolver common.ParallelResolver) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Expressvpn),
|
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
||||||
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ import (
|
|||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/fastestvpn/updater"
|
"github.com/qdm12/gluetun/internal/provider/fastestvpn/updater"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,10 +18,9 @@ func New(storage common.Storage, randSource rand.Source,
|
|||||||
unzipper common.Unzipper, updaterWarner common.Warner,
|
unzipper common.Unzipper, updaterWarner common.Warner,
|
||||||
parallelResolver common.ParallelResolver) *Provider {
|
parallelResolver common.ParallelResolver) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Fastestvpn),
|
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
||||||
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,13 +7,11 @@ import (
|
|||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/hidemyass/updater"
|
"github.com/qdm12/gluetun/internal/provider/hidemyass/updater"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,10 +19,9 @@ func New(storage common.Storage, randSource rand.Source,
|
|||||||
client *http.Client, updaterWarner common.Warner,
|
client *http.Client, updaterWarner common.Warner,
|
||||||
parallelResolver common.ParallelResolver) *Provider {
|
parallelResolver common.ParallelResolver) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.HideMyAss),
|
Fetcher: updater.New(client, updaterWarner, parallelResolver),
|
||||||
Fetcher: updater.New(client, updaterWarner, parallelResolver),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ import (
|
|||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/ipvanish/updater"
|
"github.com/qdm12/gluetun/internal/provider/ipvanish/updater"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,10 +18,9 @@ func New(storage common.Storage, randSource rand.Source,
|
|||||||
unzipper common.Unzipper, updaterWarner common.Warner,
|
unzipper common.Unzipper, updaterWarner common.Warner,
|
||||||
parallelResolver common.ParallelResolver) *Provider {
|
parallelResolver common.ParallelResolver) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Ipvanish),
|
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
||||||
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,13 +7,11 @@ import (
|
|||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/ivpn/updater"
|
"github.com/qdm12/gluetun/internal/provider/ivpn/updater"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,10 +19,9 @@ func New(storage common.Storage, randSource rand.Source,
|
|||||||
client *http.Client, updaterWarner common.Warner,
|
client *http.Client, updaterWarner common.Warner,
|
||||||
parallelResolver common.ParallelResolver) *Provider {
|
parallelResolver common.ParallelResolver) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Ivpn),
|
Fetcher: updater.New(client, updaterWarner, parallelResolver),
|
||||||
Fetcher: updater.New(client, updaterWarner, parallelResolver),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,23 +7,20 @@ import (
|
|||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/mullvad/updater"
|
"github.com/qdm12/gluetun/internal/provider/mullvad/updater"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(storage common.Storage, randSource rand.Source,
|
func New(storage common.Storage, randSource rand.Source,
|
||||||
client *http.Client) *Provider {
|
client *http.Client) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Mullvad),
|
Fetcher: updater.New(client),
|
||||||
Fetcher: updater.New(client),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,23 +7,20 @@ import (
|
|||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/nordvpn/updater"
|
"github.com/qdm12/gluetun/internal/provider/nordvpn/updater"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(storage common.Storage, randSource rand.Source,
|
func New(storage common.Storage, randSource rand.Source,
|
||||||
client *http.Client, updaterWarner common.Warner) *Provider {
|
client *http.Client, updaterWarner common.Warner) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Nordvpn),
|
Fetcher: updater.New(client, updaterWarner),
|
||||||
Fetcher: updater.New(client, updaterWarner),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,23 +6,20 @@ import (
|
|||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/perfectprivacy/updater"
|
"github.com/qdm12/gluetun/internal/provider/perfectprivacy/updater"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(storage common.Storage, randSource rand.Source,
|
func New(storage common.Storage, randSource rand.Source,
|
||||||
unzipper common.Unzipper, updaterWarner common.Warner) *Provider {
|
unzipper common.Unzipper, updaterWarner common.Warner) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Perfectprivacy),
|
Fetcher: updater.New(unzipper, updaterWarner),
|
||||||
Fetcher: updater.New(unzipper, updaterWarner),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ import (
|
|||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/privado/updater"
|
"github.com/qdm12/gluetun/internal/provider/privado/updater"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,10 +19,9 @@ func New(storage common.Storage, randSource rand.Source,
|
|||||||
updaterWarner common.Warner,
|
updaterWarner common.Warner,
|
||||||
parallelResolver common.ParallelResolver) *Provider {
|
parallelResolver common.ParallelResolver) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Privado),
|
Fetcher: updater.New(ipFetcher, unzipper, updaterWarner, parallelResolver),
|
||||||
Fetcher: updater.New(ipFetcher, unzipper, updaterWarner, parallelResolver),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ import (
|
|||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/privatevpn/updater"
|
"github.com/qdm12/gluetun/internal/provider/privatevpn/updater"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,10 +18,9 @@ func New(storage common.Storage, randSource rand.Source,
|
|||||||
unzipper common.Unzipper, updaterWarner common.Warner,
|
unzipper common.Unzipper, updaterWarner common.Warner,
|
||||||
parallelResolver common.ParallelResolver) *Provider {
|
parallelResolver common.ParallelResolver) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Privatevpn),
|
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
||||||
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
|
|
||||||
"github.com/qdm12/gluetun/internal/configuration/settings"
|
"github.com/qdm12/gluetun/internal/configuration/settings"
|
||||||
"github.com/qdm12/gluetun/internal/models"
|
"github.com/qdm12/gluetun/internal/models"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// 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.
|
||||||
@@ -13,14 +12,6 @@ type Provider interface {
|
|||||||
GetConnection(selection settings.ServerSelection, ipv6Supported bool) (connection models.Connection, err error)
|
GetConnection(selection settings.ServerSelection, ipv6Supported bool) (connection models.Connection, err error)
|
||||||
OpenVPNConfig(connection models.Connection, settings settings.OpenVPN, ipv6Supported bool) (lines []string)
|
OpenVPNConfig(connection models.Connection, settings settings.OpenVPN, ipv6Supported bool) (lines []string)
|
||||||
Name() string
|
Name() string
|
||||||
PortForwarder
|
|
||||||
FetchServers(ctx context.Context, minServers int) (
|
FetchServers(ctx context.Context, minServers int) (
|
||||||
servers []models.Server, err error)
|
servers []models.Server, err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type PortForwarder interface {
|
|
||||||
Name() string
|
|
||||||
PortForward(ctx context.Context, objects utils.PortForwardObjects) (
|
|
||||||
port uint16, err error)
|
|
||||||
KeepPortForward(ctx context.Context, objects utils.PortForwardObjects) (err error)
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ import (
|
|||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/purevpn/updater"
|
"github.com/qdm12/gluetun/internal/provider/purevpn/updater"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,10 +18,9 @@ func New(storage common.Storage, randSource rand.Source,
|
|||||||
ipFetcher common.IPFetcher, unzipper common.Unzipper,
|
ipFetcher common.IPFetcher, unzipper common.Unzipper,
|
||||||
updaterWarner common.Warner, parallelResolver common.ParallelResolver) *Provider {
|
updaterWarner common.Warner, parallelResolver common.ParallelResolver) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Purevpn),
|
Fetcher: updater.New(ipFetcher, unzipper, updaterWarner, parallelResolver),
|
||||||
Fetcher: updater.New(ipFetcher, unzipper, updaterWarner, parallelResolver),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,13 +7,11 @@ import (
|
|||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/slickvpn/updater"
|
"github.com/qdm12/gluetun/internal/provider/slickvpn/updater"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,10 +19,9 @@ func New(storage common.Storage, randSource rand.Source,
|
|||||||
client *http.Client, updaterWarner common.Warner,
|
client *http.Client, updaterWarner common.Warner,
|
||||||
parallelResolver common.ParallelResolver) *Provider {
|
parallelResolver common.ParallelResolver) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.SlickVPN),
|
Fetcher: updater.New(client, updaterWarner, parallelResolver),
|
||||||
Fetcher: updater.New(client, updaterWarner, parallelResolver),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,13 +7,11 @@ import (
|
|||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/surfshark/updater"
|
"github.com/qdm12/gluetun/internal/provider/surfshark/updater"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,10 +19,9 @@ func New(storage common.Storage, randSource rand.Source,
|
|||||||
client *http.Client, unzipper common.Unzipper, updaterWarner common.Warner,
|
client *http.Client, unzipper common.Unzipper, updaterWarner common.Warner,
|
||||||
parallelResolver common.ParallelResolver) *Provider {
|
parallelResolver common.ParallelResolver) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Surfshark),
|
Fetcher: updater.New(client, unzipper, updaterWarner, parallelResolver),
|
||||||
Fetcher: updater.New(client, unzipper, updaterWarner, parallelResolver),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ import (
|
|||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/torguard/updater"
|
"github.com/qdm12/gluetun/internal/provider/torguard/updater"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,10 +18,9 @@ func New(storage common.Storage, randSource rand.Source,
|
|||||||
unzipper common.Unzipper, updaterWarner common.Warner,
|
unzipper common.Unzipper, updaterWarner common.Warner,
|
||||||
parallelResolver common.ParallelResolver) *Provider {
|
parallelResolver common.ParallelResolver) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Torguard),
|
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
||||||
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
package utils
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"errors"
|
|
||||||
"fmt"
|
|
||||||
)
|
|
||||||
|
|
||||||
type NoPortForwarder interface {
|
|
||||||
PortForward(ctx context.Context, objects PortForwardObjects) (port uint16, err error)
|
|
||||||
KeepPortForward(ctx context.Context, objects PortForwardObjects) (err error)
|
|
||||||
}
|
|
||||||
|
|
||||||
type NoPortForwarding struct {
|
|
||||||
providerName string
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewNoPortForwarding(providerName string) *NoPortForwarding {
|
|
||||||
return &NoPortForwarding{
|
|
||||||
providerName: providerName,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var ErrPortForwardingNotSupported = errors.New("custom port forwarding obtention is not supported")
|
|
||||||
|
|
||||||
func (n *NoPortForwarding) PortForward(context.Context, PortForwardObjects) (
|
|
||||||
port uint16, err error) {
|
|
||||||
return 0, fmt.Errorf("%w: for %s", ErrPortForwardingNotSupported, n.providerName)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (n *NoPortForwarding) KeepPortForward(context.Context, PortForwardObjects) (err error) {
|
|
||||||
return fmt.Errorf("%w: for %s", ErrPortForwardingNotSupported, n.providerName)
|
|
||||||
}
|
|
||||||
@@ -6,14 +6,12 @@ import (
|
|||||||
|
|
||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
"github.com/qdm12/gluetun/internal/provider/vpnsecure/updater"
|
"github.com/qdm12/gluetun/internal/provider/vpnsecure/updater"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,10 +19,9 @@ func New(storage common.Storage, randSource rand.Source,
|
|||||||
client *http.Client, updaterWarner common.Warner,
|
client *http.Client, updaterWarner common.Warner,
|
||||||
parallelResolver common.ParallelResolver) *Provider {
|
parallelResolver common.ParallelResolver) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.VPNSecure),
|
Fetcher: updater.New(client, updaterWarner, parallelResolver),
|
||||||
Fetcher: updater.New(client, updaterWarner, parallelResolver),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,14 +5,12 @@ import (
|
|||||||
|
|
||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
"github.com/qdm12/gluetun/internal/provider/vpnunlimited/updater"
|
"github.com/qdm12/gluetun/internal/provider/vpnunlimited/updater"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,10 +18,9 @@ func New(storage common.Storage, randSource rand.Source,
|
|||||||
unzipper common.Unzipper, updaterWarner common.Warner,
|
unzipper common.Unzipper, updaterWarner common.Warner,
|
||||||
parallelResolver common.ParallelResolver) *Provider {
|
parallelResolver common.ParallelResolver) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.VPNUnlimited),
|
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
||||||
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,14 +5,12 @@ import (
|
|||||||
|
|
||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
"github.com/qdm12/gluetun/internal/provider/vyprvpn/updater"
|
"github.com/qdm12/gluetun/internal/provider/vyprvpn/updater"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,10 +18,9 @@ func New(storage common.Storage, randSource rand.Source,
|
|||||||
unzipper common.Unzipper, updaterWarner common.Warner,
|
unzipper common.Unzipper, updaterWarner common.Warner,
|
||||||
parallelResolver common.ParallelResolver) *Provider {
|
parallelResolver common.ParallelResolver) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Vyprvpn),
|
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
||||||
Fetcher: updater.New(unzipper, updaterWarner, parallelResolver),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,14 +5,12 @@ import (
|
|||||||
|
|
||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
"github.com/qdm12/gluetun/internal/provider/wevpn/updater"
|
"github.com/qdm12/gluetun/internal/provider/wevpn/updater"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -20,10 +18,9 @@ func New(storage common.Storage, randSource rand.Source,
|
|||||||
updaterWarner common.Warner,
|
updaterWarner common.Warner,
|
||||||
parallelResolver common.ParallelResolver) *Provider {
|
parallelResolver common.ParallelResolver) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Wevpn),
|
Fetcher: updater.New(updaterWarner, parallelResolver),
|
||||||
Fetcher: updater.New(updaterWarner, parallelResolver),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,24 +6,21 @@ import (
|
|||||||
|
|
||||||
"github.com/qdm12/gluetun/internal/constants/providers"
|
"github.com/qdm12/gluetun/internal/constants/providers"
|
||||||
"github.com/qdm12/gluetun/internal/provider/common"
|
"github.com/qdm12/gluetun/internal/provider/common"
|
||||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
|
||||||
"github.com/qdm12/gluetun/internal/provider/windscribe/updater"
|
"github.com/qdm12/gluetun/internal/provider/windscribe/updater"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Provider struct {
|
type Provider struct {
|
||||||
storage common.Storage
|
storage common.Storage
|
||||||
randSource rand.Source
|
randSource rand.Source
|
||||||
utils.NoPortForwarder
|
|
||||||
common.Fetcher
|
common.Fetcher
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(storage common.Storage, randSource rand.Source,
|
func New(storage common.Storage, randSource rand.Source,
|
||||||
client *http.Client, updaterWarner common.Warner) *Provider {
|
client *http.Client, updaterWarner common.Warner) *Provider {
|
||||||
return &Provider{
|
return &Provider{
|
||||||
storage: storage,
|
storage: storage,
|
||||||
randSource: randSource,
|
randSource: randSource,
|
||||||
NoPortForwarder: utils.NewNoPortForwarding(providers.Windscribe),
|
Fetcher: updater.New(client, updaterWarner),
|
||||||
Fetcher: updater.New(client, updaterWarner),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/qdm12/gluetun/internal/netlink"
|
"github.com/qdm12/gluetun/internal/netlink"
|
||||||
portforward "github.com/qdm12/gluetun/internal/portforward/service"
|
portforward "github.com/qdm12/gluetun/internal/portforward/service"
|
||||||
"github.com/qdm12/gluetun/internal/provider"
|
"github.com/qdm12/gluetun/internal/provider"
|
||||||
|
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Firewall interface {
|
type Firewall interface {
|
||||||
@@ -35,6 +36,21 @@ type Providers interface {
|
|||||||
Get(providerName string) provider.Provider
|
Get(providerName string) provider.Provider
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Provider interface {
|
||||||
|
GetConnection(selection settings.ServerSelection, ipv6Supported bool) (connection models.Connection, err error)
|
||||||
|
OpenVPNConfig(connection models.Connection, settings settings.OpenVPN, ipv6Supported bool) (lines []string)
|
||||||
|
Name() string
|
||||||
|
FetchServers(ctx context.Context, minServers int) (
|
||||||
|
servers []models.Server, err error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type PortForwarder interface {
|
||||||
|
Name() string
|
||||||
|
PortForward(ctx context.Context, objects utils.PortForwardObjects) (
|
||||||
|
port uint16, err error)
|
||||||
|
KeepPortForward(ctx context.Context, objects utils.PortForwardObjects) (err error)
|
||||||
|
}
|
||||||
|
|
||||||
type Storage interface {
|
type Storage interface {
|
||||||
FilterServers(provider string, selection settings.ServerSelection) (servers []models.Server, err error)
|
FilterServers(provider string, selection settings.ServerSelection) (servers []models.Server, err error)
|
||||||
GetServerByName(provider, name string) (server models.Server, ok bool)
|
GetServerByName(provider, name string) (server models.Server, ok bool)
|
||||||
|
|||||||
@@ -1,10 +1,27 @@
|
|||||||
package vpn
|
package vpn
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/qdm12/gluetun/internal/configuration/settings"
|
"github.com/qdm12/gluetun/internal/configuration/settings"
|
||||||
"github.com/qdm12/gluetun/internal/portforward/service"
|
"github.com/qdm12/gluetun/internal/portforward/service"
|
||||||
|
pfutils "github.com/qdm12/gluetun/internal/provider/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func getPortForwarder(provider Provider, providers Providers, //nolint:ireturn
|
||||||
|
customPortForwarderName string) (portForwarder PortForwarder) {
|
||||||
|
if customPortForwarderName != "" {
|
||||||
|
provider = providers.Get(customPortForwarderName)
|
||||||
|
}
|
||||||
|
portForwarder, ok := provider.(PortForwarder)
|
||||||
|
if ok {
|
||||||
|
return portForwarder
|
||||||
|
}
|
||||||
|
return newNoPortForwarder(provider.Name())
|
||||||
|
}
|
||||||
|
|
||||||
func (l *Loop) startPortForwarding(data tunnelUpData) (err error) {
|
func (l *Loop) startPortForwarding(data tunnelUpData) (err error) {
|
||||||
partialUpdate := service.Settings{
|
partialUpdate := service.Settings{
|
||||||
PortForwarder: data.portForwarder,
|
PortForwarder: data.portForwarder,
|
||||||
@@ -24,3 +41,28 @@ func (l *Loop) stopPortForwarding(vpnProvider string) (err error) {
|
|||||||
}
|
}
|
||||||
return l.portForward.UpdateWith(partialUpdate)
|
return l.portForward.UpdateWith(partialUpdate)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type noPortForwarder struct {
|
||||||
|
providerName string
|
||||||
|
}
|
||||||
|
|
||||||
|
func newNoPortForwarder(providerName string) *noPortForwarder {
|
||||||
|
return &noPortForwarder{
|
||||||
|
providerName: providerName,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var ErrPortForwardingNotSupported = errors.New("custom port forwarding obtention is not supported")
|
||||||
|
|
||||||
|
func (n *noPortForwarder) Name() string {
|
||||||
|
return n.providerName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (n *noPortForwarder) PortForward(context.Context, pfutils.PortForwardObjects) (
|
||||||
|
port uint16, err error) {
|
||||||
|
return 0, fmt.Errorf("%w: for %s", ErrPortForwardingNotSupported, n.providerName)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (n *noPortForwarder) KeepPortForward(context.Context, pfutils.PortForwardObjects) (err error) {
|
||||||
|
return fmt.Errorf("%w: for %s", ErrPortForwardingNotSupported, n.providerName)
|
||||||
|
}
|
||||||
|
|||||||
@@ -22,11 +22,8 @@ func (l *Loop) Run(ctx context.Context, done chan<- struct{}) {
|
|||||||
|
|
||||||
providerConf := l.providers.Get(*settings.Provider.Name)
|
providerConf := l.providers.Get(*settings.Provider.Name)
|
||||||
|
|
||||||
customPortForwardingProvider := *settings.Provider.PortForwarding.Provider
|
portForwarder := getPortForwarder(providerConf, l.providers,
|
||||||
portForwarder := providerConf
|
*settings.Provider.PortForwarding.Provider)
|
||||||
if customPortForwardingProvider != "" {
|
|
||||||
portForwarder = l.providers.Get(customPortForwardingProvider)
|
|
||||||
}
|
|
||||||
|
|
||||||
var vpnRunner interface {
|
var vpnRunner interface {
|
||||||
Run(ctx context.Context, waitError chan<- error, tunnelReady chan<- struct{})
|
Run(ctx context.Context, waitError chan<- error, tunnelReady chan<- struct{})
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/qdm12/gluetun/internal/constants"
|
"github.com/qdm12/gluetun/internal/constants"
|
||||||
"github.com/qdm12/gluetun/internal/provider"
|
|
||||||
"github.com/qdm12/gluetun/internal/version"
|
"github.com/qdm12/gluetun/internal/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -12,7 +11,7 @@ type tunnelUpData struct {
|
|||||||
// Port forwarding
|
// Port forwarding
|
||||||
vpnIntf string
|
vpnIntf string
|
||||||
serverName string
|
serverName string
|
||||||
portForwarder provider.PortForwarder
|
portForwarder PortForwarder
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *Loop) onTunnelUp(ctx context.Context, data tunnelUpData) {
|
func (l *Loop) onTunnelUp(ctx context.Context, data tunnelUpData) {
|
||||||
|
|||||||
Reference in New Issue
Block a user