persist data protection keys in etv config folder (#1585)

This commit is contained in:
Jason Dove
2024-01-30 19:41:39 -06:00
committed by GitHub
parent 7d5cd229d4
commit d6dfc1edaa
3 changed files with 10 additions and 0 deletions
+5
View File
@@ -4,8 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Added
- Add `show_studio` to search index for seasons and episodes
### Fixed
- Fix antiforgery error caused by reusing existing browser tabs across docker container restarts
- Data protection keys will now be persisted under ErsatzTV's config folder instead of being recreated at startup
## [0.8.5-beta] - 2024-01-30
### Added
- Respect browser's `Accept-Language` header for date time display
+2
View File
@@ -15,6 +15,8 @@ public static class FileSystemLayout
Environment.SpecialFolderOption.Create),
"etv-transcode");
public static readonly string DataProtectionFolder = Path.Combine(AppDataFolder, "data-protection");
public static readonly string LogsFolder = Path.Combine(AppDataFolder, "logs");
public static readonly string DatabasePath = Path.Combine(AppDataFolder, "ersatztv.sqlite3");
+3
View File
@@ -71,6 +71,7 @@ using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.StaticFiles;
using Microsoft.EntityFrameworkCore;
@@ -132,6 +133,8 @@ public class Startup
configuration.ReleaseStage = bugsnagConfig.Enable ? "public" : "private";
#endif
});
services.AddDataProtection().PersistKeysToFileSystem(new DirectoryInfo(FileSystemLayout.DataProtectionFolder));
OidcHelper.Init(Configuration);
JwtHelper.Init(Configuration);