Skip to content

chore(vpn): upsert agents with their network status - #15659

Merged
ethanndickson merged 1 commit into
mainfrom
ethan/vpn-agents-netstatus
Dec 5, 2024
Merged

ethanndickson merged 1 commit into
mainfrom
ethan/vpn-agents-netstatus

Conversation

@ethanndickson

@ethanndickson ethanndickson commented Nov 26, 2024 •

Copy link
Copy Markdown
Member

Closes #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.

ethanndickson commented Nov 26, 2024 •

Copy link
Copy Markdown
Member Author

@ethanndickson
ethanndickson force-pushed the ethan/vpn-agents-netstatus branch from cf43bdd to 594fbc6 Compare November 26, 2024 02:36
@ethanndickson
ethanndickson marked this pull request as ready for review November 26, 2024 02:46
@ethanndickson
ethanndickson requested review from deansheather, johnstcn and spikecurtis and removed request for johnstcn and spikecurtis November 26, 2024 02:46
Comment thread vpn/tunnel.go Resolved
Comment thread vpn/tunnel.go Resolved
Comment thread vpn/tunnel.go Resolved
Comment thread vpn/tunnel.go Resolved
Comment thread vpn/tunnel.go Resolved
Comment thread vpn/tunnel.go Resolved
@ethanndickson
ethanndickson force-pushed the ethan/vpn-agents-netstatus branch from 594fbc6 to 1347916 Compare November 27, 2024 01:52
Comment thread vpn/tunnel.go Resolved
Comment thread vpn/tunnel.go Resolved
Comment thread vpn/tunnel.go Outdated
}
resp.Msg = &TunnelMessage_PeerUpdate{
PeerUpdate: convertWorkspaceUpdate(state),
PeerUpdate: update,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it OK to send a nil PeerUpdate in the response?

@ethanndickson ethanndickson Dec 2, 2024 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I don't think we should.

For pushed updates, if there's no active connection (for whatever reason, should be impossible once the tunnel has started), we'll just send a nil last handshake time.

For requested updates, I think we have to send a nil PeerUpdate if we can't call CurentWorkspaceState.

Comment thread vpn/tunnel.go Resolved
Comment thread vpn/tunnel.go Resolved
Comment thread vpn/tunnel.go Resolved
@ethanndickson
ethanndickson force-pushed the ethan/vpn-agents-netstatus branch from d150a25 to a456281 Compare December 3, 2024 03:17
Comment thread .golangci.yaml Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread .golangci.yaml Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread vpn/tunnel.go Outdated

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original code also sent resp := &TunnelMessage{} as a reply for the default: branch, so I assume it's still fine.

@spikecurtis spikecurtis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ethanndickson
ethanndickson force-pushed the ethan/vpn-agents-netstatus branch from e3f8508 to 561f65f Compare December 5, 2024 01:56
@ethanndickson
ethanndickson force-pushed the ethan/vpn-agents-netstatus branch from 561f65f to 6cd9c76 Compare December 5, 2024 02:15
@ethanndickson
ethanndickson changed the base branch from ethan/vpn-client to graphite-base/15659 December 5, 2024 02:30
@ethanndickson
ethanndickson force-pushed the ethan/vpn-agents-netstatus branch from 6cd9c76 to b2fd151 Compare December 5, 2024 02:30
@ethanndickson
ethanndickson changed the base branch from graphite-base/15659 to main December 5, 2024 02:31
@ethanndickson
ethanndickson force-pushed the ethan/vpn-agents-netstatus branch from b2fd151 to acdd09d Compare December 5, 2024 02:31
@ethanndickson
ethanndickson merged commit a0a5683 into main Dec 5, 2024
@ethanndickson
ethanndickson deleted the ethan/vpn-agents-netstatus branch December 5, 2024 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build a CoderVPN dynamic library and include it in the full coder binary

4 participants