diff --git a/App/App.xaml.cs b/App/App.xaml.cs index 40c0f26..a07af43 100644 --- a/App/App.xaml.cs +++ b/App/App.xaml.cs @@ -92,7 +92,6 @@ public App() services.AddSingleton(_ => this); services.AddSingleton(_ => this); - services.AddSingleton, SettingsManager>(); services.AddSingleton(_ => new WindowsCredentialBackend(WindowsCredentialBackend.CoderCredentialsTargetName)); services.AddSingleton(); @@ -121,6 +120,7 @@ public App() // FileSyncListMainPage is created by FileSyncListWindow. services.AddTransient(); + services.AddSingleton, SettingsManager>(); services.AddSingleton(); // SettingsWindow views and view models services.AddTransient(); diff --git a/App/Models/Settings.cs b/App/Models/Settings.cs index f1c89ce..ec4c61b 100644 --- a/App/Models/Settings.cs +++ b/App/Models/Settings.cs @@ -34,11 +34,6 @@ public class CoderConnectSettings : ISettings /// public bool ConnectOnLaunch { get; set; } - /// - /// When this is true Coder Connect will not attempt to protect against Tailscale loopback issues. - /// - public bool EnableCorporateVpnSupport { get; set; } - /// /// CoderConnect current settings version. Increment this when the settings schema changes. /// In future iterations we will be able to handle migrations when the user has @@ -51,21 +46,17 @@ public CoderConnectSettings() Version = VERSION; ConnectOnLaunch = false; - - EnableCorporateVpnSupport = false; } - public CoderConnectSettings(int? version, bool connectOnLaunch, bool enableCorporateVpnSupport) + public CoderConnectSettings(int? version, bool connectOnLaunch) { Version = version ?? VERSION; ConnectOnLaunch = connectOnLaunch; - - EnableCorporateVpnSupport = enableCorporateVpnSupport; } public CoderConnectSettings Clone() { - return new CoderConnectSettings(Version, ConnectOnLaunch, EnableCorporateVpnSupport); + return new CoderConnectSettings(Version, ConnectOnLaunch); } } diff --git a/App/Services/RpcController.cs b/App/Services/RpcController.cs index f7abe79..532c878 100644 --- a/App/Services/RpcController.cs +++ b/App/Services/RpcController.cs @@ -69,7 +69,6 @@ public interface IRpcController : IAsyncDisposable public class RpcController : IRpcController { private readonly ICredentialManager _credentialManager; - private readonly ISettingsManager _settingsManager; private readonly RaiiSemaphoreSlim _operationLock = new(1, 1); private Speaker? _speaker; @@ -77,10 +76,9 @@ public class RpcController : IRpcController private readonly RaiiSemaphoreSlim _stateLock = new(1, 1); private readonly RpcModel _state = new(); - public RpcController(ICredentialManager credentialManager, ISettingsManager settingsManager) + public RpcController(ICredentialManager credentialManager) { _credentialManager = credentialManager; - _settingsManager = settingsManager; } public event EventHandler? StateChanged; @@ -158,7 +156,6 @@ public async Task StartVpn(CancellationToken ct = default) using var _ = await AcquireOperationLockNowAsync(); AssertRpcConnected(); - var coderConnectSettings = await _settingsManager.Read(ct); var credentials = _credentialManager.GetCachedCredentials(); if (credentials.State != CredentialState.Valid) throw new RpcOperationException( @@ -178,7 +175,6 @@ public async Task StartVpn(CancellationToken ct = default) { CoderUrl = credentials.CoderUrl?.ToString(), ApiToken = credentials.ApiToken, - TunnelUseSoftNetIsolation = coderConnectSettings.EnableCorporateVpnSupport, }, }, ct); } diff --git a/App/ViewModels/SettingsViewModel.cs b/App/ViewModels/SettingsViewModel.cs index 58b31f2..721ea95 100644 --- a/App/ViewModels/SettingsViewModel.cs +++ b/App/ViewModels/SettingsViewModel.cs @@ -13,9 +13,6 @@ public partial class SettingsViewModel : ObservableObject [ObservableProperty] public partial bool ConnectOnLaunch { get; set; } - [ObservableProperty] - public partial bool DisableTailscaleLoopProtection { get; set; } - [ObservableProperty] public partial bool StartOnLoginDisabled { get; set; } @@ -34,7 +31,6 @@ public SettingsViewModel(ILogger logger, ISettingsManager logger, ISettingsManager - - - diff --git a/App/Views/SettingsWindow.xaml b/App/Views/SettingsWindow.xaml index a2fe886..512f0f5 100644 --- a/App/Views/SettingsWindow.xaml +++ b/App/Views/SettingsWindow.xaml @@ -9,8 +9,8 @@ xmlns:winuiex="using:WinUIEx" mc:Ignorable="d" Title="Coder Settings" - Width="600" Height="500" - MinWidth="600" MinHeight="500"> + Width="600" Height="350" + MinWidth="600" MinHeight="350"> diff --git a/Vpn.Proto/vpn.proto b/Vpn.Proto/vpn.proto index 61c9978..11a481c 100644 --- a/Vpn.Proto/vpn.proto +++ b/Vpn.Proto/vpn.proto @@ -62,7 +62,7 @@ message ServiceMessage { StartResponse start = 2; StopResponse stop = 3; Status status = 4; // either in reply to a StatusRequest or broadcasted - StartProgress start_progress = 5; // broadcasted during startup (used exclusively by Windows) + StartProgress start_progress = 5; // broadcasted during startup } } @@ -214,7 +214,6 @@ message NetworkSettingsResponse { // StartResponse. message StartRequest { int32 tunnel_file_descriptor = 1; - bool tunnel_use_soft_net_isolation = 8; string coder_url = 2; string api_token = 3; // Additional HTTP headers added to all requests