Browse Source

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

pull/1586/head
Jason Dove 2 years ago committed by GitHub
parent
commit
d6dfc1edaa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      CHANGELOG.md
  2. 2
      ErsatzTV.Core/FileSystemLayout.cs
  3. 3
      ErsatzTV/Startup.cs

5
CHANGELOG.md

@ -4,8 +4,13 @@ All notable changes to this project will be documented in this 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
ErsatzTV.Core/FileSystemLayout.cs

@ -15,6 +15,8 @@ public static class FileSystemLayout @@ -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
ErsatzTV/Startup.cs

@ -71,6 +71,7 @@ using Microsoft.AspNetCore.Authentication.Cookies; @@ -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;
@ -133,6 +134,8 @@ public class Startup @@ -133,6 +134,8 @@ public class Startup
#endif
});
services.AddDataProtection().PersistKeysToFileSystem(new DirectoryInfo(FileSystemLayout.DataProtectionFolder));
OidcHelper.Init(Configuration);
JwtHelper.Init(Configuration);
SearchHelper.Init(Configuration);

Loading…
Cancel
Save