fix: remove hardcoded DB password from AppDbContextFactory
The fallback connection string included 'Password=heimdall' as a literal. Remove the password — the fallback is only for local dev where PostgreSQL trust authentication is typically used. Production deployments must set the DATABASE_URL environment variable.
This commit is contained in:
1 parent
06927fb9b4
commit
ec50f6635e
1 file changed
+1
-2
@@ -1,4 +1,3 @@
|
||||
|
||||
using Heimdall.Infrastructure.Data.Interceptors;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Design;
|
||||
@@ -16,7 +15,7 @@ public class AppDbContextFactory : IDesignTimeDbContextFactory<AppDbContext>
|
||||
var optionsBuilder = new DbContextOptionsBuilder<AppDbContext>();
|
||||
|
||||
var connectionString = Environment.GetEnvironmentVariable("DATABASE_URL")
|
||||
?? "Host=localhost;Port=5432;Database=heimdall;Username=heimdall;Password=heimdall";
|
||||
?? "Host=localhost;Port=5432;Database=heimdall;Username=heimdall";
|
||||
|
||||
optionsBuilder.UseNpgsql(connectionString, npgsql =>
|
||||
npgsql.MigrationsHistoryTable("__EFMigrationsHistory", "public"));
|
||||
|
||||
Reference in new issue
Block a user