更新 .gitignore 文件以简化敏感数据管理,调整路径以适应项目结构。新增 Entity Framework Core 及相关数据库提供程序的依赖项,增强数据持久化支持。修改 Program.cs 文件以集成平台持久化服务并确保数据库初始化。
This commit is contained in:
@@ -6,6 +6,7 @@ using Microsoft.OpenApi.Models;
|
||||
using MiGu.Server.Auth;
|
||||
using MiGu.Server.Configs;
|
||||
using MiGu.Server.Launcher;
|
||||
using MiGu.Server.Persistence;
|
||||
using Yarp.ReverseProxy.Transforms;
|
||||
|
||||
static string? FindSourceContentRoot(string startDir)
|
||||
@@ -216,6 +217,7 @@ builder.Services.AddSingleton<ConfigStore>();
|
||||
builder.Services.AddSingleton<OpsAuditStore>();
|
||||
// OpsController 真实转发 SimpleLite reflection execute 所需的 HttpClient 工厂。
|
||||
builder.Services.AddHttpClient();
|
||||
builder.Services.AddPlatformPersistence(builder.Configuration);
|
||||
|
||||
// 会话 N+1(启动反转):把 SimpleLite 子进程拉起器接入 DI;AuthController 登录成功后按 LaunchMode 调 MaybeStart。
|
||||
// 配置段绑定 appsettings.json:SimpleLite,可被环境变量 SIMPLELITE__XXX 覆盖。
|
||||
@@ -223,6 +225,7 @@ builder.Services.Configure<SimpleLiteOptions>(builder.Configuration.GetSection("
|
||||
builder.Services.AddSingleton<SimpleLiteLauncher>();
|
||||
|
||||
var app = builder.Build();
|
||||
await app.Services.EnsurePlatformDatabaseAsync();
|
||||
|
||||
// 启动期主动构造 JwtIssuer / InternalTokenStore:让 secret 校验日志在请求来之前打印。
|
||||
_ = app.Services.GetRequiredService<JwtIssuer>();
|
||||
|
||||
Reference in New Issue
Block a user