Maint: refactor VPN configuration structure
- Paves the way for Wireguard - VPN struct contains Type, Openvpn and Provider configurations - OpenVPN specific options (e.g. client key) moved from Provider to Openvpn configuration struct - Move Provider configuration from OpenVPN configuration to VPN - HTTP control server returns only openvpn settings (not provider settings)
This commit is contained in:
@@ -67,8 +67,10 @@ const (
|
||||
defaultBackoffTime = 15 * time.Second
|
||||
)
|
||||
|
||||
func NewLoop(settings configuration.OpenVPN, username string,
|
||||
puid, pgid int, allServers models.AllServers, conf Configurator,
|
||||
func NewLoop(openVPNSettings configuration.OpenVPN,
|
||||
providerSettings configuration.Provider,
|
||||
username string, puid, pgid int,
|
||||
allServers models.AllServers, conf Configurator,
|
||||
fw firewallConfigurer, routing routing.VPNGetter,
|
||||
portForward portforward.StartStopper,
|
||||
publicip publicip.Looper, dnsLooper dns.Looper,
|
||||
@@ -80,7 +82,7 @@ func NewLoop(settings configuration.OpenVPN, username string,
|
||||
stopped := make(chan struct{})
|
||||
|
||||
statusManager := loopstate.New(constants.Stopped, start, running, stop, stopped)
|
||||
state := state.New(statusManager, settings, allServers)
|
||||
state := state.New(statusManager, openVPNSettings, providerSettings, allServers)
|
||||
|
||||
return &Loop{
|
||||
statusManager: statusManager,
|
||||
|
||||
Reference in New Issue
Block a user