feat: implement database backup and restore functionality with JSON support
All checks were successful
Publish Container / publish (push) Successful in 3m53s
All checks were successful
Publish Container / publish (push) Successful in 3m53s
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
parent
e872fe200b
commit
e8bbae0496
8 changed files with 657 additions and 0 deletions
|
|
@ -71,6 +71,7 @@ builder.Services.Configure<CouchbaseLiteOptions>(builder.Configuration.GetSectio
|
|||
builder.Services.Configure<SingleUserOptions>(builder.Configuration.GetSection(SingleUserOptions.SectionName));
|
||||
|
||||
builder.Services.AddSingleton<CouchbaseLiteDatabaseProvider>();
|
||||
builder.Services.AddScoped<IDatabaseBackupService, JsonDatabaseBackupService>();
|
||||
builder.Services.AddScoped<IAppSettingsService, CouchbaseLiteAppSettingsService>();
|
||||
builder.Services.AddScoped<AppThemeState>();
|
||||
builder.Services.AddSingleton<IAuthService, CouchbaseLiteAuthService>();
|
||||
|
|
@ -264,6 +265,14 @@ app.MapGet("/api/monthly-timesheet/{year:int}/{month:int}/excel", async (
|
|||
return Results.File(file.Content, file.ContentType, file.FileName);
|
||||
}).RequireAuthorization();
|
||||
|
||||
app.MapGet("/api/database-backup/export", async (
|
||||
IDatabaseBackupService backupService,
|
||||
CancellationToken cancellationToken) =>
|
||||
{
|
||||
var file = await backupService.ExportAsync(cancellationToken);
|
||||
return Results.File(file.Content, file.ContentType, file.FileName);
|
||||
}).RequireAuthorization();
|
||||
|
||||
// Development-only endpoint to reset the seeded Admin password (protected by secret in URL)
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue