feat: implement JSON backup export functionality with improved download handling
All checks were successful
Publish Container / publish (push) Successful in 3m25s
All checks were successful
Publish Container / publish (push) Successful in 3m25s
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
parent
e8bbae0496
commit
bf333c4a00
7 changed files with 96 additions and 5 deletions
23
Program.cs
23
Program.cs
|
|
@ -1,5 +1,6 @@
|
|||
using System.Globalization;
|
||||
using System.Security.Claims;
|
||||
using NLog;
|
||||
using NLog.Web;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
|
|
@ -31,12 +32,22 @@ if (!runningInContainer)
|
|||
builder.WebHost.UseStaticWebAssets();
|
||||
}
|
||||
|
||||
var configuredStorageOptions = builder.Configuration.GetSection(CouchbaseLiteOptions.SectionName).Get<CouchbaseLiteOptions>() ?? new CouchbaseLiteOptions();
|
||||
var resolvedDatabaseDirectory = ResolveStorageDirectory(configuredStorageOptions.Directory, builder.Environment.ContentRootPath);
|
||||
var resolvedLogDirectory = Path.Combine(resolvedDatabaseDirectory, "logs");
|
||||
GlobalDiagnosticsContext.Set("worktrackerLogPath", Path.Combine(resolvedLogDirectory, "worktracker.log"));
|
||||
GlobalDiagnosticsContext.Set("worktrackerArchiveDirectory", Path.Combine(resolvedLogDirectory, "archive"));
|
||||
|
||||
builder.Logging.ClearProviders();
|
||||
builder.Host.UseNLog();
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddRazorComponents()
|
||||
.AddInteractiveServerComponents();
|
||||
builder.Services.Configure<Microsoft.AspNetCore.Components.Server.CircuitOptions>(options =>
|
||||
{
|
||||
options.DetailedErrors = builder.Configuration.GetValue("DetailedErrors", builder.Environment.IsDevelopment());
|
||||
});
|
||||
|
||||
builder.Services.Configure<AppAuthOptions>(builder.Configuration.GetSection(AppAuthOptions.SectionName));
|
||||
var appAuthOptions = builder.Configuration.GetSection(AppAuthOptions.SectionName).Get<AppAuthOptions>() ?? new AppAuthOptions();
|
||||
|
|
@ -354,3 +365,15 @@ app.MapRazorComponents<App>()
|
|||
.AddInteractiveServerRenderMode();
|
||||
|
||||
app.Run();
|
||||
|
||||
static string ResolveStorageDirectory(string configuredDirectory, string contentRootPath)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(configuredDirectory))
|
||||
{
|
||||
return Path.Combine(contentRootPath, "App_Data", "couchbase");
|
||||
}
|
||||
|
||||
return Path.IsPathRooted(configuredDirectory)
|
||||
? configuredDirectory
|
||||
: Path.GetFullPath(Path.Combine(contentRootPath, configuredDirectory));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue