|
|
@ -49,8 +49,6 @@ namespace Ombi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Console.WriteLine(HelpOutput(result));
|
|
|
|
Console.WriteLine(HelpOutput(result));
|
|
|
|
if (baseUrl.HasValue())
|
|
|
|
if (baseUrl.HasValue())
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -64,11 +62,9 @@ namespace Ombi
|
|
|
|
demoInstance.Demo = demo;
|
|
|
|
demoInstance.Demo = demo;
|
|
|
|
instance.StoragePath = storagePath ?? string.Empty;
|
|
|
|
instance.StoragePath = storagePath ?? string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var services = new ServiceCollection();
|
|
|
|
var services = new ServiceCollection();
|
|
|
|
services.ConfigureDatabases(null);
|
|
|
|
services.ConfigureDatabases(null);
|
|
|
|
using (var provider = services.BuildServiceProvider())
|
|
|
|
using var provider = services.BuildServiceProvider();
|
|
|
|
{
|
|
|
|
|
|
|
|
var settingsDb = provider.GetRequiredService<SettingsContext>();
|
|
|
|
var settingsDb = provider.GetRequiredService<SettingsContext>();
|
|
|
|
var ombiDb = provider.GetRequiredService<OmbiContext>();
|
|
|
|
var ombiDb = provider.GetRequiredService<OmbiContext>();
|
|
|
|
|
|
|
|
|
|
|
@ -103,12 +99,10 @@ namespace Ombi
|
|
|
|
var strat = settingsDb.Database.CreateExecutionStrategy();
|
|
|
|
var strat = settingsDb.Database.CreateExecutionStrategy();
|
|
|
|
await strat.ExecuteAsync(async () =>
|
|
|
|
await strat.ExecuteAsync(async () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
using (var tran = await settingsDb.Database.BeginTransactionAsync())
|
|
|
|
using var tran = await settingsDb.Database.BeginTransactionAsync();
|
|
|
|
{
|
|
|
|
|
|
|
|
settingsDb.ApplicationConfigurations.Add(url);
|
|
|
|
settingsDb.ApplicationConfigurations.Add(url);
|
|
|
|
await settingsDb.SaveChangesAsync();
|
|
|
|
await settingsDb.SaveChangesAsync();
|
|
|
|
await tran.CommitAsync();
|
|
|
|
await tran.CommitAsync();
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
urlValue = url.Value;
|
|
|
|
urlValue = url.Value;
|
|
|
@ -120,11 +114,9 @@ namespace Ombi
|
|
|
|
var strat = settingsDb.Database.CreateExecutionStrategy();
|
|
|
|
var strat = settingsDb.Database.CreateExecutionStrategy();
|
|
|
|
await strat.ExecuteAsync(async () =>
|
|
|
|
await strat.ExecuteAsync(async () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
using (var tran = await settingsDb.Database.BeginTransactionAsync())
|
|
|
|
using var tran = await settingsDb.Database.BeginTransactionAsync();
|
|
|
|
{
|
|
|
|
|
|
|
|
await settingsDb.SaveChangesAsync();
|
|
|
|
await settingsDb.SaveChangesAsync();
|
|
|
|
await tran.CommitAsync();
|
|
|
|
await tran.CommitAsync();
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
urlValue = url.Value;
|
|
|
|
urlValue = url.Value;
|
|
|
@ -140,7 +132,6 @@ namespace Ombi
|
|
|
|
|
|
|
|
|
|
|
|
CreateHostBuilder(args).Build().Run();
|
|
|
|
CreateHostBuilder(args).Build().Run();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static async Task CheckSecurityToken(ApplicationConfiguration securityToken, SettingsContext ctx, StartupSingleton instance)
|
|
|
|
private static async Task CheckSecurityToken(ApplicationConfiguration securityToken, SettingsContext ctx, StartupSingleton instance)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -154,12 +145,10 @@ namespace Ombi
|
|
|
|
var strat = ctx.Database.CreateExecutionStrategy();
|
|
|
|
var strat = ctx.Database.CreateExecutionStrategy();
|
|
|
|
await strat.ExecuteAsync(async () =>
|
|
|
|
await strat.ExecuteAsync(async () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
using (var tran = await ctx.Database.BeginTransactionAsync())
|
|
|
|
using var tran = await ctx.Database.BeginTransactionAsync();
|
|
|
|
{
|
|
|
|
|
|
|
|
ctx.ApplicationConfigurations.Add(securityToken);
|
|
|
|
ctx.ApplicationConfigurations.Add(securityToken);
|
|
|
|
await ctx.SaveChangesAsync();
|
|
|
|
await ctx.SaveChangesAsync();
|
|
|
|
await tran.CommitAsync();
|
|
|
|
await tran.CommitAsync();
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -170,7 +159,7 @@ namespace Ombi
|
|
|
|
Host.CreateDefaultBuilder(args)
|
|
|
|
Host.CreateDefaultBuilder(args)
|
|
|
|
.ConfigureWebHostDefaults(webBuilder =>
|
|
|
|
.ConfigureWebHostDefaults(webBuilder =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
webBuilder.ConfigureKestrel(serverOptions =>
|
|
|
|
webBuilder.ConfigureKestrel(_ =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Set properties and call methods on options
|
|
|
|
// Set properties and call methods on options
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -204,12 +193,10 @@ namespace Ombi
|
|
|
|
var strat = settingsDb.Database.CreateExecutionStrategy();
|
|
|
|
var strat = settingsDb.Database.CreateExecutionStrategy();
|
|
|
|
await strat.ExecuteAsync(async () =>
|
|
|
|
await strat.ExecuteAsync(async () =>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
using (var tran = await settingsDb.Database.BeginTransactionAsync())
|
|
|
|
using var tran = await settingsDb.Database.BeginTransactionAsync();
|
|
|
|
{
|
|
|
|
|
|
|
|
settingsDb.Add(ombiSettingsContent);
|
|
|
|
settingsDb.Add(ombiSettingsContent);
|
|
|
|
await settingsDb.SaveChangesAsync();
|
|
|
|
await settingsDb.SaveChangesAsync();
|
|
|
|
await tran.CommitAsync();
|
|
|
|
await tran.CommitAsync();
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var ombiSettings = JsonConvert.DeserializeObject<OmbiSettings>(ombiSettingsContent.Content);
|
|
|
|
var ombiSettings = JsonConvert.DeserializeObject<OmbiSettings>(ombiSettingsContent.Content);
|
|
|
|