feat: owner review 2 phase 1: :latest, Unraid array space, Settings with About, whole-folder import (#9)
CI / Build and test (push) Successful in 5m11s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 6s
Release / Build, test and publish (push) Successful in 8m57s
CI / PostgreSQL 16 integration (push) Successful in 3m10s
CI / PostgreSQL 17 integration (push) Successful in 3m30s
CI / Docker image (push) Successful in 49s
Release / Server image (push) Successful in 1m4s
CI / Build and test (push) Successful in 5m11s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 6s
Release / Build, test and publish (push) Successful in 8m57s
CI / PostgreSQL 16 integration (push) Successful in 3m10s
CI / PostgreSQL 17 integration (push) Successful in 3m30s
CI / Docker image (push) Successful in 49s
Release / Server image (push) Successful in 1m4s
- :latest follows the highest stable release, or the highest pre-release while none is stable (Chronos.Tools release-channels); bad tags are refused before anything is built. - Unraid: CHRONOS_SPACE_PATH and the template's Array view show the array's free space; the write volume (cache) is shown apart; completions check the archive volume (507). - Settings is a gear, docked at the foot of the admin sidebar; About is the last part of Settings on the desktop and the panel. - Import > Folder > Whole folder: one sequence per format (desktop only). 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 #9.
This commit is contained in:
1 parent
5acdf146c7
commit
1f089888e8
320 files changed
+3030
-927
No files matched your search
@@ -8,6 +8,7 @@ using Chronos.Data.Processing;
|
||||
using Chronos.Server.Configuration;
|
||||
using Chronos.Server.Jobs;
|
||||
using Chronos.Server.Security;
|
||||
using Chronos.Server.Storage;
|
||||
|
||||
namespace Chronos.Server.Api;
|
||||
|
||||
@@ -25,11 +26,11 @@ public static class DiagnosticsEndpoints
|
||||
api.MapGet("/server/diagnostics", DownloadAsync).Requires(Permissions.ManageArchive);
|
||||
|
||||
private static async Task<IResult> DownloadAsync(HttpContext context, Caller caller, ChronosDatabase db, ServerOptions options, ServerState state,
|
||||
AuditLog audit, TimeProvider time, IServiceProvider services)
|
||||
AuditLog audit, TimeProvider time, VolumeSpace volumes, IServiceProvider services)
|
||||
{
|
||||
var ct = context.RequestAborted;
|
||||
var failures = (await db.Jobs.ListAsync(JobState.Failed, FailedJobs, null, ct)).Items;
|
||||
var report = Report(options, state, time);
|
||||
var report = Report(options, state, time, volumes);
|
||||
var settings = JsonSerializer.Serialize(options, ServerOptionsJson.Default.ServerOptions);
|
||||
var encoders = Encoders(services.GetService<ProcessingService>());
|
||||
|
||||
@@ -64,7 +65,7 @@ public static class DiagnosticsEndpoints
|
||||
return Results.File(file, "application/zip", name);
|
||||
}
|
||||
|
||||
private static string Report(ServerOptions options, ServerState state, TimeProvider time)
|
||||
private static string Report(ServerOptions options, ServerState state, TimeProvider time, VolumeSpace volumes)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"Chronos Server {SystemEndpoints.Version} ({options.ServerName})");
|
||||
@@ -76,8 +77,11 @@ public static class DiagnosticsEndpoints
|
||||
sb.AppendLine("SQLite compile options: " + string.Join(' ', Chronos.Data.Sqlite.SqliteDatabase.CompileOptions));
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"TLS {options.TlsMode} {state.TlsFingerprint}");
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"Jobs one at a time, parallelism {options.Parallelism}, priority queue {(options.PriorityQueue ? "on" : "off")}");
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"Archive {options.ArchivePath} ({Space(options.ArchivePath)})");
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"Data {options.DataPath} ({Space(options.DataPath)})");
|
||||
// The archive's volume is where uploads are written; the space path, when set, is what the admin panel shows.
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"Archive {options.ArchivePath} ({Space(volumes, options.ArchivePath)})");
|
||||
if (!string.IsNullOrWhiteSpace(options.SpacePath))
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"Space {options.SpacePath} ({Space(volumes, options.SpacePath)})");
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"Data {options.DataPath} ({Space(volumes, options.DataPath)})");
|
||||
sb.AppendLine(CultureInfo.InvariantCulture, $"Container {File.Exists("/.dockerenv")}");
|
||||
sb.AppendLine("Set by environment: " + string.Join(", ", options.Locked));
|
||||
return sb.ToString();
|
||||
@@ -98,19 +102,15 @@ public static class DiagnosticsEndpoints
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static string Space(string path)
|
||||
/// <summary>"120 GB free of 500 GB, fuse.shfs mounted at /archive from shfs" (the mount on Linux only; "…, NTFS" elsewhere).</summary>
|
||||
private static string Space(VolumeSpace volumes, string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(path)) return "missing";
|
||||
var full = Path.GetFullPath(path);
|
||||
// Windows wants a drive root; Unix accepts any directory and reports the volume it is mounted on.
|
||||
var drive = new DriveInfo(OperatingSystem.IsWindows() ? Path.GetPathRoot(full)! : full);
|
||||
return string.Create(CultureInfo.InvariantCulture, $"{drive.AvailableFreeSpace / (1L << 30)} GB free of {drive.TotalSize / (1L << 30)} GB");
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or ArgumentException)
|
||||
{
|
||||
return "free space unknown";
|
||||
}
|
||||
if (!Directory.Exists(path)) return "missing";
|
||||
var figures = volumes.Measure(path) is { } v
|
||||
? string.Create(CultureInfo.InvariantCulture, $"{v.FreeBytes / (1L << 30)} GB free of {v.TotalBytes / (1L << 30)} GB")
|
||||
: "free space unknown";
|
||||
var mount = VolumeSpace.MountOf(path);
|
||||
var fileSystem = mount?.FileSystem ?? VolumeSpace.FileSystemOf(path) ?? "file system unknown";
|
||||
return mount is null ? $"{figures}, {fileSystem}" : $"{figures}, {fileSystem} mounted at {mount.MountPoint} from {mount.Source}";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user