From 865fcbc4fed85e9eac58125092838f08dbd55430 Mon Sep 17 00:00:00 2001 From: xovi Date: Wed, 26 Nov 2025 15:23:43 +0100 Subject: Added configurable ip address for the Web GUI (useful for ipv6 only users) --- src/slskd/Program.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/slskd/Program.cs') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index 6b50aedb..e693db63 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -474,8 +474,9 @@ namespace slskd .UseUrls() .UseKestrel(options => { - Log.Information($"Listening for HTTP requests at http://{IPAddress.Any}:{OptionsAtStartup.Web.Port}/"); - options.Listen(IPAddress.Any, OptionsAtStartup.Web.Port); + var httpIpAddress = IPAddress.Parse(OptionsAtStartup.Web.ListenIpAddress); + Log.Information($"Listening for HTTP requests at http://{httpIpAddress}:{OptionsAtStartup.Web.Port}/"); + options.Listen(httpIpAddress, OptionsAtStartup.Web.Port); if (OptionsAtStartup.Web.Socket != null) { @@ -485,8 +486,9 @@ namespace slskd if (!OptionsAtStartup.Web.Https.Disabled) { - Log.Information($"Listening for HTTPS requests at https://{IPAddress.Any}:{OptionsAtStartup.Web.Https.Port}/"); - options.Listen(IPAddress.Any, OptionsAtStartup.Web.Https.Port, listenOptions => + var httpsIpAddress = IPAddress.Parse(OptionsAtStartup.Web.Https.ListenIpAddress); + Log.Information($"Listening for HTTPS requests at https://{httpsIpAddress}:{OptionsAtStartup.Web.Https.Port}/"); + options.Listen(httpsIpAddress, OptionsAtStartup.Web.Https.Port, listenOptions => { var cert = OptionsAtStartup.Web.Https.Certificate; -- cgit v1.2.3 From 736970deaf13b14ed7141558faee56f7200ab62a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 7 Dec 2025 00:13:45 +0000 Subject: Add graceful handling for Mutex creation failures in Program.cs Co-authored-by: jpdillingham <17145758+jpdillingham@users.noreply.github.com> --- src/slskd/Program.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/slskd/Program.cs') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index 6b50aedb..c51d07d8 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -237,7 +237,7 @@ namespace slskd private static IConfigurationRoot Configuration { get; set; } private static OptionsAtStartup OptionsAtStartup { get; } = new OptionsAtStartup(); private static ILogger Log { get; set; } = new ConsoleWriteLineLogger(); - private static Mutex Mutex { get; } = new Mutex(initiallyOwned: true, Compute.Sha256Hash(AppName)); + private static Mutex Mutex { get; set; } private static IDisposable DotNetRuntimeStats { get; set; } [Argument('g', "generate-cert", "generate X509 certificate and password for HTTPs")] @@ -335,10 +335,21 @@ namespace slskd // the application isn't being run in command mode. check the mutex to ensure // only one long-running instance. - if (!Mutex.WaitOne(millisecondsTimeout: 0, exitContext: false)) + try { - Log.Fatal($"An instance of {AppName} is already running"); - return; + Mutex = new Mutex(initiallyOwned: true, Compute.Sha256Hash(AppName)); + + if (!Mutex.WaitOne(millisecondsTimeout: 0, exitContext: false)) + { + Log.Fatal($"An instance of {AppName} is already running"); + return; + } + } + catch (Exception ex) + { + Log.Fatal($"Failed to acquire the application singleton mutex: {ex.Message}"); + Log.Warning("This can happen when running in a restricted environment (e.g., Kubernetes with readOnlyRootFilesystem)"); + Log.Warning("The application will continue, but multiple instances may be able to run simultaneously"); } // derive the application directory value and defaults that are dependent upon it -- cgit v1.2.3 From 1d09aef10a03fb4263a0e312c979d5a153fc9b31 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 7 Dec 2025 00:16:04 +0000 Subject: Address code review feedback: use specific exceptions and dispose Mutex Co-authored-by: jpdillingham <17145758+jpdillingham@users.noreply.github.com> --- src/slskd/Program.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/slskd/Program.cs') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index c51d07d8..29783216 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -345,12 +345,18 @@ namespace slskd return; } } - catch (Exception ex) + catch (IOException ex) { Log.Fatal($"Failed to acquire the application singleton mutex: {ex.Message}"); Log.Warning("This can happen when running in a restricted environment (e.g., Kubernetes with readOnlyRootFilesystem)"); Log.Warning("The application will continue, but multiple instances may be able to run simultaneously"); } + catch (UnauthorizedAccessException ex) + { + Log.Fatal($"Failed to acquire the application singleton mutex: {ex.Message}"); + Log.Warning("This can happen when running with insufficient permissions"); + Log.Warning("The application will continue, but multiple instances may be able to run simultaneously"); + } // derive the application directory value and defaults that are dependent upon it AppDirectory ??= DefaultAppDirectory; @@ -551,6 +557,7 @@ namespace slskd } finally { + Mutex?.Dispose(); Serilog.Log.CloseAndFlush(); } } -- cgit v1.2.3 From 1f98acd90622a66f0ec4a88f5c0c60c8a1cdd332 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 7 Dec 2025 00:17:24 +0000 Subject: Use Warning log level instead of Fatal for Mutex creation failures Co-authored-by: jpdillingham <17145758+jpdillingham@users.noreply.github.com> --- src/slskd/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/slskd/Program.cs') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index 29783216..098cc324 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -347,13 +347,13 @@ namespace slskd } catch (IOException ex) { - Log.Fatal($"Failed to acquire the application singleton mutex: {ex.Message}"); + Log.Warning($"Failed to acquire the application singleton mutex: {ex.Message}"); Log.Warning("This can happen when running in a restricted environment (e.g., Kubernetes with readOnlyRootFilesystem)"); Log.Warning("The application will continue, but multiple instances may be able to run simultaneously"); } catch (UnauthorizedAccessException ex) { - Log.Fatal($"Failed to acquire the application singleton mutex: {ex.Message}"); + Log.Warning($"Failed to acquire the application singleton mutex: {ex.Message}"); Log.Warning("This can happen when running with insufficient permissions"); Log.Warning("The application will continue, but multiple instances may be able to run simultaneously"); } -- cgit v1.2.3 From 4e02b95eeac1cdd3d49f0ca0177f9d59a76e9ce4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 7 Dec 2025 00:19:04 +0000 Subject: Add handling for AbandonedMutexException from WaitOne call Co-authored-by: jpdillingham <17145758+jpdillingham@users.noreply.github.com> --- src/slskd/Program.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/slskd/Program.cs') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index 098cc324..bafac8b1 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -357,6 +357,13 @@ namespace slskd Log.Warning("This can happen when running with insufficient permissions"); Log.Warning("The application will continue, but multiple instances may be able to run simultaneously"); } + catch (AbandonedMutexException ex) + { + Log.Warning($"Acquired an abandoned mutex: {ex.Message}"); + Log.Warning("A previous instance may have terminated unexpectedly"); + + // The mutex is now owned by this thread, so we can continue + } // derive the application directory value and defaults that are dependent upon it AppDirectory ??= DefaultAppDirectory; -- cgit v1.2.3 From 0a66469fd81446b5d54becd049f8da90898cc85c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 7 Dec 2025 00:21:06 +0000 Subject: Fix Mutex logic and protect disposal from throwing exceptions Co-authored-by: jpdillingham <17145758+jpdillingham@users.noreply.github.com> --- src/slskd/Program.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/slskd/Program.cs') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index bafac8b1..85cc4a3a 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -337,9 +337,10 @@ namespace slskd // only one long-running instance. try { - Mutex = new Mutex(initiallyOwned: true, Compute.Sha256Hash(AppName)); + bool createdNew; + Mutex = new Mutex(initiallyOwned: true, Compute.Sha256Hash(AppName), out createdNew); - if (!Mutex.WaitOne(millisecondsTimeout: 0, exitContext: false)) + if (!createdNew) { Log.Fatal($"An instance of {AppName} is already running"); return; @@ -564,7 +565,15 @@ namespace slskd } finally { - Mutex?.Dispose(); + try + { + Mutex?.Dispose(); + } + catch + { + // Ignore disposal errors to prevent masking other exceptions + } + Serilog.Log.CloseAndFlush(); } } -- cgit v1.2.3 From 4792270460293b4810e2e2a34f8deede39008502 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 7 Dec 2025 00:22:19 +0000 Subject: Use explicit Exception type in Mutex disposal catch block Co-authored-by: jpdillingham <17145758+jpdillingham@users.noreply.github.com> --- src/slskd/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/slskd/Program.cs') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index 85cc4a3a..3bd0798b 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -569,7 +569,7 @@ namespace slskd { Mutex?.Dispose(); } - catch + catch (Exception) { // Ignore disposal errors to prevent masking other exceptions } -- cgit v1.2.3 From cf6f43d9225a996d376ea1ae21b3f52e2a06a8fe Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 10 Dec 2025 19:06:14 -0600 Subject: add support for multiple IPs --- src/slskd/Program.cs | 49 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 7 deletions(-) (limited to 'src/slskd/Program.cs') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index a56c8afc..d5e593b3 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -40,6 +40,7 @@ namespace slskd using Microsoft.AspNetCore.Diagnostics; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; + using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -478,21 +479,36 @@ namespace slskd .UseUrls() .UseKestrel(options => { - var httpIpAddress = IPAddress.Parse(OptionsAtStartup.Web.ListenIpAddress); - Log.Information($"Listening for HTTP requests at http://{httpIpAddress}:{OptionsAtStartup.Web.Port}/"); - options.Listen(httpIpAddress, OptionsAtStartup.Web.Port); + // configure HTTP, either by listening at any IP or by each of the IPs provided in the + // config (note: they've already been validated at this point!) + if (string.IsNullOrWhiteSpace(OptionsAtStartup.Web.IpAddress)) + { + Log.Information("Listening for HTTP requests at http://{IP}:{Port}/", IPAddress.IPv6Any, OptionsAtStartup.Web.Port); + options.Listen(IPAddress.IPv6Any, OptionsAtStartup.Web.Port); // [::]; any IPv4 or IPv6 address + } + else + { + var httpIps = OptionsAtStartup.Web.IpAddress.Split(',').Select(ip => IPAddress.Parse(ip)); + + foreach (var ip in httpIps) + { + Log.Information("Listening for HTTP requests at http://{IP}:{Port}/", ip, OptionsAtStartup.Web.Port); + options.Listen(ip, OptionsAtStartup.Web.Port); + } + } + // configure UDS, if supplied if (OptionsAtStartup.Web.Socket != null) { Log.Information($"Listening for HTTP requests on unix domain socket (UDS) {OptionsAtStartup.Web.Socket}"); options.ListenUnixSocket(OptionsAtStartup.Web.Socket); } - if (!OptionsAtStartup.Web.Https.Disabled) + // configure HTTPS, again listening on any IP or on a list of supplied IPs + // use a local function because Microsoft can't get enough of the obtuse builder pattern + void ListenHttps(KestrelServerOptions o, IPAddress ip) { - var httpsIpAddress = IPAddress.Parse(OptionsAtStartup.Web.Https.ListenIpAddress); - Log.Information($"Listening for HTTPS requests at https://{httpsIpAddress}:{OptionsAtStartup.Web.Https.Port}/"); - options.Listen(httpsIpAddress, OptionsAtStartup.Web.Https.Port, listenOptions => + o.Listen(ip, OptionsAtStartup.Web.Https.Port, listenOptions => { var cert = OptionsAtStartup.Web.Https.Certificate; @@ -508,6 +524,25 @@ namespace slskd } }); } + + if (!OptionsAtStartup.Web.Https.Disabled) + { + if (string.IsNullOrWhiteSpace(OptionsAtStartup.Web.Https.IpAddress)) + { + Log.Information("Listening for HTTPS requests at https://{IP}:{Port}/", IPAddress.IPv6Any, OptionsAtStartup.Web.Https.Port); + ListenHttps(options, IPAddress.IPv6Any); + } + else + { + var httpsIps = OptionsAtStartup.Web.Https.IpAddress.Split(',').Select(ip => IPAddress.Parse(ip)); + + foreach (var ip in httpsIps) + { + Log.Information("Listening for HTTPS requests at https://{IP}:{Port}/", ip, OptionsAtStartup.Web.Https.Port); + ListenHttps(options, ip); + } + } + } }); builder.Services -- cgit v1.2.3 From 22e8ebec9534150f8d04309bd7855ef60644e030 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Thu, 11 Dec 2025 09:03:59 -0600 Subject: trim ips --- src/slskd/Program.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/slskd/Program.cs') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index d5e593b3..288fa0e3 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -488,7 +488,10 @@ namespace slskd } else { - var httpIps = OptionsAtStartup.Web.IpAddress.Split(',').Select(ip => IPAddress.Parse(ip)); + var httpIps = OptionsAtStartup.Web.IpAddress + .Split(',') + .Select(ip => ip.Trim()) + .Select(ip => IPAddress.Parse(ip)); foreach (var ip in httpIps) { @@ -506,7 +509,7 @@ namespace slskd // configure HTTPS, again listening on any IP or on a list of supplied IPs // use a local function because Microsoft can't get enough of the obtuse builder pattern - void ListenHttps(KestrelServerOptions o, IPAddress ip) + static void ListenHttps(KestrelServerOptions o, IPAddress ip) { o.Listen(ip, OptionsAtStartup.Web.Https.Port, listenOptions => { @@ -534,7 +537,10 @@ namespace slskd } else { - var httpsIps = OptionsAtStartup.Web.Https.IpAddress.Split(',').Select(ip => IPAddress.Parse(ip)); + var httpsIps = OptionsAtStartup.Web.Https.IpAddress + .Split(',') + .Select(ip => ip.Trim()) + .Select(ip => IPAddress.Parse(ip)); foreach (var ip in httpsIps) { -- cgit v1.2.3 From 848262831fe6281d448afd3bdcf802bbc643fbd1 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 13 Dec 2025 14:19:52 -0600 Subject: remove ISecurityService interface, add logging to api key handler --- src/slskd/Common/Authentication/ApiKeyAuthentication.cs | 9 ++++++--- src/slskd/Core/API/Controllers/SessionController.cs | 4 ++-- src/slskd/Program.cs | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'src/slskd/Program.cs') diff --git a/src/slskd/Common/Authentication/ApiKeyAuthentication.cs b/src/slskd/Common/Authentication/ApiKeyAuthentication.cs index 1aaa4a4f..fb209478 100644 --- a/src/slskd/Common/Authentication/ApiKeyAuthentication.cs +++ b/src/slskd/Common/Authentication/ApiKeyAuthentication.cs @@ -15,6 +15,7 @@ // along with this program. If not, see https://www.gnu.org/licenses/. // +using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; namespace slskd.Authentication @@ -24,7 +25,7 @@ namespace slskd.Authentication using System.Text.Encodings.Web; using System.Threading.Tasks; using Microsoft.AspNetCore.Authentication; - using Microsoft.Extensions.Logging; + using Serilog; /// /// API key authentication. @@ -51,7 +52,7 @@ namespace slskd.Authentication /// A url encoder. public ApiKeyAuthenticationHandler( IOptionsMonitor apiKeyOptionsMonitor, - ISecurityService securityService, + SecurityService securityService, ILoggerFactory logger, UrlEncoder urlEncoder) : base(apiKeyOptionsMonitor, logger, urlEncoder) @@ -59,7 +60,8 @@ namespace slskd.Authentication Security = securityService; } - private ISecurityService Security { get; } + private ILogger Log { get; } = Serilog.Log.ForContext(); + private SecurityService Security { get; } /// /// Authenticates via API key. @@ -86,6 +88,7 @@ namespace slskd.Authentication } catch (Exception ex) { + Log.Warning(ex, "Unauthorized: {Message}", ex.Message); return AuthenticateResult.Fail(ex); } } diff --git a/src/slskd/Core/API/Controllers/SessionController.cs b/src/slskd/Core/API/Controllers/SessionController.cs index 861fd468..cfcb3f23 100644 --- a/src/slskd/Core/API/Controllers/SessionController.cs +++ b/src/slskd/Core/API/Controllers/SessionController.cs @@ -36,7 +36,7 @@ namespace slskd.Core.API public class SessionController : ControllerBase { public SessionController( - ISecurityService securityService, + SecurityService securityService, IOptionsSnapshot optionsSnapshot, OptionsAtStartup optionsAtStartup) { @@ -47,7 +47,7 @@ namespace slskd.Core.API private IOptionsSnapshot OptionsSnapshot { get; set; } private OptionsAtStartup OptionsAtStartup { get; set; } - private ISecurityService Security { get; } + private SecurityService Security { get; } private ILogger Log { get; } = Serilog.Log.ForContext(); /// diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index 288fa0e3..cb1961a2 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -768,7 +768,7 @@ namespace slskd var jwtSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(OptionsAtStartup.Web.Authentication.Jwt.Key)); services.AddSingleton(jwtSigningKey); - services.AddSingleton(); + services.AddSingleton(); if (!OptionsAtStartup.Web.Authentication.Disabled) { @@ -835,7 +835,7 @@ namespace slskd try { // check to see if the provided value is a valid API key - var service = services.BuildServiceProvider().GetRequiredService(); + var service = services.BuildServiceProvider().GetRequiredService(); var (name, role) = service.AuthenticateWithApiKey(token, callerIpAddress: context.HttpContext.Connection.RemoteIpAddress); // the API key is valid. create a new, short lived jwt for the key name and role -- cgit v1.2.3 From e08479ee8d91952fee13b009f861912a92a2dbae Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 13 Dec 2025 17:15:16 -0600 Subject: tweak --- src/slskd/Program.cs | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'src/slskd/Program.cs') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index 3bd0798b..db4f7c6c 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -23,8 +23,6 @@ namespace slskd using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; - using System.Diagnostics; - using System.IO; using System.Linq; using System.Net; @@ -337,10 +335,9 @@ namespace slskd // only one long-running instance. try { - bool createdNew; - Mutex = new Mutex(initiallyOwned: true, Compute.Sha256Hash(AppName), out createdNew); + Mutex = new Mutex(initiallyOwned: true, Compute.Sha256Hash(AppName), out bool created); - if (!createdNew) + if (!created) { Log.Fatal($"An instance of {AppName} is already running"); return; @@ -348,22 +345,18 @@ namespace slskd } catch (IOException ex) { - Log.Warning($"Failed to acquire the application singleton mutex: {ex.Message}"); - Log.Warning("This can happen when running in a restricted environment (e.g., Kubernetes with readOnlyRootFilesystem)"); - Log.Warning("The application will continue, but multiple instances may be able to run simultaneously"); + Log.Fatal($"I/O exception attempting to acquire the application singleton mutex; this can happen when running in a restricted environment (such as a read-only filesystem or container). Exception: {ex.Message}"); + return; } catch (UnauthorizedAccessException ex) { - Log.Warning($"Failed to acquire the application singleton mutex: {ex.Message}"); - Log.Warning("This can happen when running with insufficient permissions"); - Log.Warning("The application will continue, but multiple instances may be able to run simultaneously"); + Log.Fatal($"Unauthorized access attempting to acquire the application singleton mutex; this can happen when running with insuffucent permissions. Exception: {ex.Message}"); + return; } - catch (AbandonedMutexException ex) + catch (Exception ex) { - Log.Warning($"Acquired an abandoned mutex: {ex.Message}"); - Log.Warning("A previous instance may have terminated unexpectedly"); - - // The mutex is now owned by this thread, so we can continue + Log.Fatal($"Failed to acquire the application singleton mutex: {ex.Message}"); + return; } // derive the application directory value and defaults that are dependent upon it -- cgit v1.2.3 From 7b2deffc16b632b084750cd0be535a509ff3d253 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 28 Dec 2025 16:39:13 -0600 Subject: log parameters and detailed errors when logging SQL --- src/slskd/Program.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/slskd/Program.cs') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index 770c6746..9203dd37 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -1295,7 +1295,10 @@ namespace slskd if (OptionsAtStartup.Debug && OptionsAtStartup.Flags.LogSQL) { - options.LogTo(Log.Debug, LogLevel.Information); + options + .EnableSensitiveDataLogging() + .EnableDetailedErrors() + .LogTo(Log.Debug, LogLevel.Information); } }); -- cgit v1.2.3 From 1144e602347277cc2abca3a4301dda5fb95a3346 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 28 Dec 2025 18:34:56 -0600 Subject: tweak sql logging so debug isn't required --- src/slskd/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/slskd/Program.cs') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index 9203dd37..2b2d2840 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -1293,12 +1293,12 @@ namespace slskd options.UseSqlite(connectionString); options.AddInterceptors(new SqliteConnectionOpenedInterceptor()); - if (OptionsAtStartup.Debug && OptionsAtStartup.Flags.LogSQL) + if (OptionsAtStartup.Flags.LogSQL) { options .EnableSensitiveDataLogging() .EnableDetailedErrors() - .LogTo(Log.Debug, LogLevel.Information); + .LogTo(OptionsAtStartup.Debug ? Log.Debug : Log.Information, LogLevel.Information); } }); -- cgit v1.2.3