From d9165a60ffc053f811dc0a5442ec6449a145165d Mon Sep 17 00:00:00 2001 From: jhartworks Date: Thu, 8 Oct 2026 12:33:17 +0200 Subject: [PATCH] Fix published web UI content root --- src/Gateway.Api/Program.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Gateway.Api/Program.cs b/src/Gateway.Api/Program.cs index 842e20c..178ebe7 100644 --- a/src/Gateway.Api/Program.cs +++ b/src/Gateway.Api/Program.cs @@ -4,7 +4,14 @@ using Gateway.Api.Domain; using Gateway.Api.Options; using Gateway.Api.Services; +// The service keeps its mutable data in /var/lib/seiugw on NixOS. Static web +// assets, however, are published beside this executable in the immutable Nix +// store. Explicitly use the executable directory as the content/web root so +// the web UI is available no matter which working directory systemd uses. +var applicationRoot = AppContext.BaseDirectory; var builder = WebApplication.CreateBuilder(args); +builder.WebHost.UseContentRoot(applicationRoot); +builder.WebHost.UseWebRoot(Path.Combine(applicationRoot, "wwwroot")); builder.Services.Configure(builder.Configuration.GetSection("Gateway")); builder.Services.ConfigureHttpJsonOptions(options => options.SerializerOptions.Converters.Add(new JsonStringEnumConverter())); builder.Services.AddSingleton();