fix: owner review 3 phase 1: server ports for clients, screenshot baselines (#16)
CI / Build and test (push) Successful in 9m36s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 9s
Release / Build, test and publish (push) Successful in 14m4s
CI / PostgreSQL 16 integration (push) Successful in 8m26s
CI / PostgreSQL 17 integration (push) Successful in 8m43s
CI / Docker image (push) Successful in 50s
Release / Server image (push) Successful in 1m23s
CI / Build and test (push) Successful in 9m36s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 9s
Release / Build, test and publish (push) Successful in 14m4s
CI / PostgreSQL 16 integration (push) Successful in 8m26s
CI / PostgreSQL 17 integration (push) Successful in 8m43s
CI / Docker image (push) Successful in 50s
Release / Server image (push) Successful in 1m23s
Clients could not reach a server in a container whose ports are published as other host ports: the panel showed the container's ports, the template had no public HTTP port, and a bare host meant port 443. Public ports become panel settings, the panel shows the client address, both clients default to 8443, and an address that answers as another service is named as not a Chronos server (its certificate never offered for trust). The screenshot baselines are captured on the development PC and committed; measured values are fixed while the capture runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #16.
This commit is contained in:
1 parent
30a5b03f37
commit
255e149087
306 files changed
+2023
-206
No files matched your search
@@ -80,6 +80,7 @@ public sealed class ConnectFlowTests
|
||||
[Case("ftp://nas.local", ConnectError.InvalidAddress)]
|
||||
[Case("down.local", ConnectError.Unreachable)]
|
||||
[Case("web.local", ConnectError.NotChronos)]
|
||||
[Case("other.local", ConnectError.NotChronos)]
|
||||
public async Task ProbeFailuresAreClassified(string address, ConnectError error)
|
||||
{
|
||||
using var flow = new ConnectFlow(new FakeServer(), new MemoryTrust());
|
||||
@@ -141,9 +142,32 @@ public sealed class ConnectFlowTests
|
||||
Assert.Equal(1, changes);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public async Task AnotherServiceOnThePortIsNamedWithTheAddressAsked()
|
||||
{
|
||||
// Owner review 3: "192.168.30.23" goes to port 8443, where the owner's NAS runs another service.
|
||||
var server = new FakeServer { SelfSigned = true };
|
||||
var trust = new MemoryTrust();
|
||||
using var flow = new ConnectFlow(server, trust);
|
||||
Assert.Equal(ConnectStep.Failed, await flow.ProbeAsync("other.local"));
|
||||
Assert.Equal(ConnectError.NotChronos, flow.Error);
|
||||
Assert.Null(flow.PendingFingerprint);
|
||||
Assert.Empty(trust.Fingerprints);
|
||||
Assert.Equal(Chronos.Core.Localization.Loc.L("Server.Error.NotChronosAt", Chronos.App.Infrastructure.Formatting.LeftToRight("https://other.local:8443")),
|
||||
ServerSession.ErrorText(flow.Error, flow.Address));
|
||||
Assert.Contains("https://other.local:8443", ServerSession.ErrorText(flow.Error, flow.Address));
|
||||
// Without the address, and for other errors, the sentence stays as it was.
|
||||
Assert.Equal(Chronos.Core.Localization.Loc.L("Server.Error.NotChronos"), ServerSession.ErrorText(ConnectError.NotChronos));
|
||||
Assert.Equal(Chronos.Core.Localization.Loc.L("Server.Error.Unreachable"), ServerSession.ErrorText(ConnectError.Unreachable, flow.Address));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AddressesAreNormalised()
|
||||
{
|
||||
Assert.True(ServerAddress.TryParse("nas.local", out var bare));
|
||||
Assert.Equal("https://nas.local:8443/", bare.ToString());
|
||||
Assert.True(ServerAddress.TryParse("https://chronos.example.com", out var proxied));
|
||||
Assert.Equal("https://chronos.example.com/", proxied.ToString());
|
||||
Assert.True(ServerAddress.TryParse("nas.local:8443", out var a));
|
||||
Assert.Equal("https://nas.local:8443/", a.ToString());
|
||||
Assert.True(ServerAddress.TryParse(" http://10.0.0.5:8080/chronos?x=1 ", out var b));
|
||||
@@ -228,6 +252,8 @@ public sealed class ConnectFlowTests
|
||||
{
|
||||
if (BaseAddress.Host == "down.local") throw new HttpRequestException("No such host");
|
||||
if (BaseAddress.Host == "web.local") throw new ChronosApiException(HttpStatusCode.NotFound, new ApiError("http_404", "Not Found"));
|
||||
// What ChronosClient reports for another service on the port: its page, its sign-in redirect, its certificate.
|
||||
if (BaseAddress.Host == "other.local") throw new NotChronosServerException(BaseAddress);
|
||||
if (server.SelfSigned && !trusted.Contains(Fingerprint)) throw new UntrustedCertificateException(Fingerprint);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user