diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-10-16 10:11:31 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-16 10:11:31 -0500 |
| commit | 1228ab1dbc561607517f0dec61d9ec6e9754fe21 (patch) | |
| tree | 767bade66faae81d3959f20c99090160f7ef7c2d /src/slskd/Program.cs | |
| parent | 08106dfb2545aa430f3cdbabb5ea5684d93ffc19 (diff) | |
| parent | 53ee9e1d22fe9a4bf27213a70ae5105fd640546c (diff) | |
| download | slskd-1228ab1dbc561607517f0dec61d9ec6e9754fe21.tar.gz | |
Merge branch 'master' into staticwebassets
Diffstat (limited to 'src/slskd/Program.cs')
| -rw-r--r-- | src/slskd/Program.cs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index cfe8bcba..5e349dba 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -52,7 +52,7 @@ namespace slskd using Asp.Versioning.ApiExplorer; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; - using Microsoft.AspNetCore.DataProtection; + using Microsoft.AspNetCore.DataProtection.KeyManagement; using Microsoft.AspNetCore.Diagnostics; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; @@ -835,8 +835,15 @@ namespace slskd services.ConfigureTelemetry(); - services.AddDataProtection() - .PersistKeysToFileSystem(new DirectoryInfo(Path.Combine(DataDirectory, "misc", ".DataProtection-Keys"))); + /* + by default, adding authentication of any kind adds data protection, and the default configuration for + data protection drops .DataProtection-Keys on the filesystem. we're not using data protection, but this + can't be suppressed. + + instead, we must fake the key manager into using a dummy repository to stop it from using the filesystem + */ + services.AddDataProtection(); + services.Configure<KeyManagementOptions>(options => options.XmlRepository = new DataProtectionKeyRepository()); var jwtSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(OptionsAtStartup.Web.Authentication.Jwt.Key)); |
