Skip to content

Commit a0a5683

Browse files
chore(vpn): upsert agents with their network status (coder#15659)
Closes coder#14734. - Each outgoing agent upsertion also includes the timestamp of the last wireguard handshake. - Agent upsertions will be created, for existing agents, with an updated last handshake time on a regular, fixed, interval of 10 seconds.
1 parent ba48069 commit a0a5683

File tree

4 files changed

+496
-88
lines changed

4 files changed

+496
-88
lines changed

.golangci.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,6 @@ linters-settings:
175175
- name: modifies-value-receiver
176176
- name: package-comments
177177
- name: range
178-
- name: range-val-address
179-
- name: range-val-in-closure
180178
- name: receiver-naming
181179
- name: redefines-builtin-id
182180
- name: string-of-int
@@ -199,6 +197,10 @@ linters-settings:
199197
govet:
200198
disable:
201199
- loopclosure
200+
gosec:
201+
excludes:
202+
# Implicit memory aliasing of items from a range statement (irrelevant as of Go v1.22)
203+
- G601
202204

203205
issues:
204206
# Rules listed here: https://github.com/securego/gosec#available-rules
@@ -238,7 +240,6 @@ linters:
238240
- errname
239241
- errorlint
240242
- exhaustruct
241-
- exportloopref
242243
- forcetypeassert
243244
- gocritic
244245
# gocyclo is may be useful in the future when we start caring

vpn/client.go

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"tailscale.com/net/dns"
1212
"tailscale.com/wgengine/router"
1313

14+
"github.com/google/uuid"
1415
"github.com/tailscale/wireguard-go/tun"
1516

1617
"cdr.dev/slog"
@@ -23,6 +24,7 @@ import (
2324

2425
type Conn interface {
2526
CurrentWorkspaceState() (tailnet.WorkspaceUpdate, error)
27+
GetPeerDiagnostics(peerID uuid.UUID) tailnet.PeerDiagnostics
2628
Close() error
2729
}
2830

0 commit comments

Comments
 (0)