mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Set the content root to the application folder
https://github.com/Jackett/Jackett/issues/3522
This commit is contained in:
@@ -14,6 +14,7 @@ using System.Collections.Generic;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
namespace Jackett.Server
|
namespace Jackett.Server
|
||||||
@@ -130,7 +131,10 @@ namespace Jackett.Server
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
logger.Debug("Creating web host...");
|
logger.Debug("Creating web host...");
|
||||||
CreateWebHostBuilder(args, url).Build().Run();
|
string applicationFolder = configurationService.ApplicationFolder();
|
||||||
|
logger.Debug($"Content root path is: {applicationFolder}");
|
||||||
|
|
||||||
|
CreateWebHostBuilder(args, url, applicationFolder).Build().Run();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -174,9 +178,10 @@ namespace Jackett.Server
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IWebHostBuilder CreateWebHostBuilder(string[] args, string[] urls) =>
|
public static IWebHostBuilder CreateWebHostBuilder(string[] args, string[] urls, string contentRoot) =>
|
||||||
WebHost.CreateDefaultBuilder(args)
|
WebHost.CreateDefaultBuilder(args)
|
||||||
.UseConfiguration(Configuration)
|
.UseConfiguration(Configuration)
|
||||||
|
.UseContentRoot(contentRoot)
|
||||||
.UseUrls(urls)
|
.UseUrls(urls)
|
||||||
.PreferHostingUrls(true)
|
.PreferHostingUrls(true)
|
||||||
.UseStartup<Startup>()
|
.UseStartup<Startup>()
|
||||||
|
Reference in New Issue
Block a user