1 diff --git a/API/Controllers/FallbackController.cs b/API/Controllers/FallbackController.cs
2 index 0c92547..d54abb9 100644
3 --- a/API/Controllers/FallbackController.cs
4 +++ b/API/Controllers/FallbackController.cs
5 @@ -22,7 +22,7 @@ public class FallbackController : Controller
7 public PhysicalFileResult Index()
9 - return PhysicalFile(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "index.html"), "text/HTML");
10 + return PhysicalFile(Path.Combine("@webroot@", "index.html"), "text/HTML");
14 diff --git a/API/Services/DirectoryService.cs b/API/Services/DirectoryService.cs
15 index 8c6c796..711f315 100644
16 --- a/API/Services/DirectoryService.cs
17 +++ b/API/Services/DirectoryService.cs
18 @@ -120,7 +120,7 @@ public class DirectoryService : IDirectoryService
19 ExistOrCreate(SiteThemeDirectory);
20 FaviconDirectory = FileSystem.Path.Join(FileSystem.Directory.GetCurrentDirectory(), "config", "favicons");
21 ExistOrCreate(FaviconDirectory);
22 - LocalizationDirectory = FileSystem.Path.Join(FileSystem.Directory.GetCurrentDirectory(), "I18N");
23 + LocalizationDirectory = FileSystem.Path.Join("@out@/lib/kavita-backend", "I18N");
24 CustomizedTemplateDirectory = FileSystem.Path.Join(FileSystem.Directory.GetCurrentDirectory(), "config", "templates");
25 ExistOrCreate(CustomizedTemplateDirectory);
26 TemplateDirectory = FileSystem.Path.Join(FileSystem.Directory.GetCurrentDirectory(), "EmailTemplates");
27 diff --git a/API/Services/LocalizationService.cs b/API/Services/LocalizationService.cs
28 index ab3ad3d..f1a068b 100644
29 --- a/API/Services/LocalizationService.cs
30 +++ b/API/Services/LocalizationService.cs
31 @@ -52,8 +52,7 @@ public class LocalizationService : ILocalizationService
34 _localizationDirectoryUi = directoryService.FileSystem.Path.Join(
35 - directoryService.FileSystem.Directory.GetCurrentDirectory(),
36 - "wwwroot", "assets/langs");
37 + "@webroot@", "assets/langs");
40 _cacheOptions = new MemoryCacheEntryOptions()
41 diff --git a/API/Startup.cs b/API/Startup.cs
42 index 7e3857c..84c466b 100644
45 @@ -36,6 +36,7 @@ using Microsoft.AspNetCore.StaticFiles;
46 using Microsoft.EntityFrameworkCore;
47 using Microsoft.Extensions.Configuration;
48 using Microsoft.Extensions.DependencyInjection;
49 +using Microsoft.Extensions.FileProviders;
50 using Microsoft.Extensions.Hosting;
51 using Microsoft.Extensions.Logging;
52 using Microsoft.Net.Http.Headers;
53 @@ -314,9 +315,6 @@ public class Startup
54 app.UsePathBase(basePath);
55 if (!env.IsDevelopment())
57 - // We don't update the index.html in local as we don't serve from there
58 - UpdateBaseUrlInIndex(basePath);
60 // Update DB with what's in config
61 var dataContext = serviceProvider.GetRequiredService<DataContext>();
62 var setting = dataContext.ServerSetting.SingleOrDefault(x => x.Key == ServerSettingKey.BaseUrl);
63 @@ -360,6 +358,7 @@ public class Startup
65 app.UseStaticFiles(new StaticFileOptions
67 + FileProvider = new PhysicalFileProvider("@webroot@"),
68 // bcmap files needed for PDF reader localizations (https://github.com/Kareadita/Kavita/issues/2970)
69 ContentTypeProvider = new FileExtensionContentTypeProvider
71 @@ -439,7 +438,7 @@ public class Startup
74 var htmlDoc = new HtmlDocument();
75 - var indexHtmlPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "index.html");
76 + var indexHtmlPath = Path.Combine("@webroot@", "index.html");
77 htmlDoc.Load(indexHtmlPath);
79 var baseNode = htmlDoc.DocumentNode.SelectSingleNode("/html/head/base");