Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spikecurtis opened this issue Sep 19, 2024 · 0 comments · Fixed by #15659
Closed

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

spikecurtis opened this issue Sep 19, 2024 · 0 comments · Fixed by #15659
Assignees
Labels
networking Area: networking

Comments

@spikecurtis
Copy link
Contributor

To support a macOS version of a native desktop VPN to Coder workspaces, we plan to use a dynamic library loaded by a host NetworkExtension written in Swift. The dynamic library will be embedded in the full coder binary that includes the Coder server. Coder server will allow downloading the dynamic library just like we do for "slim" client binaries on different operating systems.

Image

This allows our macOS application to seamless work with multiple versions of Coder, but downloading the dynamic library from the Coder server you sign into.

The dynamic library will export a function via the C foreign function interface (FFI) that accepts a pair of pipes for bi-directional communication. The function then sets up the CoderVPN Control Protocol (#14731) over the pipes, and implements the "Tunnel" side of the protocol. The macOS application can then start and stop the VPN via this protocol.

To implement the VPN, we use the workspacesdk API to start a tailnet for all the user's workspaces (#14730), including the Router (#14732) and dns.OSConfigurator (#14733) components built for this purpose.

@spikecurtis spikecurtis added feature networking Area: networking labels Sep 19, 2024
@matifali matifali removed the feature label Oct 14, 2024
ethanndickson added a commit that referenced this issue Nov 20, 2024
ethanndickson added a commit that referenced this issue Dec 5, 2024
Addresses #14734.

This PR wires up `tunnel.go` to a `tailnet.Conn` via the new `/tailnet` endpoint, with all the necessary controllers such that a VPN connection can be started, stopped and inspected via the CoderVPN protocol.
ethanndickson added a commit that referenced this issue Dec 5, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
networking Area: networking
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants