diff options
Diffstat (limited to 'BackEnd')
-rw-r--r-- | BackEnd/Timeline/Program.cs | 5 | ||||
-rw-r--r-- | BackEnd/Timeline/Services/DatabaseManagement/DatabaseManagementService.cs | 6 | ||||
-rw-r--r-- | BackEnd/Timeline/Startup.cs | 18 |
3 files changed, 29 insertions, 0 deletions
diff --git a/BackEnd/Timeline/Program.cs b/BackEnd/Timeline/Program.cs index 82d0e0ac..2280d80c 100644 --- a/BackEnd/Timeline/Program.cs +++ b/BackEnd/Timeline/Program.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
+using System;
using System.Resources;
using System.Threading.Tasks;
@@ -12,6 +13,10 @@ namespace Timeline {
public async static Task Main(string[] args)
{
+ Console.ForegroundColor = ConsoleColor.Cyan;
+ Console.WriteLine("Hello world!");
+ Console.ResetColor();
+
var host = CreateWebHostBuilder(args).Build();
await host.RunAsync();
diff --git a/BackEnd/Timeline/Services/DatabaseManagement/DatabaseManagementService.cs b/BackEnd/Timeline/Services/DatabaseManagement/DatabaseManagementService.cs index a4814069..ef376a7c 100644 --- a/BackEnd/Timeline/Services/DatabaseManagement/DatabaseManagementService.cs +++ b/BackEnd/Timeline/Services/DatabaseManagement/DatabaseManagementService.cs @@ -2,6 +2,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
+using Microsoft.Extensions.Logging;
using System;
using System.Threading;
using System.Threading.Tasks;
@@ -12,6 +13,7 @@ namespace Timeline.Services.DatabaseManagement {
public class DatabaseManagementService : IHostedService
{
+ private readonly ILogger<DatabaseManagementService> _logger;
private readonly IServiceProvider _serviceProvider;
private readonly bool _disableAutoBackup;
@@ -35,6 +37,10 @@ namespace Timeline.Services.DatabaseManagement {
await backupService.BackupAsync(cancellationToken);
}
+ else
+ {
+ _logger.LogWarning("Auto backup is disabled. Please backup your database manually.");
+ }
await database.Database.MigrateAsync(cancellationToken);
await customMigrator.MigrateAsync(cancellationToken);
}
diff --git a/BackEnd/Timeline/Startup.cs b/BackEnd/Timeline/Startup.cs index fa4968d7..73bcfa0c 100644 --- a/BackEnd/Timeline/Startup.cs +++ b/BackEnd/Timeline/Startup.cs @@ -59,6 +59,24 @@ namespace Timeline _enableForwardedHeaders = ApplicationConfiguration.GetBoolConfig(configuration, ApplicationConfiguration.EnableForwardedHeadersKey, false);
_forwardedHeadersAllowedProxyHosts = Configuration.GetValue<string?>(ApplicationConfiguration.ForwardedHeadersAllowedProxyHostsKey);
+
+ if (_enableForwardedHeaders)
+ {
+ Console.ForegroundColor = ConsoleColor.Green;
+ Console.WriteLine("Forwarded headers enabled.");
+ Console.ResetColor();
+
+ Console.ForegroundColor = ConsoleColor.Yellow;
+ if (_forwardedHeadersAllowedProxyHosts is not null)
+ {
+ Console.WriteLine("Allowed proxy hosts: {0}", _forwardedHeadersAllowedProxyHosts);
+ }
+ else
+ {
+ Console.WriteLine("Allowed proxy hosts settings is default");
+ }
+ Console.ResetColor();
+ }
}
public IWebHostEnvironment Environment { get; }
|