feat: single setup, mass-pass progress, per-server homes, Desktop shares its library (owner review 5, v1.1.0) (#68)
CI / Build and test (push) Successful in 11m36s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 12s
Release / Build, test and publish (push) Successful in 14m56s
CI / PostgreSQL 16 integration (push) Successful in 10m11s
CI / PostgreSQL 17 integration (push) Successful in 10m15s
CI / Docker image (push) Successful in 45s
Release / Server image (push) Successful in 4m55s
CI / Build and test (push) Successful in 11m36s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 12s
Release / Build, test and publish (push) Successful in 14m56s
CI / PostgreSQL 16 integration (push) Successful in 10m11s
CI / PostgreSQL 17 integration (push) Successful in 10m15s
CI / Docker image (push) Successful in 45s
Release / Server image (push) Successful in 4m55s
Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
This commit was merged in pull request #68.
This commit is contained in:
1 parent
988068ee8e
commit
20d64af4a4
793 files changed
+23882
-2096
No files matched your search
@@ -10,6 +10,7 @@ using Chronos.Core.Naming;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Data.Archiving;
|
||||
using Chronos.Data.Repositories;
|
||||
using Chronos.Data.Sync;
|
||||
using Chronos.Ui.Theming;
|
||||
|
||||
namespace Chronos.App.Infrastructure;
|
||||
@@ -66,6 +67,61 @@ public sealed class TrustedCertificate
|
||||
public DateTimeOffset TrustedAt { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A server this PC signed in to that announced its stable id (owner review 5, #66): its name and last address, the TLS
|
||||
/// fingerprint it presented, the address keys it was reached under before (or besides) its id
|
||||
/// (<see cref="Chronos.Data.Sync.SyncService.ServerKey"/>: projects, links and jobs made then still name them), the archive its
|
||||
/// downloaded originals go to, and when it was last seen. Its folders (<c>servers\<id></c> in the workspace and the
|
||||
/// cache) are named by the id, never by the name.
|
||||
/// </summary>
|
||||
public sealed class KnownServer
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public string? LastAddress { get; set; }
|
||||
public string? Fingerprint { get; set; }
|
||||
public List<string> Aliases { get; set; } = [];
|
||||
|
||||
/// <summary>The archive of this PC that holds the server's downloaded originals (owner review 5, Q1); null until the first download.</summary>
|
||||
public Guid? OriginalsArchiveId { get; set; }
|
||||
|
||||
public DateTimeOffset LastSeen { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Settings › Server › Sharing (owner review 5, #67): this PC's library served to the LAN by the server Chronos hosts
|
||||
/// while it runs. Absent in a 1.0 settings file: off, on Docker's ports.
|
||||
/// </summary>
|
||||
public sealed class ShareSettings
|
||||
{
|
||||
public const int DefaultHttpsPort = 8443;
|
||||
public const int DefaultHttpPort = 8080;
|
||||
|
||||
public bool Enabled { get; set; }
|
||||
|
||||
/// <summary>The name clients see; empty: this PC's name.</summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
public int HttpsPort { get; set; } = DefaultHttpsPort;
|
||||
public int HttpPort { get; set; } = DefaultHttpPort;
|
||||
|
||||
/// <summary>The ports clients reach when a router forwards others to this PC; null: the ones above.</summary>
|
||||
public int? PublicHttpsPort { get; set; }
|
||||
|
||||
public int? PublicHttpPort { get; set; }
|
||||
|
||||
/// <summary>Announce the library to Chronos programs on the local network.</summary>
|
||||
public bool Discovery { get; set; } = true;
|
||||
|
||||
/// <summary>What restarts a running share when it changes (the name, the ports, the discovery); the rest applies live.</summary>
|
||||
public bool SameEndpoint(ShareSettings other)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(other);
|
||||
return string.Equals(Name?.Trim() ?? string.Empty, other.Name?.Trim() ?? string.Empty, StringComparison.Ordinal) && HttpsPort == other.HttpsPort &&
|
||||
HttpPort == other.HttpPort && PublicHttpsPort == other.PublicHttpsPort && PublicHttpPort == other.PublicHttpPort && Discovery == other.Discovery;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Per-user preferences (language, theme, window layout, archive defaults, server session). Kept in
|
||||
/// <c>settings.json</c> next to the database and written atomically, because language and theme apply before the
|
||||
@@ -257,6 +313,22 @@ public sealed class AppSettings
|
||||
public List<TrustedCertificate> TrustedCertificates { get; set; } = [];
|
||||
public List<string> RecentServers { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// The servers known by their stable id and the address keys each was reached under (owner review 5, #66): a server's
|
||||
/// projects, links and jobs stay its own whatever address it is reached by. This PC's state: Reset and Import keep it,
|
||||
/// Export leaves it out.
|
||||
/// </summary>
|
||||
public List<KnownServer> KnownServers { get; set; } = [];
|
||||
|
||||
/// <summary>The alias table of <see cref="KnownServers"/>, as the sync and the workspace compare server keys through it.</summary>
|
||||
public ServerIdentity KnownIdentity() => new([.. KnownServers.Where(k => k.Id != Guid.Empty).Select(k => new KnownServerKey(k.Id, [.. k.Aliases]))]);
|
||||
|
||||
/// <summary>The known server of <paramref name="id"/>; null when this PC has none.</summary>
|
||||
public KnownServer? FindKnownServer(Guid id) => KnownServers.FirstOrDefault(k => k.Id == id);
|
||||
|
||||
/// <summary>Settings › Server › Sharing: this PC's library shared to the LAN while Chronos runs (owner review 5, #67).</summary>
|
||||
public ShareSettings Share { get; set; } = new();
|
||||
|
||||
/// <summary>Let the server send render jobs to this PC (BRIEF §14.7).</summary>
|
||||
public bool RenderNodeOptIn { get; set; }
|
||||
|
||||
@@ -377,6 +449,7 @@ public sealed class AppSettings
|
||||
ProtectedToken = ProtectedToken,
|
||||
TrustedCertificates = TrustedCertificates,
|
||||
RecentServers = RecentServers,
|
||||
KnownServers = KnownServers,
|
||||
Window = Window,
|
||||
RailCollapsed = RailCollapsed,
|
||||
EditorGroups = EditorGroups,
|
||||
@@ -400,6 +473,7 @@ public sealed class AppSettings
|
||||
copy.WorkspaceFolder = null;
|
||||
copy.WorkspaceRecent = [];
|
||||
copy.WorkspaceOpened = [];
|
||||
copy.KnownServers = [];
|
||||
return copy;
|
||||
}
|
||||
|
||||
@@ -423,6 +497,7 @@ public sealed class AppSettings
|
||||
imported.WorkspaceFolder = WorkspaceFolder;
|
||||
imported.WorkspaceRecent = WorkspaceRecent;
|
||||
imported.WorkspaceOpened = WorkspaceOpened;
|
||||
imported.KnownServers = KnownServers;
|
||||
return imported;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user