mirror of
https://github.com/coder/coder.git
synced 2026-06-03 04:58:23 +00:00
adc7775405
This change adds Linux support for Desktop VPN by aligning Linux behavior with the existing Windows daemon implementation and adding a Linux networking stack implementation. ### What changed - Consolidated the daemon command implementation into a shared file: - `cli/vpndaemon_windows_linux.go` (`//go:build windows || linux`) - Consolidated daemon tests into a shared file: - `cli/vpndaemon_windows_linux_test.go` (`//go:build windows || linux`) - Removed Linux-only duplicate daemon files: - `cli/vpndaemon_linux.go` - `cli/vpndaemon_linux_test.go` - Removed unsupported-platform stubs per current supported OS targets: - `cli/vpndaemon_other.go` - `vpn/tun.go` - Kept Linux networking stack implementation in: - `vpn/tun_linux.go` ### Notes - Linux now uses the same `rpc-read-handle` / `rpc-write-handle` flags and env vars as Windows. - The daemon logs to stderr (via CLI logger sinks), and does not forward logs over the RPC pipe.
20 lines
281 B
Go
20 lines
281 B
Go
//go:build linux
|
|
|
|
package cli_test
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
func dupHandle(t *testing.T, f *os.File) uintptr {
|
|
t.Helper()
|
|
|
|
dupFD, err := unix.Dup(int(f.Fd()))
|
|
require.NoError(t, err)
|
|
return uintptr(dupFD)
|
|
}
|