feat: ship agent-first mission control v0.2.57
This commit is contained in:
@@ -35,6 +35,7 @@ public static class ApplicationBuilderExtensions
|
||||
return;
|
||||
|
||||
var ownerEmail = configuration["Bootstrap:OwnerEmail"]?.Trim().ToLowerInvariant();
|
||||
var ownerPassword = configuration["Bootstrap:OwnerPassword"];
|
||||
var hasUsers = await db.Users.AnyAsync();
|
||||
|
||||
// ── Double-check SeedAudit after the migration — if another pod wrote it
|
||||
@@ -55,20 +56,20 @@ public static class ApplicationBuilderExtensions
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(ownerEmail))
|
||||
throw new InvalidOperationException("Bootstrap:OwnerEmail is required for initial setup.");
|
||||
if (string.IsNullOrWhiteSpace(ownerPassword) || ownerPassword.Length < 10)
|
||||
throw new InvalidOperationException(
|
||||
"Bootstrap:OwnerPassword is required for initial setup and must contain at least 10 characters.");
|
||||
|
||||
var initialDisplayName = PasswordHelper.BuildOwnerDisplayName(ownerEmail);
|
||||
var initialPassword = PasswordHelper.GenerateTemporaryPassword();
|
||||
|
||||
db.Users.Add(new NexusUser
|
||||
{
|
||||
Email = ownerEmail,
|
||||
NormalizedEmail = AuthService.NormalizeEmail(ownerEmail),
|
||||
DisplayName = initialDisplayName,
|
||||
PasswordHash = PasswordSecurity.Hash(initialPassword),
|
||||
PasswordHash = PasswordSecurity.Hash(ownerPassword),
|
||||
Role = "owner"
|
||||
});
|
||||
|
||||
Console.Error.WriteLine($"[nexus] Initial owner credentials generated: displayName={initialDisplayName}, password={initialPassword}");
|
||||
}
|
||||
|
||||
// Record the seed attempt regardless of whether users already existed.
|
||||
@@ -86,6 +87,8 @@ public static class ApplicationBuilderExtensions
|
||||
public static IApplicationBuilder UseNexusPipeline(this IApplicationBuilder app, IWebHostEnvironment env)
|
||||
{
|
||||
app.UseForwardedHeaders();
|
||||
app.UseExceptionHandler();
|
||||
app.UseStatusCodePages();
|
||||
app.UseRateLimiter();
|
||||
app.UseApiKeyAuthentication();
|
||||
app.UseAuthentication();
|
||||
|
||||
Reference in New Issue
Block a user