Fucking rediss......

This commit is contained in:
dingo
2026-01-30 13:40:16 -05:00
parent cefa22635b
commit 55b5749230
+11 -1
View File
@@ -95,9 +95,11 @@ builder.Services.AddHttpClient(); // For CDN file hash computation
builder.Services.AddHealthChecks()
.AddCheck<DatabaseHealthCheck>("mysql", tags: new[] { "ready" });
var dpDb = redisMux.GetDatabase(2);
builder.Services.AddDataProtection()
.SetApplicationName("Void")
.PersistKeysToStackExchangeRedis(() => redisMux.GetDatabase(), "Void:DataProtectionKeys");
.PersistKeysToStackExchangeRedis(() => dpDb, "Void:DataProtectionKeys");
//var app = builder.Build();
@@ -243,5 +245,13 @@ app.Lifetime.ApplicationStopping.Register(() =>
app.MapControllers();
app.MapRazorPages();
//Call two:
keyManager = app.Services.GetRequiredService<IKeyManager>();
keys = keyManager.GetAllKeys();
app.Logger.LogInformation("DP keys present: {Count}", keys.Count);
foreach (var k in keys)
app.Logger.LogInformation("DP key: {Id} Created={Created} Expires={Expires} Revoked={Revoked}",
k.KeyId, k.CreationDate, k.ExpirationDate, k.IsRevoked);
app.Logger.LogInformation("Admin panel available at /admin");
await app.RunAsync();