summaryrefslogtreecommitdiff
path: root/Program.cs
diff options
context:
space:
mode:
authorJake Mannens <jake@asger.xyz>2026-04-16 02:22:56 +1000
committerJake Mannens <jake@asger.xyz>2026-04-16 02:22:56 +1000
commitba86ba12732b3290eaa74936950a370966b41ac5 (patch)
treefcb1fb3df3a0edc1d0a27a5336c8cadaef593507 /Program.cs
parentd59e751c5b7c23f0dce2a146b6b8ced80231a0cb (diff)
v0.10av0.10a
Diffstat (limited to 'Program.cs')
-rw-r--r--Program.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Program.cs b/Program.cs
index e7f1e26..548f6e9 100644
--- a/Program.cs
+++ b/Program.cs
@@ -2,6 +2,7 @@ using Microsoft.EntityFrameworkCore;
using System.Text.Json.Serialization;
using HyperBooru.Services;
using Microsoft.AspNetCore.Authentication.Cookies;
+using Microsoft.AspNetCore.DataProtection;
namespace HyperBooru;
@@ -30,6 +31,13 @@ public class Program {
builder.Services.AddHostedService<OcrService>();
builder.Services.AddSingleton<ISourceService, SourceService>();
+ // Ensure session keys are stored in a persistent location on all platforms
+ builder.Services.AddDataProtection()
+ .PersistKeysToFileSystem(new(
+ builder.Services.BuildServiceProvider()
+ .GetRequiredService<IConfigService>()
+ .KeyPath));
+
var app = builder.Build();
// Ensure database is created and it's schema is up to date