Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot] 4c07472dfa Chore(deps): Bump actions/setup-go from 6 to 7
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 6 to 7.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-22 05:22:25 +00:00
6 changed files with 14 additions and 28 deletions
+4 -6
View File
@@ -85,13 +85,13 @@ jobs:
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- uses: actions/setup-go@v6 - uses: actions/setup-go@v7
with: with:
go-version-file: ./devrun/go.mod go-version-file: ./devrun/go.mod
- run: go test ./... - run: go test ./...
working-directory: ./devrun working-directory: ./devrun
- uses: actions/setup-go@v6 - uses: actions/setup-go@v7
with: with:
go-version-file: ./ci/go.mod go-version-file: ./ci/go.mod
- run: go test ./... - run: go test ./...
@@ -114,7 +114,7 @@ jobs:
- run: docker build -t qmcgaw/gluetun . - run: docker build -t qmcgaw/gluetun .
- name: Setup Go for CI utility - name: Setup Go for CI utility
uses: actions/setup-go@v6 uses: actions/setup-go@v7
with: with:
go-version-file: ci/go.mod go-version-file: ci/go.mod
@@ -162,7 +162,7 @@ jobs:
security-events: write security-events: write
steps: steps:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- uses: actions/setup-go@v6 - uses: actions/setup-go@v7
with: with:
go-version-file: go.mod go-version-file: go.mod
- uses: github/codeql-action/init@v4 - uses: github/codeql-action/init@v4
@@ -241,5 +241,3 @@ jobs:
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
push: true push: true
provenance: mode=max
sbom: true
+6
View File
@@ -8,6 +8,7 @@ import (
"net" "net"
"net/netip" "net/netip"
"strings" "strings"
"sync"
"time" "time"
"github.com/qdm12/gluetun/internal/healthcheck/dns" "github.com/qdm12/gluetun/internal/healthcheck/dns"
@@ -23,6 +24,7 @@ type Checker struct {
icmpTargetIPs []netip.Addr icmpTargetIPs []netip.Addr
smallCheckType string smallCheckType string
startupOnFail bool startupOnFail bool
configMutex sync.Mutex
icmpNotPermitted *bool icmpNotPermitted *bool
@@ -53,6 +55,8 @@ func NewChecker(logger Logger) *Checker {
func (c *Checker) SetConfig(tlsDialAddrs []string, icmpTargets []netip.Addr, func (c *Checker) SetConfig(tlsDialAddrs []string, icmpTargets []netip.Addr,
smallCheckType string, startupOnFail bool, smallCheckType string, startupOnFail bool,
) { ) {
c.configMutex.Lock()
defer c.configMutex.Unlock()
c.tlsDialAddrs = tlsDialAddrs c.tlsDialAddrs = tlsDialAddrs
c.icmpTargetIPs = icmpTargets c.icmpTargetIPs = icmpTargets
c.smallCheckType = smallCheckType c.smallCheckType = smallCheckType
@@ -162,8 +166,10 @@ func (c *Checker) Stop() error {
} }
func (c *Checker) smallPeriodicCheck(ctx context.Context) error { func (c *Checker) smallPeriodicCheck(ctx context.Context) error {
c.configMutex.Lock()
icmpTargetIPs := make([]netip.Addr, len(c.icmpTargetIPs)) icmpTargetIPs := make([]netip.Addr, len(c.icmpTargetIPs))
copy(icmpTargetIPs, c.icmpTargetIPs) copy(icmpTargetIPs, c.icmpTargetIPs)
c.configMutex.Unlock()
tryTimeouts := []time.Duration{ tryTimeouts := []time.Duration{
5 * time.Second, 5 * time.Second,
5 * time.Second, 5 * time.Second,
+1 -3
View File
@@ -6,7 +6,6 @@ import (
"fmt" "fmt"
"net/http" "net/http"
"slices" "slices"
"strings"
"sync" "sync"
) )
@@ -61,8 +60,7 @@ func (s *Service) SetPortsForwarded(ctx context.Context, ports []uint16) (err er
s.portMutex.Lock() s.portMutex.Lock()
defer s.portMutex.Unlock() defer s.portMutex.Unlock()
hasPortForwardingCodeRunning := !strings.HasSuffix(s.settings.PortForwarder.Name(), "[not supported]") if s.settings.PortForwarder != nil {
if hasPortForwardingCodeRunning {
return errors.New("setting port forwarded at runtime is not supported with internally running port forwarding code") return errors.New("setting port forwarded at runtime is not supported with internally running port forwarding code")
} }
-7
View File
@@ -45,7 +45,6 @@ type Loop struct {
start <-chan struct{} start <-chan struct{}
running chan<- models.LoopStatus running chan<- models.LoopStatus
userTrigger bool userTrigger bool
healthDone <-chan struct{}
// Internal constant values // Internal constant values
backoffTime time.Duration backoffTime time.Duration
} }
@@ -71,11 +70,6 @@ func NewLoop(vpnSettings settings.VPN, ipv6SupportLevel netlink.IPv6SupportLevel
statusManager := loopstate.New(constants.Stopped, start, running, stop, stopped) statusManager := loopstate.New(constants.Stopped, start, running, stop, stopped)
state := state.New(statusManager, vpnSettings) state := state.New(statusManager, vpnSettings)
// Initialize healthDone channel to a closed channel so that the first time
// we call <-l.healthDone it does not block
healthDone := make(chan struct{})
close(healthDone)
return &Loop{ return &Loop{
statusManager: statusManager, statusManager: statusManager,
state: state, state: state,
@@ -104,7 +98,6 @@ func NewLoop(vpnSettings settings.VPN, ipv6SupportLevel netlink.IPv6SupportLevel
stop: stop, stop: stop,
stopped: stopped, stopped: stopped,
userTrigger: true, userTrigger: true,
healthDone: healthDone,
backoffTime: defaultBackoffTime, backoffTime: defaultBackoffTime,
} }
} }
+1 -1
View File
@@ -55,7 +55,7 @@ func newNoPortForwarder(providerName string) *noPortForwarder {
} }
func (n *noPortForwarder) Name() string { func (n *noPortForwarder) Name() string {
return n.providerName + " [not supported]" return n.providerName
} }
func (n *noPortForwarder) PortForward(context.Context, pfutils.PortForwardObjects) ( func (n *noPortForwarder) PortForward(context.Context, pfutils.PortForwardObjects) (
+2 -11
View File
@@ -81,7 +81,6 @@ func (l *Loop) onTunnelUp(ctx, loopCtx context.Context, data tunnelUpData) {
_, _ = l.dnsLooper.ApplyStatus(ctx, constants.Running) _, _ = l.dnsLooper.ApplyStatus(ctx, constants.Running)
<-l.healthDone // make sure the health checker is stopped before restarting it
icmpTargetIPs := l.healthSettings.ICMPTargetIPs icmpTargetIPs := l.healthSettings.ICMPTargetIPs
if len(icmpTargetIPs) == 1 && icmpTargetIPs[0].IsUnspecified() { if len(icmpTargetIPs) == 1 && icmpTargetIPs[0].IsUnspecified() {
icmpTargetIPs = []netip.Addr{data.serverIP} icmpTargetIPs = []netip.Addr{data.serverIP}
@@ -105,12 +104,7 @@ func (l *Loop) onTunnelUp(ctx, loopCtx context.Context, data tunnelUpData) {
// Start collecting health errors asynchronously, since // Start collecting health errors asynchronously, since
// we should not wait for the code below to complete // we should not wait for the code below to complete
// to start monitoring health and auto-healing. // to start monitoring health and auto-healing.
// We keep track of when this goroutine is done with the healthDone go l.collectHealthErrors(ctx, loopCtx, healthErrCh)
// channel to avoid a race condition where the health checker is stopped
// after being reconfigured and restarted, instead of before.
healthDone := make(chan struct{})
l.healthDone = healthDone
go l.collectHealthErrors(ctx, loopCtx, healthDone, healthErrCh)
err = l.publicip.RunOnce(ctx) err = l.publicip.RunOnce(ctx)
if err != nil { if err != nil {
@@ -146,10 +140,7 @@ func (l *Loop) onTunnelUp(ctx, loopCtx context.Context, data tunnelUpData) {
} }
} }
func (l *Loop) collectHealthErrors(ctx, loopCtx context.Context, func (l *Loop) collectHealthErrors(ctx, loopCtx context.Context, healthErrCh <-chan error) {
done chan<- struct{}, healthErrCh <-chan error,
) {
defer close(done)
var previousHealthErr error var previousHealthErr error
for { for {
select { select {