diff --git a/internal/vpn/client.go b/internal/vpn/client.go index b3327068b..675bbac26 100644 --- a/internal/vpn/client.go +++ b/internal/vpn/client.go @@ -78,6 +78,11 @@ func NewClient(cfg ClientConfig, appCl *app.Client) (*Client, error) { return nil, fmt.Errorf("error getting RF IP: %w", err) } + utIP, err := uptimeTrackerIPFromEnv() + if err != nil { + return nil, fmt.Errorf("error getting UT IP: %w", err) + } + stcpEntities, err := stcpEntitiesFromEnv() if err != nil { return nil, fmt.Errorf("error getting STCP entities: %w", err) @@ -99,6 +104,10 @@ func NewClient(cfg ClientConfig, appCl *app.Client) (*Client, error) { directIPs = append(directIPs, arIP) } + if utIP != nil { + directIPs = append(directIPs, utIP) + } + const ( serverDialInitBO = 1 * time.Second serverDialMaxBO = 10 * time.Second @@ -552,6 +561,10 @@ func rfIPFromEnv() (net.IP, error) { return ipFromEnv(RFAddrEnvKey) } +func uptimeTrackerIPFromEnv() (net.IP, error) { + return ipFromEnv(UptimeTrackerAddrEnvKey) +} + func tpRemoteIPsFromEnv() ([]net.IP, error) { var ips []net.IP ipsLenStr := os.Getenv(TPRemoteIPsLenEnvKey)