feat(diagnostics): scrubbed diagnostics bundles on the desktop and the server
SecretScrubber removes passwords, tokens, keys, cookies, authorisation headers, URL credentials and private-key blocks from text and JSON; DiagnosticsArchive zips reports, settings, failed jobs and log tails through it. The desktop bundle (Settings > Advanced, About) now adds the codec and encoder inventory, the settings and recent failed jobs; the server serves the same as GET /api/v1/server/diagnostics (ManageArchive, audited), linked from admin > Logs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
16 files changed
+757
-40
No files matched your search
@@ -195,8 +195,15 @@ public sealed class AboutViewModel : SectionViewModel
|
||||
{
|
||||
var folder = Shell.Services.Dialogs.PickFolder(Loc.L("Settings.Advanced.DiagnosticsTitle"));
|
||||
if (folder is null) return;
|
||||
var path = await DiagnosticsBundle.CreateAsync(Shell.Services.Environment, folder);
|
||||
Shell.Notify(Loc.L("Settings.Advanced.DiagnosticsDone"), Path.GetFileName(path), Loc.L("Library.Export.Show"), Loc.L("Tooltips.Library.ShowExport"), () => ShellActions.Reveal(path));
|
||||
try
|
||||
{
|
||||
var path = await DiagnosticsBundle.CreateAsync(Shell.Services, folder);
|
||||
Shell.Notify(Loc.L("Settings.Advanced.DiagnosticsDone"), Path.GetFileName(path), Loc.L("Library.Export.Show"), Loc.L("Tooltips.Library.ShowExport"), () => ShellActions.Reveal(path));
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or Titano.Data.DatabaseException)
|
||||
{
|
||||
Shell.ReportError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void RaiseUpdate()
|
||||
|
||||
@@ -647,9 +647,16 @@ public sealed class SettingsViewModel : SectionViewModel
|
||||
{
|
||||
var folder = Shell.Services.Dialogs.PickFolder(Loc.L("Settings.Advanced.DiagnosticsTitle"));
|
||||
if (folder is null) return;
|
||||
var extra = Encoders.Select(e => $"Encoder {e.Codec} {e.Row.DisplayName} hardware={e.Row.Hardware} selftest={e.ResultText}");
|
||||
var path = await DiagnosticsBundle.CreateAsync(Shell.Services.Environment, folder, extra.ToList());
|
||||
Shell.Notify(Loc.L("Settings.Advanced.DiagnosticsDone"), Path.GetFileName(path), Loc.L("Library.Export.Show"), Loc.L("Tooltips.Library.ShowExport"), () => ShellActions.Reveal(path));
|
||||
var selfTests = Encoders.Where(e => e.HasResult).Select(e => $"Self-test {e.Codec} {e.Row.DisplayName}: {e.ResultText}").ToList();
|
||||
try
|
||||
{
|
||||
var path = await DiagnosticsBundle.CreateAsync(Shell.Services, folder, selfTests);
|
||||
Shell.Notify(Loc.L("Settings.Advanced.DiagnosticsDone"), Path.GetFileName(path), Loc.L("Library.Export.Show"), Loc.L("Tooltips.Library.ShowExport"), () => ShellActions.Reveal(path));
|
||||
}
|
||||
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or DatabaseException)
|
||||
{
|
||||
Shell.ReportError(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private async Task BackupDatabaseAsync()
|
||||
|
||||
Reference in new issue
Block a user