mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-06 20:10:11 +02:00
feat(others): optional BORINGPOLL_GLUETUNCOM to fight AI slop scammy gluetun[dot]com
This commit is contained in:
@@ -25,4 +25,9 @@ func (l *Loop) cleanup() {
|
||||
l.logger.Error("stopping port forwarding: " + err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
err = l.boringPoll.Stop()
|
||||
if err != nil {
|
||||
l.logger.Error("stopping boring poll: " + err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,3 +115,8 @@ type HealthChecker interface {
|
||||
type HealthServer interface {
|
||||
SetError(err error)
|
||||
}
|
||||
|
||||
type Service interface {
|
||||
Start() (runError <-chan error, err error)
|
||||
Stop() error
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ type Loop struct {
|
||||
portForward PortForward
|
||||
publicip PublicIPLoop
|
||||
dnsLooper DNSLoop
|
||||
boringPoll Service
|
||||
// Other objects
|
||||
starter CmdStarter // for OpenVPN
|
||||
logger log.LoggerInterface
|
||||
@@ -52,9 +53,9 @@ const (
|
||||
)
|
||||
|
||||
func NewLoop(vpnSettings settings.VPN, ipv6Supported bool, vpnInputPorts []uint16,
|
||||
providers Providers, storage Storage, healthSettings settings.Health,
|
||||
healthChecker HealthChecker, healthServer HealthServer, openvpnConf OpenVPN,
|
||||
netLinker NetLinker, fw Firewall, routing Routing,
|
||||
providers Providers, storage Storage, boringPoll Service,
|
||||
healthSettings settings.Health, healthChecker HealthChecker, healthServer HealthServer,
|
||||
openvpnConf OpenVPN, netLinker NetLinker, fw Firewall, routing Routing,
|
||||
portForward PortForward, starter CmdStarter,
|
||||
publicip PublicIPLoop, dnsLooper DNSLoop,
|
||||
logger log.LoggerInterface, client *http.Client,
|
||||
@@ -80,6 +81,7 @@ func NewLoop(vpnSettings settings.VPN, ipv6Supported bool, vpnInputPorts []uint1
|
||||
versionInfo: versionInfo,
|
||||
ipv6Supported: ipv6Supported,
|
||||
vpnInputPorts: vpnInputPorts,
|
||||
boringPoll: boringPoll,
|
||||
openvpnConf: openvpnConf,
|
||||
netLinker: netLinker,
|
||||
fw: fw,
|
||||
|
||||
@@ -119,6 +119,11 @@ func (l *Loop) onTunnelUp(ctx, loopCtx context.Context, data tunnelUpData) {
|
||||
if err != nil {
|
||||
l.logger.Error(err.Error())
|
||||
}
|
||||
|
||||
_, err = l.boringPoll.Start()
|
||||
if err != nil {
|
||||
l.logger.Error("cannot start boring poll: " + err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func (l *Loop) collectHealthErrors(ctx, loopCtx context.Context, healthErrCh <-chan error) {
|
||||
|
||||
Reference in New Issue
Block a user