Stash and player management fix_oops
This commit is contained in:
+1
-11
@@ -28,23 +28,13 @@ builder.Services.AddRazorPages()
|
||||
});
|
||||
|
||||
// ---- Session for Admin Auth ----
|
||||
// Use Redis for distributed session storage (required for multi-instance/Kubernetes)
|
||||
var redisConnString = Environment.GetEnvironmentVariable("REDIS_URL")
|
||||
?? Environment.GetEnvironmentVariable("REDIS_HOST") + ":" + (Environment.GetEnvironmentVariable("REDIS_PORT") ?? "6379");
|
||||
builder.Services.AddStackExchangeRedisCache(options =>
|
||||
{
|
||||
options.Configuration = redisConnString;
|
||||
options.InstanceName = "VoidScavengers:Sessions:";
|
||||
});
|
||||
|
||||
builder.Services.AddDistributedMemoryCache();
|
||||
builder.Services.AddSession(options =>
|
||||
{
|
||||
options.IdleTimeout = TimeSpan.FromHours(8);
|
||||
options.Cookie.HttpOnly = true;
|
||||
options.Cookie.IsEssential = true;
|
||||
options.Cookie.Name = ".VoidScavengers.Admin";
|
||||
options.Cookie.SameSite = SameSiteMode.Lax;
|
||||
options.Cookie.SecurePolicy = CookieSecurePolicy.SameAsRequest;
|
||||
});
|
||||
|
||||
// ---- MySQL conn string from env ----
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
<PackageReference Include="Polly" Version="8.6.4" />
|
||||
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0" />
|
||||
<PackageReference Include="StackExchange.Redis" Version="2.9.32" />
|
||||
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user