Fix reachable and IP leak test (#44)

* Fix reachable check

Fixes failing reachable checks when Basic Authentication is enabled in
Sonarr, Radarr, etc.

* Add option to disable IP leak test
This commit is contained in:
akuntsch
2024-10-21 14:26:35 +02:00
committed by GitHub
parent b8539b109e
commit 3f5d7bbef3
5 changed files with 41 additions and 43 deletions

View File

@@ -8,10 +8,12 @@ using UmlautAdaptarr.Utilities;
internal class Program
{
private static void Main(string[] args)
private static void Main(string[] args) {
MainAsync(args).Wait();
}
private static async Task MainAsync(string[] args)
{
Helper.ShowLogo();
Helper.ShowInformation();
// TODO:
// add option to sort by nzb age
var builder = WebApplication.CreateBuilder(args);
@@ -43,9 +45,9 @@ internal class Program
builder.AddTitleLookupService();
builder.Services.AddSingleton<SearchItemLookupService>();
builder.Services.AddSingleton<TitleMatchingService>();
builder.AddSonarrSupport();
builder.AddLidarrSupport();
builder.AddReadarrSupport();
await builder.AddSonarrSupport();
await builder.AddLidarrSupport();
await builder.AddReadarrSupport();
builder.Services.AddSingleton<CacheService>();
builder.Services.AddSingleton<ProxyRequestService>();
builder.Services.AddSingleton<ArrApplicationFactory>();
@@ -54,6 +56,13 @@ internal class Program
var app = builder.Build();
Helper.ShowLogo();
if (app.Configuration.GetValue<bool>("IpLeakTest:Enabled"))
{
await Helper.ShowInformation();
}
GlobalStaticLogger.Initialize(app.Services.GetService<ILoggerFactory>()!);
app.UseHttpsRedirection();
app.UseAuthorization();
@@ -109,4 +118,4 @@ internal class Program
//.Enrich.With(new ApiKeyMaskingEnricher("appsettings.json")) // TODO - Not working currently
.CreateLogger();
}
}
}