From 92c3b888d925f28f2f53afc73fc285f78ed41e90 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Mon, 24 Aug 2026 22:10:59 -0500 Subject: update disk call sites --- 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 5260760f..c998d319 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -512,7 +512,7 @@ namespace slskd Log.Information("Storing application data in {DataDirectory}", DataDirectory); - if (OptionsAtStartup.Logger.Disk) + if (!OptionsAtStartup.Logger.NoDisk) { Log.Information("Saving application logs to {LogDirectory}", LogDirectory); } @@ -1242,7 +1242,7 @@ namespace slskd outputTemplate: (OptionsAtStartup.Debug ? "[{SourceContext}] " : string.Empty) + "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}") .WriteTo.Async(config => config.Conditional( - e => OptionsAtStartup.Logger.Disk, + e => !OptionsAtStartup.Logger.NoDisk, config => config.File( Path.Combine(LogDirectory, $"{AppName}-.log"), outputTemplate: (OptionsAtStartup.Debug ? "[{SourceContext}] " : string.Empty) + "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}", -- cgit v1.2.3 From bcbb9839144a64df12ecbff26e465129054a5354 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Wed, 9 Sep 2026 18:44:51 -0500 Subject: rewrite ./favicon.ico so it's prefixed by urlBase --- src/slskd/Program.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/slskd/Program.cs') diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index c998d319..b1f57ce4 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -1067,12 +1067,17 @@ namespace slskd var urlBase = OptionsAtStartup.Web.UrlBase; urlBase = urlBase.StartsWith("/") ? urlBase : "/" + urlBase; - // use urlBase. this effectively just removes urlBase from the path. - // inject urlBase into any html files we serve, and rewrite links to ./static or /static to - // prepend the url base. + // use urlBase. this effectively just removes urlBase from the path before sending it to the next middleware app.UsePathBase(urlBase); + + // rewrite relative html links to ./static or ./favicon.ico to absolute links that include urlBase + // this is necessary because SPA routers (like React Router) mess with the browser's current address app.UseHTMLRewrite("((\\.)?\\/static)", $"{(urlBase == "/" ? string.Empty : urlBase)}/static"); + app.UseHTMLRewrite("((\\.)?\\/favicon\\.ico)", $"{(urlBase == "/" ? string.Empty : urlBase)}/favicon.ico"); + + // inject urlBase and port into any html files we serve as a window-scoped javascript variable app.UseHTMLInjection($"", excludedRoutes: new[] { "/api", "/swagger" }); + Log.Information("Using base url {UrlBase}", urlBase); // serve static content from the configured path -- cgit v1.2.3