* rework server responsibilities add remote configuration * start metrics only when compiled as not debug * add some more logging to discord bot * fixes of some casts * make metrics port configurable, minor fixes * add docker bullshit * md formatting * adjustments to docker stuff * fix docker json files, fix some stuff in discord bot, add /useradd for Discord bot * adjust docker configs and fix sharded.bat * fixes for logs, cache file provider repeat trying to open filestream Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
41 lines
1.6 KiB
C#
41 lines
1.6 KiB
C#
using MareSynchronosShared.Services;
|
|
using MareSynchronosShared.Utils;
|
|
using Microsoft.Extensions.Options;
|
|
|
|
namespace MareSynchronosStaticFilesServer;
|
|
|
|
public class Program
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
var hostBuilder = CreateHostBuilder(args);
|
|
var host = hostBuilder.Build();
|
|
|
|
using (var scope = host.Services.CreateScope())
|
|
{
|
|
var options = host.Services.GetService<IConfigurationService<StaticFilesServerConfiguration>>();
|
|
var optionsServer = host.Services.GetService<IConfigurationService<MareConfigurationAuthBase>>();
|
|
var logger = host.Services.GetService<ILogger<Program>>();
|
|
logger.LogInformation("Loaded MareSynchronos Static Files Server Configuration (IsMain: {isMain})", options.IsMain);
|
|
logger.LogInformation(options.ToString());
|
|
logger.LogInformation("Loaded MareSynchronos Server Auth Configuration (IsMain: {isMain})", optionsServer.IsMain);
|
|
logger.LogInformation(optionsServer.ToString());
|
|
}
|
|
|
|
host.Run();
|
|
}
|
|
|
|
public static IHostBuilder CreateHostBuilder(string[] args) =>
|
|
Host.CreateDefaultBuilder(args)
|
|
.UseSystemd()
|
|
.UseConsoleLifetime()
|
|
.ConfigureWebHostDefaults(webBuilder =>
|
|
{
|
|
webBuilder.UseContentRoot(AppContext.BaseDirectory);
|
|
webBuilder.UseStartup<Startup>();
|
|
webBuilder.ConfigureKestrel(opt =>
|
|
{
|
|
opt.Limits.MaxConcurrentConnections = 5000;
|
|
});
|
|
});
|
|
} |