From 6fe2b21781c4e60cbee6dd59a17e238fe0ca34a8 Mon Sep 17 00:00:00 2001 From: Jaap-Jan de Wit | DodoTech Date: Mon, 3 Aug 2026 14:27:01 +0200 Subject: [PATCH] Point every build at the hosted server, not just the ones that ship The default was split on DEBUG so a clone would offer localhost and only an installed build would offer ssh.dodotech.cloud. That protected development launches from enrolling a device against production. It also meant the address in the box depended on how the binary was built, which is not what was wanted. Working against a local API now means typing http://localhost:5233 by hand. --- .../ViewModels/MainWindowViewModel.cs | 26 ++++++++----------- .../ShellFlowTests.cs | 13 +++------- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/src/DodoSSH.Client.Shell/ViewModels/MainWindowViewModel.cs b/src/DodoSSH.Client.Shell/ViewModels/MainWindowViewModel.cs index 70a5b6f..efca207 100644 --- a/src/DodoSSH.Client.Shell/ViewModels/MainWindowViewModel.cs +++ b/src/DodoSSH.Client.Shell/ViewModels/MainWindowViewModel.cs @@ -418,25 +418,21 @@ internal sealed partial class MainWindowViewModel : ObservableObject, IAsyncDisp /// /// /// - /// Two defaults, because the two audiences never overlap. A release build is installed by somebody - /// signing in to the hosted deployment, and typing its address is the only thing standing between - /// them and a working application. A debug build is run from a clone, next to - /// dotnet run --project src/DodoSSH.Api, and shipping the hosted address there would point - /// every development launch at production — which is worse than an inconvenience, since sign-in is - /// the step that enrolls a device. - /// - /// - /// Note the schemes. http locally is not an oversight: the API's first launch profile — the - /// one a plain dotnet run and the README both select — is plaintext on 5233, and pointing an - /// HTTPS client at a plaintext port fails as "The SSL connection could not be established", which + /// One default for every build. The hosted deployment is what all but a handful of launches are + /// aiming at, and typing its address is the only thing standing between an installed application and + /// a working one. Running against a clone means replacing this with + /// http://localhost:5233 by hand — note the scheme, because the API's first launch profile — + /// the one a plain dotnet run and the README both select — is plaintext on 5233, and pointing + /// an HTTPS client at a plaintext port fails as "The SSL connection could not be established", which /// sends people looking for a certificate problem. See . /// + /// + /// This was once split on DEBUG so a development launch could not enroll a device against + /// production by accident. That protection is gone: a debug build now offers the hosted address like + /// any other, and the first sign-in accepted unread lands there. + /// /// -#if DEBUG - internal const string DefaultServerUrl = "http://localhost:5233"; -#else internal const string DefaultServerUrl = "https://ssh.dodotech.cloud"; -#endif [ObservableProperty] private string serverUrl = DefaultServerUrl; diff --git a/tests/DodoSSH.Client.App.Tests/ShellFlowTests.cs b/tests/DodoSSH.Client.App.Tests/ShellFlowTests.cs index 750805c..4f012de 100644 --- a/tests/DodoSSH.Client.App.Tests/ShellFlowTests.cs +++ b/tests/DodoSSH.Client.App.Tests/ShellFlowTests.cs @@ -303,20 +303,15 @@ public sealed class ShellFlowTests : IAsyncLifetime /// application is not running. /// /// - /// Both branches are written out rather than compared against the constant itself. Asserting a - /// constant against itself would pass however it were edited, and the whole point of this test is - /// that a release build must not ship a developer's loopback address — or, since the split, that a - /// debug build must not point a clone at production. + /// The address is written out rather than compared against the constant itself. Asserting a constant + /// against itself would pass however it were edited, and the whole point of this test is that no + /// build ships a developer's loopback address. /// /// [Fact] - public void TheDefaultServerUrl_IsTheHostedDeployment_ExceptInADebugBuild() + public void TheDefaultServerUrl_IsTheHostedDeployment_InEveryBuild() { -#if DEBUG - shell.ServerUrl.ShouldBe("http://localhost:5233"); -#else shell.ServerUrl.ShouldBe("https://ssh.dodotech.cloud"); -#endif } [Theory]