- Notifications
You must be signed in to change notification settings - Fork1k
chore: cherry-pick coder desktop + corporate vpn fixes for 2.24#19177
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
7 commits Select commitHold shift + click to select a range
c64b3c0
ci: conditionally disable spotlight indexing (#19124)
johnstcn9f2dc72
ci: bump xcode version to 16.1.0 (#19125)
johnstcn914daac
ci: set valid xcode version in release script (#19143)
ethanndickson618121c
chore: add support for tailscale soft isolation in VPN (#19023)
deansheatherba0b124
chore: remove soft isolation configurability (#19069)
deansheather19171e2
fix: avoid duplicating logs on Coder Connect Windows (#19052)
deansheather18b037d
chore: add `vpn-daemon run` command for macos (#19080)
ethanndicksonFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
7 changes: 6 additions & 1 deletion.github/workflows/ci.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions.github/workflows/release.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletionscli/vpndaemon_darwin.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
//go:build darwin | ||
package cli | ||
import ( | ||
"golang.org/x/xerrors" | ||
"cdr.dev/slog" | ||
"github.com/coder/coder/v2/vpn" | ||
"github.com/coder/serpent" | ||
) | ||
func (r *RootCmd) vpnDaemonRun() *serpent.Command { | ||
var ( | ||
rpcReadFD int64 | ||
rpcWriteFD int64 | ||
) | ||
cmd := &serpent.Command{ | ||
Use: "run", | ||
Short: "Run the VPN daemon on macOS.", | ||
Middleware: serpent.Chain( | ||
serpent.RequireNArgs(0), | ||
), | ||
Options: serpent.OptionSet{ | ||
{ | ||
Flag: "rpc-read-fd", | ||
Env: "CODER_VPN_DAEMON_RPC_READ_FD", | ||
Description: "The file descriptor for the pipe to read from the RPC connection.", | ||
Value: serpent.Int64Of(&rpcReadFD), | ||
Required: true, | ||
}, | ||
{ | ||
Flag: "rpc-write-fd", | ||
Env: "CODER_VPN_DAEMON_RPC_WRITE_FD", | ||
Description: "The file descriptor for the pipe to write to the RPC connection.", | ||
Value: serpent.Int64Of(&rpcWriteFD), | ||
Required: true, | ||
}, | ||
}, | ||
Handler: func(inv *serpent.Invocation) error { | ||
ctx := inv.Context() | ||
if rpcReadFD < 0 || rpcWriteFD < 0 { | ||
return xerrors.Errorf("rpc-read-fd (%v) and rpc-write-fd (%v) must be positive", rpcReadFD, rpcWriteFD) | ||
} | ||
if rpcReadFD == rpcWriteFD { | ||
return xerrors.Errorf("rpc-read-fd (%v) and rpc-write-fd (%v) must be different", rpcReadFD, rpcWriteFD) | ||
} | ||
pipe, err := vpn.NewBidirectionalPipe(uintptr(rpcReadFD), uintptr(rpcWriteFD)) | ||
if err != nil { | ||
return xerrors.Errorf("create bidirectional RPC pipe: %w", err) | ||
} | ||
defer pipe.Close() | ||
tunnel, err := vpn.NewTunnel(ctx, slog.Make().Leveled(slog.LevelDebug), pipe, | ||
vpn.NewClient(), | ||
vpn.UseOSNetworkingStack(), | ||
vpn.UseAsLogger(), | ||
) | ||
if err != nil { | ||
return xerrors.Errorf("create new tunnel for client: %w", err) | ||
} | ||
defer tunnel.Close() | ||
<-ctx.Done() | ||
return nil | ||
}, | ||
} | ||
return cmd | ||
} |
2 changes: 1 addition & 1 deletioncli/vpndaemon_other.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !windows && !darwin | ||
package cli | ||
5 changes: 1 addition & 4 deletionscli/vpndaemon_windows.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletiongo.mod
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletionsgo.sum
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
14 changes: 12 additions & 2 deletionstailnet/conn.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletionsvpn/tunnel.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.