mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Add ability to use appsettings.json
https://github.com/Jackett/Jackett/issues/3583
This commit is contained in:
@@ -107,6 +107,7 @@ namespace Jackett.Server
|
|||||||
|
|
||||||
var builder = new ConfigurationBuilder();
|
var builder = new ConfigurationBuilder();
|
||||||
builder.AddInMemoryCollection(runtimeDictionary);
|
builder.AddInMemoryCollection(runtimeDictionary);
|
||||||
|
builder.AddJsonFile(Path.Combine(configurationService.GetAppDataFolder(), "appsettings.json"), optional: true);
|
||||||
|
|
||||||
Configuration = builder.Build();
|
Configuration = builder.Build();
|
||||||
|
|
||||||
@@ -179,11 +180,11 @@ namespace Jackett.Server
|
|||||||
|
|
||||||
public static IWebHostBuilder CreateWebHostBuilder(string[] args, string[] urls, string contentRoot) =>
|
public static IWebHostBuilder CreateWebHostBuilder(string[] args, string[] urls, string contentRoot) =>
|
||||||
WebHost.CreateDefaultBuilder(args)
|
WebHost.CreateDefaultBuilder(args)
|
||||||
.UseConfiguration(Configuration)
|
|
||||||
.UseContentRoot(contentRoot)
|
.UseContentRoot(contentRoot)
|
||||||
.UseWebRoot(contentRoot)
|
.UseWebRoot(contentRoot)
|
||||||
.UseUrls(urls)
|
.UseUrls(urls)
|
||||||
.PreferHostingUrls(true)
|
.PreferHostingUrls(true)
|
||||||
|
.UseConfiguration(Configuration)
|
||||||
.UseStartup<Startup>()
|
.UseStartup<Startup>()
|
||||||
.UseNLog();
|
.UseNLog();
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"Logging": {
|
|
||||||
"IncludeScopes": false,
|
|
||||||
"LogLevel": {
|
|
||||||
"Default": "Debug",
|
|
||||||
"System": "Information",
|
|
||||||
"Microsoft": "Information"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"Logging": {
|
|
||||||
"IncludeScopes": false,
|
|
||||||
"Debug": {
|
|
||||||
"LogLevel": {
|
|
||||||
"Default": "Warning"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Console": {
|
|
||||||
"LogLevel": {
|
|
||||||
"Default": "Warning"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -233,6 +233,8 @@ namespace Jackett.Updater
|
|||||||
"Definitions/torrentwtf.yml",
|
"Definitions/torrentwtf.yml",
|
||||||
"Definitions/eotforum.yml",
|
"Definitions/eotforum.yml",
|
||||||
"Definitions/nexttorrent.yml",
|
"Definitions/nexttorrent.yml",
|
||||||
|
"appsettings.Development.json",
|
||||||
|
"appsettings.json",
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var oldFile in oldFiles)
|
foreach (var oldFile in oldFiles)
|
||||||
|
Reference in New Issue
Block a user