Maint: remove routing configurator from Openvpn Loop
This commit is contained in:
@@ -322,7 +322,7 @@ func _main(ctx context.Context, buildInfo models.BuildInformation,
|
|||||||
otherGroupHandler := goshutdown.NewGroupHandler("other", defaultGroupSettings)
|
otherGroupHandler := goshutdown.NewGroupHandler("other", defaultGroupSettings)
|
||||||
|
|
||||||
openvpnLooper := openvpn.NewLoop(allSettings.OpenVPN, nonRootUsername, puid, pgid, allServers,
|
openvpnLooper := openvpn.NewLoop(allSettings.OpenVPN, nonRootUsername, puid, pgid, allServers,
|
||||||
ovpnConf, firewallConf, routingConf, logger, httpClient, tunnelReadyCh)
|
ovpnConf, firewallConf, logger, httpClient, tunnelReadyCh)
|
||||||
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
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import (
|
|||||||
"github.com/qdm12/gluetun/internal/loopstate"
|
"github.com/qdm12/gluetun/internal/loopstate"
|
||||||
"github.com/qdm12/gluetun/internal/models"
|
"github.com/qdm12/gluetun/internal/models"
|
||||||
"github.com/qdm12/gluetun/internal/openvpn/state"
|
"github.com/qdm12/gluetun/internal/openvpn/state"
|
||||||
"github.com/qdm12/gluetun/internal/routing"
|
|
||||||
"github.com/qdm12/golibs/logging"
|
"github.com/qdm12/golibs/logging"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -36,9 +35,8 @@ type Loop struct {
|
|||||||
pgid int
|
pgid int
|
||||||
targetConfPath string
|
targetConfPath string
|
||||||
// Configurators
|
// Configurators
|
||||||
conf StarterAuthWriter
|
conf StarterAuthWriter
|
||||||
fw firewallConfigurer
|
fw firewallConfigurer
|
||||||
routing routing.Routing
|
|
||||||
// Other objects
|
// Other objects
|
||||||
logger, pfLogger logging.Logger
|
logger, pfLogger logging.Logger
|
||||||
client *http.Client
|
client *http.Client
|
||||||
@@ -63,11 +61,10 @@ const (
|
|||||||
defaultBackoffTime = 15 * time.Second
|
defaultBackoffTime = 15 * time.Second
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewLoop(settings configuration.OpenVPN,
|
func NewLoop(settings configuration.OpenVPN, username string,
|
||||||
username string, puid, pgid int, allServers models.AllServers,
|
puid, pgid int, allServers models.AllServers, conf Configurator,
|
||||||
conf Configurator, fw firewallConfigurer, routing routing.Routing,
|
fw firewallConfigurer, logger logging.ParentLogger,
|
||||||
logger logging.ParentLogger, client *http.Client,
|
client *http.Client, tunnelReady chan<- struct{}) *Loop {
|
||||||
tunnelReady chan<- struct{}) *Loop {
|
|
||||||
start := make(chan struct{})
|
start := make(chan struct{})
|
||||||
running := make(chan models.LoopStatus)
|
running := make(chan models.LoopStatus)
|
||||||
stop := make(chan struct{})
|
stop := make(chan struct{})
|
||||||
@@ -85,7 +82,6 @@ func NewLoop(settings configuration.OpenVPN,
|
|||||||
targetConfPath: constants.OpenVPNConf,
|
targetConfPath: constants.OpenVPNConf,
|
||||||
conf: conf,
|
conf: conf,
|
||||||
fw: fw,
|
fw: fw,
|
||||||
routing: routing,
|
|
||||||
logger: logger.NewChild(logging.Settings{Prefix: "openvpn: "}),
|
logger: logger.NewChild(logging.Settings{Prefix: "openvpn: "}),
|
||||||
pfLogger: logger.NewChild(logging.Settings{Prefix: "port forwarding: "}),
|
pfLogger: logger.NewChild(logging.Settings{Prefix: "port forwarding: "}),
|
||||||
client: client,
|
client: client,
|
||||||
|
|||||||
Reference in New Issue
Block a user