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,234 @@
|
||||
using System.Collections.Specialized;
|
||||
using System.Windows.Input;
|
||||
using Chronos.App.Infrastructure;
|
||||
using Chronos.App.Server;
|
||||
using Chronos.App.Settings;
|
||||
using Chronos.App.Shell;
|
||||
using Chronos.Core.Diagnostics;
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Ui.Mvvm;
|
||||
|
||||
namespace Chronos.App.Sections;
|
||||
|
||||
/// <summary>Where the time-lapses live (first run).</summary>
|
||||
public enum WelcomeChoice
|
||||
{
|
||||
LocalArchive,
|
||||
AdoptFolder,
|
||||
Server,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// First run (BRIEF §12.1, Welcome.html): create a local archive, adopt an existing folder or connect to a server,
|
||||
/// plus the language and the anonymous-usage consent. Shown once; the archive actions go through
|
||||
/// <see cref="IArchiveSetup"/>.
|
||||
/// </summary>
|
||||
public sealed class WelcomeViewModel : LocalizedViewModel
|
||||
{
|
||||
private readonly ShellViewModel _shell;
|
||||
private WelcomeChoice _choice = WelcomeChoice.LocalArchive;
|
||||
private string _localRoot;
|
||||
private string? _adoptFolder;
|
||||
private bool _isBusy;
|
||||
|
||||
public WelcomeViewModel(ShellViewModel shell)
|
||||
{
|
||||
_shell = shell;
|
||||
_localRoot = shell.Services.Settings.LastArchivePath ?? ArchiveLocations.SuggestRoot();
|
||||
ChooseCommand = new RelayCommand(p =>
|
||||
{
|
||||
if (p is WelcomeChoice choice) Choice = choice;
|
||||
else if (p is string name && Enum.TryParse<WelcomeChoice>(name, out var parsed)) Choice = parsed;
|
||||
});
|
||||
ChangeRootCommand = new RelayCommand(ChangeRoot);
|
||||
ChooseAdoptCommand = new RelayCommand(() => PickAdoptFolder());
|
||||
ContinueCommand = new AsyncRelayCommand(ContinueAsync, () => !_isBusy);
|
||||
shell.Services.Server.Discovered.CollectionChanged += OnDiscovered;
|
||||
if (!shell.Services.Environment.IsCapture) shell.Services.Server.StartDiscovery();
|
||||
}
|
||||
|
||||
public ICommand ChooseCommand { get; }
|
||||
public ICommand ChangeRootCommand { get; }
|
||||
public ICommand ChooseAdoptCommand { get; }
|
||||
public ICommand ContinueCommand { get; }
|
||||
|
||||
public WelcomeChoice Choice
|
||||
{
|
||||
get => _choice;
|
||||
set
|
||||
{
|
||||
if (!Set(ref _choice, value)) return;
|
||||
OnPropertyChanged(nameof(IsLocal));
|
||||
OnPropertyChanged(nameof(IsAdopt));
|
||||
OnPropertyChanged(nameof(IsServer));
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsLocal
|
||||
{
|
||||
get => _choice == WelcomeChoice.LocalArchive;
|
||||
set
|
||||
{
|
||||
if (value) Choice = WelcomeChoice.LocalArchive;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsAdopt
|
||||
{
|
||||
get => _choice == WelcomeChoice.AdoptFolder;
|
||||
set
|
||||
{
|
||||
if (value) Choice = WelcomeChoice.AdoptFolder;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsServer
|
||||
{
|
||||
get => _choice == WelcomeChoice.Server;
|
||||
set
|
||||
{
|
||||
if (value) Choice = WelcomeChoice.Server;
|
||||
}
|
||||
}
|
||||
|
||||
public string LocalRoot
|
||||
{
|
||||
get => _localRoot;
|
||||
private set
|
||||
{
|
||||
if (Set(ref _localRoot, value)) OnPropertyChanged(nameof(LocalDetail));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>"D:\ChronosArchive · 1.8 TB free" (the path left to right in every language).</summary>
|
||||
public string LocalDetail => ArchiveLocations.FreeSpace(_localRoot) is { } free
|
||||
? Loc.L("Shell.Welcome.Local.Detail", Formatting.LeftToRight(_localRoot), Formatting.Bytes(free))
|
||||
: Formatting.LeftToRight(_localRoot);
|
||||
|
||||
/// <summary>The chosen folder to adopt; null until picked.</summary>
|
||||
public string? AdoptDetail => _adoptFolder is { } folder ? Formatting.LeftToRight(folder) : null;
|
||||
|
||||
public bool HasAdoptDetail => _adoptFolder is not null;
|
||||
|
||||
/// <summary>The first server announced on the LAN (or the saved one).</summary>
|
||||
public DiscoveredServer? FoundServer =>
|
||||
_shell.Services.Server.Discovered.FirstOrDefault()
|
||||
?? (_shell.Services.Settings.ServerUrl is { } saved ? new DiscoveredServer(saved, saved) : null);
|
||||
|
||||
/// <summary>"Studio NAS on this network · https://nas.local:8443".</summary>
|
||||
public string? ServerDetail => FoundServer is { } s
|
||||
? s.Name == s.Address ? Formatting.LeftToRight(s.Address) : Loc.L("Shell.Welcome.Server.Found", s.Name, Formatting.LeftToRight(s.Address))
|
||||
: null;
|
||||
|
||||
public bool HasServerDetail => ServerDetail is not null;
|
||||
|
||||
/// <summary>A server was heard on the LAN (the green dot).</summary>
|
||||
public bool IsServerDiscovered => _shell.Services.Server.Discovered.Count > 0;
|
||||
|
||||
public IReadOnlyList<LanguageOption> Languages => LanguageCatalog.Available;
|
||||
|
||||
public LanguageOption SelectedLanguage
|
||||
{
|
||||
get => LanguageCatalog.Match(Loc.Culture);
|
||||
set
|
||||
{
|
||||
if (value is null || value == SelectedLanguage) return;
|
||||
_shell.Services.Settings.Language = value.Code;
|
||||
UiLanguage.Apply(value.Code);
|
||||
_shell.Services.SaveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>The usage counts consent belongs to monetization (BRIEF §21): only builds with it enabled offer it.</summary>
|
||||
public bool ShowsUsageCounts => ProductFeatures.AdsEnabled;
|
||||
|
||||
public bool UsageCounts
|
||||
{
|
||||
get => _shell.Services.Settings.AnonymousUsageCounts;
|
||||
set
|
||||
{
|
||||
_shell.Services.Settings.AnonymousUsageCounts = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsBusy
|
||||
{
|
||||
get => _isBusy;
|
||||
private set => Set(ref _isBusy, value);
|
||||
}
|
||||
|
||||
/// <summary>Sample state for screenshots: a server heard on the LAN.</summary>
|
||||
internal void ShowDiscovered(DiscoveredServer server)
|
||||
{
|
||||
if (!_shell.Services.Server.Discovered.Contains(server)) _shell.Services.Server.Discovered.Add(server);
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
_shell.Services.Server.Discovered.CollectionChanged -= OnDiscovered;
|
||||
base.Dispose();
|
||||
}
|
||||
|
||||
private void OnDiscovered(object? sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged(nameof(FoundServer));
|
||||
OnPropertyChanged(nameof(ServerDetail));
|
||||
OnPropertyChanged(nameof(HasServerDetail));
|
||||
OnPropertyChanged(nameof(IsServerDiscovered));
|
||||
}
|
||||
|
||||
private void ChangeRoot()
|
||||
{
|
||||
var folder = _shell.Services.Dialogs.PickFolder(Loc.L("Shell.Welcome.Local.PickTitle"), LocalRoot);
|
||||
if (folder is null) return;
|
||||
LocalRoot = folder;
|
||||
Choice = WelcomeChoice.LocalArchive;
|
||||
}
|
||||
|
||||
private bool PickAdoptFolder()
|
||||
{
|
||||
var folder = _shell.Services.Dialogs.PickFolder(Loc.L("Library.Adopt.Title"));
|
||||
if (folder is null) return false;
|
||||
_adoptFolder = folder;
|
||||
OnPropertyChanged(nameof(AdoptDetail));
|
||||
OnPropertyChanged(nameof(HasAdoptDetail));
|
||||
Choice = WelcomeChoice.AdoptFolder;
|
||||
return true;
|
||||
}
|
||||
|
||||
private async Task ContinueAsync()
|
||||
{
|
||||
IsBusy = true;
|
||||
try
|
||||
{
|
||||
switch (_choice)
|
||||
{
|
||||
case WelcomeChoice.LocalArchive:
|
||||
if (ArchiveLocations.Validate(LocalRoot) is { } problem)
|
||||
{
|
||||
_shell.Notify(problem, isError: true);
|
||||
return;
|
||||
}
|
||||
if (!await ArchiveActions.TryAsync(_shell, s => s.CreateAsync(LocalRoot))) return;
|
||||
break;
|
||||
case WelcomeChoice.AdoptFolder:
|
||||
if (_adoptFolder is null && !PickAdoptFolder()) return;
|
||||
if (!await ArchiveActions.TryAsync(_shell, s => s.AdoptAsync(_adoptFolder!))) return;
|
||||
break;
|
||||
case WelcomeChoice.Server:
|
||||
if (FoundServer is { } server) _shell.Server.Address = server.Address;
|
||||
break;
|
||||
}
|
||||
_shell.Services.SaveSettings();
|
||||
_shell.CompleteWelcome();
|
||||
Log.Info("app", $"First run completed: {_choice}");
|
||||
if (_choice == WelcomeChoice.Server) _shell.Navigate(SectionKey.Server);
|
||||
else await _shell.Library.RefreshAsync();
|
||||
}
|
||||
finally
|
||||
{
|
||||
IsBusy = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user