refactor!: rename Titano to Chronos and move CI and releases to Gitea (#6)
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
CI / Build and test (push) Successful in 8m14s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 7s
Release / Build, test and publish (push) Successful in 13m19s
CI / PostgreSQL 16 integration (push) Successful in 4m49s
CI / PostgreSQL 17 integration (push) Successful in 5m28s
CI / Docker image (push) Successful in 53s
Release / Server image (push) Failing after 10s
The owner renamed the product and moved the repository to the self-hosted Gitea (https://gitea.encke-hake.ts.net/BalboSoft/Chronos) for more control, and asked for Actions and a first automatic release with the server package and the Windows exe (docs/requests/2026-10-23-chronos-gitea.md). - Chronos everywhere: a byte-exact rename of contents and paths, then a per-language review of the forms the old name's ending had dictated. - Gitea instead of GitHub: the update check, licence, issue and support links read ChronosReleasesUrl; the update check takes the highest stable version, offers a pre-release build its final release and reports a repository it cannot see as a failed check. EULA, security policy and Gitea issue forms live at the repository root. - Gitea Actions for the Linux act_runner (.gitea/workflows): CI, release, nightly image and performance gates in the .NET SDK container with git checkout and the system SQLite. The release cross-compiles the Windows programs, checks their icon, version and DPI manifest, packs installers and zips, publishes the Gitea release and pushes the server image (REGISTRY_TOKEN). Windows-only tests run in an opt-in job on a Windows runner (WINDOWS_RUNNER). - New Chronos.Tools commands: zip, gitea-release, postgres-ci (replaces the docker-exec script, which Gitea's service containers do not allow; the throw-away server runs without durability) and pe-check. - Timed tests take their budget from TestTiming (CHRONOS_TEST_TIME_FACTOR, 3 on the shared runner; the weekly performance gates keep theirs). BREAKING CHANGE: programs, settings, data folders, file types, environment variables and the Docker image use the new name; nothing is migrated from Titano, which never had a release. 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 #6.
This commit is contained in:
1 parent
c99842cc86
commit
f2b58522b9
1801 files changed
+11804
-10676
No files matched your search
@@ -0,0 +1,254 @@
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using Chronos.Core.Analysis.Deep;
|
||||
using Chronos.Core.Archiving;
|
||||
using Chronos.Core.Import;
|
||||
using Chronos.Core.IO;
|
||||
using Chronos.Core.Naming;
|
||||
using Chronos.Data.Archiving;
|
||||
using Chronos.Data.Repositories;
|
||||
using Chronos.Ui.Theming;
|
||||
|
||||
namespace Chronos.App.Infrastructure;
|
||||
|
||||
/// <summary>Library presentation (BRIEF §12.2).</summary>
|
||||
public enum LibraryLayout
|
||||
{
|
||||
Grid,
|
||||
List,
|
||||
|
||||
/// <summary>Year bands with photos per month above the card grid.</summary>
|
||||
Timeline,
|
||||
}
|
||||
|
||||
/// <summary>Rendering quality profile (Settings › Rendering).</summary>
|
||||
public enum QualityProfile
|
||||
{
|
||||
Best,
|
||||
Balanced,
|
||||
Fast,
|
||||
}
|
||||
|
||||
/// <summary>Which encoders a render may use (Settings › Rendering).</summary>
|
||||
public enum HardwarePreference
|
||||
{
|
||||
PreferHardware,
|
||||
SoftwareOnly,
|
||||
HardwareForPreviews,
|
||||
}
|
||||
|
||||
/// <summary>A server certificate the user trusted on first use (BRIEF §12.7).</summary>
|
||||
public sealed class TrustedCertificate
|
||||
{
|
||||
public string Fingerprint { get; set; } = string.Empty;
|
||||
public string? Server { get; set; }
|
||||
public DateTimeOffset TrustedAt { get; set; }
|
||||
}
|
||||
|
||||
/// <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
|
||||
/// database opens.
|
||||
/// </summary>
|
||||
public sealed class AppSettings
|
||||
{
|
||||
public const int DefaultThumbnailMemoryItems = 2_000;
|
||||
public const int DefaultCacheLimitGb = 20;
|
||||
public const int DefaultScanIntervalMinutes = 10;
|
||||
|
||||
/// <summary>2⁻⁴ of white: the deep analysis' night threshold (a mean log2 luminance of −4).</summary>
|
||||
public const double DefaultNightBrightnessPercent = 6.25;
|
||||
|
||||
// ---- General ----
|
||||
public string? Language { get; set; }
|
||||
public AppTheme Theme { get; set; } = AppTheme.Dark;
|
||||
public bool RailCollapsed { get; set; }
|
||||
|
||||
/// <summary>The sequence opened in Edit last; the picker selects it first (owner review 1, R7).</summary>
|
||||
public Guid? LastEditedSequence { get; set; }
|
||||
|
||||
/// <summary>The first-run consent of BRIEF §21; offered only by builds with <see cref="ProductFeatures.AdsEnabled"/>.</summary>
|
||||
public bool AnonymousUsageCounts { get; set; }
|
||||
|
||||
/// <summary>Toasts also appear as Windows notifications while the window is minimised or in the background (BRIEF §12.1).</summary>
|
||||
public bool OsNotifications { get; set; } = true;
|
||||
|
||||
public WindowPlacement? Window { get; set; }
|
||||
|
||||
/// <summary>The first-run choice (local archive, adopted folder or server) was made.</summary>
|
||||
public bool FirstRunCompleted { get; set; }
|
||||
|
||||
// ---- Updates ----
|
||||
public bool CheckForUpdates { get; set; } = true;
|
||||
|
||||
// ---- Archive ----
|
||||
/// <summary>Root of the local archive; null until the first-run choice or Settings › Archive sets it.</summary>
|
||||
public string? LastArchivePath { get; set; }
|
||||
|
||||
/// <summary>Naming templates of new archives; Settings › Archive also writes them into the open archive's archive.json.</summary>
|
||||
public string FolderTemplate { get; set; } = TemplateDefaults.Folder;
|
||||
public string FileTemplate { get; set; } = TemplateDefaults.File;
|
||||
|
||||
/// <summary>Proxy long edge of new archives (also written into the open archive); 0 = full size, -1 = no proxies.</summary>
|
||||
public int ProxyLongEdge { get; set; } = 1920;
|
||||
|
||||
/// <summary>Thumbnail long edge of new archives (also written into the open archive), BRIEF §8.5.</summary>
|
||||
public int ThumbnailLongEdge { get; set; } = 320;
|
||||
|
||||
/// <summary>Minutes between the rescans of the open archive (BRIEF §7: polling by mtime and size, no file-system watchers).</summary>
|
||||
public int ScanIntervalMinutes { get; set; } = DefaultScanIntervalMinutes;
|
||||
|
||||
// ---- Import (defaults of new cards and folders; a card's own profile wins) ----
|
||||
public int ImportSessionGapMinutes { get; set; } = 45;
|
||||
public int ImportMinimumFrames { get; set; } = 8;
|
||||
public bool ImportSubfolders { get; set; } = true;
|
||||
public bool ImportVerify { get; set; } = true;
|
||||
public DuplicatePolicy ImportDuplicates { get; set; } = DuplicatePolicy.Skip;
|
||||
public AfterImport ImportAfter { get; set; } = AfterImport.Keep;
|
||||
public bool ImportEject { get; set; } = true;
|
||||
|
||||
// ---- Analysis ----
|
||||
/// <summary>Upper bound of the deep-analysis long edge (BRIEF §10.2: half native, capped at 2048 by default).</summary>
|
||||
public int AnalysisLongEdge { get; set; } = 2048;
|
||||
|
||||
/// <summary>Frames whose mean brightness is at or below this share of white (in percent) count as night frames.</summary>
|
||||
public double NightBrightnessPercent { get; set; } = DefaultNightBrightnessPercent;
|
||||
|
||||
/// <summary>Stars per megapixel from which a night frame shows a star field.</summary>
|
||||
public double StarFieldDensity { get; set; } = 30;
|
||||
|
||||
/// <summary>The default of a new card's "Deep analysis" after import (BRIEF §13: on, in the background).</summary>
|
||||
public bool DeepAnalysisAfterImport { get; set; } = true;
|
||||
|
||||
/// <summary>Sequences a scan of this PC indexes (adopted folders, new sidecars) also get a background deep analysis.</summary>
|
||||
public bool DeepAnalysisAfterScan { get; set; }
|
||||
|
||||
// ---- Library ----
|
||||
public LibraryLayout LibraryLayout { get; set; } = LibraryLayout.Grid;
|
||||
public SequenceSort LibrarySort { get; set; } = SequenceSort.Newest;
|
||||
|
||||
// ---- Rendering ----
|
||||
public QualityProfile Quality { get; set; } = QualityProfile.Balanced;
|
||||
|
||||
/// <summary>Frame memory budget in GB; null = Auto (a quarter of installed memory).</summary>
|
||||
public int? MemoryBudgetGb { get; set; }
|
||||
|
||||
/// <summary>Photos the running job processes at once (owner review 1: jobs run one at a time); null = Auto (half the logical cores, at least one).</summary>
|
||||
public int? Parallelism { get; set; }
|
||||
|
||||
public bool BackgroundPriority { get; set; } = true;
|
||||
public HardwarePreference HardwareEncoding { get; set; } = HardwarePreference.PreferHardware;
|
||||
|
||||
// ---- Storage ----
|
||||
/// <summary>Cache (spill frames, thumbnails); null = <c>cache</c> under the data folder.</summary>
|
||||
public string? CacheFolder { get; set; }
|
||||
|
||||
/// <summary>Decoded thumbnails kept in memory.</summary>
|
||||
public int ThumbnailMemoryItems { get; set; } = DefaultThumbnailMemoryItems;
|
||||
|
||||
/// <summary>Upper bound of the disk cache in GB.</summary>
|
||||
public int CacheLimitGb { get; set; } = DefaultCacheLimitGb;
|
||||
|
||||
// ---- Server ----
|
||||
public string? ServerUrl { get; set; }
|
||||
public string? ServerUsername { get; set; }
|
||||
|
||||
/// <summary>The session token, encrypted for this Windows user with DPAPI (Base64).</summary>
|
||||
public string? ProtectedToken { get; set; }
|
||||
|
||||
public List<TrustedCertificate> TrustedCertificates { get; set; } = [];
|
||||
public List<string> RecentServers { get; set; } = [];
|
||||
|
||||
/// <summary>Let the server send render jobs to this PC (BRIEF §14.7).</summary>
|
||||
public bool RenderNodeOptIn { get; set; }
|
||||
|
||||
/// <summary>Keep the proxy caches of the server sequences this PC opened with proxies up to date (BRIEF §12.7).</summary>
|
||||
public bool KeepProxiesOffline { get; set; }
|
||||
|
||||
/// <summary>Send and take project settings changed on one side without asking (Server.html).</summary>
|
||||
public bool SyncSettingsAutomatically { get; set; } = true;
|
||||
|
||||
/// <summary>Pause upload jobs while Windows reports the connection as metered (Server.html).</summary>
|
||||
public bool PauseUploadsOnMetered { get; set; }
|
||||
|
||||
// ---- Jobs ----
|
||||
/// <summary>
|
||||
/// The priority queue (owner review 1): a job of a higher level makes the running one of a lower level yield, and that
|
||||
/// one resumes by itself afterwards. Off: jobs wait their turn.
|
||||
/// </summary>
|
||||
public bool PriorityQueue { get; set; }
|
||||
|
||||
/// <summary>Levels of the priority queue that differ from the defaults, by job kind (<c>render</c> → <c>high</c>).</summary>
|
||||
public Dictionary<string, string> JobPriorities { get; set; } = [];
|
||||
|
||||
/// <summary>"Clear done": finished jobs older than this are hidden from the Jobs list (they stay in the history).</summary>
|
||||
public DateTimeOffset? JobsClearedAt { get; set; }
|
||||
|
||||
public sealed class WindowPlacement
|
||||
{
|
||||
public double Left { get; set; }
|
||||
public double Top { get; set; }
|
||||
public double Width { get; set; }
|
||||
public double Height { get; set; }
|
||||
public bool Maximized { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>Settings › Archive as the settings of a new archive (its name: the folder's).</summary>
|
||||
public ArchiveSettings ArchiveDefaults() => new(string.Empty, new LayoutTemplates { Folder = FolderTemplate, File = FileTemplate },
|
||||
new ProxyPolicy { LongEdge = ProxyLongEdge }, new ThumbnailPolicy { LongEdge = ThumbnailLongEdge });
|
||||
|
||||
/// <summary>Settings › Import and Analysis as the profile of a card or folder without its own (BRIEF §12.4), with the archive's templates.</summary>
|
||||
public CardProfile ImportProfile(string folderTemplate, string fileTemplate) => new()
|
||||
{
|
||||
FolderTemplate = folderTemplate,
|
||||
FileTemplate = fileTemplate,
|
||||
SessionGapMinutes = ImportSessionGapMinutes,
|
||||
MinimumSessionFrames = ImportMinimumFrames,
|
||||
IncludeSubfolders = ImportSubfolders,
|
||||
VerifyCopies = ImportVerify,
|
||||
Duplicates = ImportDuplicates,
|
||||
AfterImport = ImportAfter,
|
||||
Eject = ImportEject,
|
||||
DeepAnalysis = DeepAnalysisAfterImport,
|
||||
};
|
||||
|
||||
/// <summary>Settings › Analysis over <paramref name="basis"/>: the width cap and the night and star-field thresholds.</summary>
|
||||
public DeepAnalysisOptions DeepAnalysis(DeepAnalysisOptions basis) => basis with
|
||||
{
|
||||
MaxAnalysisLongEdge = int.Max(basis.MinAnalysisLongEdge, AnalysisLongEdge),
|
||||
DarkLogLuminance = System.Math.Log2(double.Clamp(NightBrightnessPercent, 0.01, 100) / 100),
|
||||
StarFieldDensity = double.Max(0, StarFieldDensity),
|
||||
};
|
||||
|
||||
public static AppSettings Load(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(path)) return Parse(File.ReadAllText(path)) ?? new AppSettings();
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
// A corrupt settings file must never block startup; defaults apply.
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
}
|
||||
return new AppSettings();
|
||||
}
|
||||
|
||||
/// <summary>Reads settings JSON (Settings › Import); null when the text is not a settings object.</summary>
|
||||
/// <exception cref="JsonException">The text is not valid JSON.</exception>
|
||||
public static AppSettings? Parse(string json) => JsonSerializer.Deserialize(json, AppSettingsJson.Default.AppSettings);
|
||||
|
||||
public string ToJson() => JsonSerializer.Serialize(this, AppSettingsJson.Default.AppSettings);
|
||||
|
||||
public void Save(string path) => AtomicFile.WriteAllText(path, ToJson());
|
||||
|
||||
/// <summary>A deep copy (JSON round trip), used for import and reset.</summary>
|
||||
public AppSettings Clone() => Parse(ToJson()) ?? new AppSettings();
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true, UseStringEnumConverter = true)]
|
||||
[JsonSerializable(typeof(AppSettings))]
|
||||
internal sealed partial class AppSettingsJson : JsonSerializerContext;
|
||||
Reference in new issue
Block a user