- New option: `HEALTH_ICMP_TARGET_IP` defaults to `0.0.0.0` meaning use the VPN server public IP address. - Options removed: `HEALTH_VPN_INITIAL_DURATION` and `HEALTH_VPN_ADDITIONAL_DURATION` - times and retries are handpicked and hardcoded. - Less aggressive checks and less false positive detection
32 lines
577 B
Go
32 lines
577 B
Go
package healthcheck
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/qdm12/gluetun/internal/configuration/settings"
|
|
"github.com/qdm12/gluetun/internal/models"
|
|
)
|
|
|
|
type Server struct {
|
|
logger Logger
|
|
handler *handler
|
|
config settings.Health
|
|
}
|
|
|
|
func NewServer(config settings.Health, logger Logger) *Server {
|
|
return &Server{
|
|
logger: logger,
|
|
handler: newHandler(logger),
|
|
config: config,
|
|
}
|
|
}
|
|
|
|
func (s *Server) SetError(err error) {
|
|
s.handler.setErr(err)
|
|
}
|
|
|
|
type StatusApplier interface {
|
|
ApplyStatus(ctx context.Context, status models.LoopStatus) (
|
|
outcome string, err error)
|
|
}
|