From 9559fd521c1955be850e40c8af269b2dbf5e91f1 Mon Sep 17 00:00:00 2001 From: Leendert de Borst Date: Mon, 4 May 2026 11:20:10 +0200 Subject: [PATCH] Add SQLite export option in debug mode (#1046) --- .../Settings/ImportExport/ImportExport.razor | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/apps/server/AliasVault.Client/Main/Pages/Settings/ImportExport/ImportExport.razor b/apps/server/AliasVault.Client/Main/Pages/Settings/ImportExport/ImportExport.razor index 13d01d413..47790e5b8 100644 --- a/apps/server/AliasVault.Client/Main/Pages/Settings/ImportExport/ImportExport.razor +++ b/apps/server/AliasVault.Client/Main/Pages/Settings/ImportExport/ImportExport.razor @@ -90,6 +90,24 @@ + +@* + DEBUG-only raw SQLite export. Stripped from release builds. +*@ +#if DEBUG +
+
+
+

Export raw SQLite

+ DEBUG +
+

+ Downloads the unencrypted SQLite vault file as-is. Anyone with the file can read everything. +

+
+ +
+#endif @@ -295,6 +313,29 @@ } } +#if DEBUG + // DEBUG-only: downloads the in-memory SQLite vault in unencrypted form. + private async Task ExportVaultSqlite() + { + GlobalLoadingSpinner.Show("Exporting SQLite vault..."); + try + { + var base64 = await DbService.ExportSqliteToBase64Async(); + var bytes = Convert.FromBase64String(base64); + await JsInteropService.DownloadFileFromStream(await GetExportFileName("sqlite"), bytes); + } + catch (Exception ex) + { + Logger.LogError(ex, "Error exporting raw SQLite vault"); + GlobalNotificationService.AddErrorMessage(SharedLocalizer["ErrorGeneric"], true); + } + finally + { + GlobalLoadingSpinner.Hide(); + } + } +#endif + private async Task ExportVaultAvux() { GlobalLoadingSpinner.Show(Localizer["ExportingVaultMessage"]);